Exemplo n.º 1
0
    def test_plotPLOTARGS(self, mock_plot_rad, mock_show):
        plot.plot([os.path.join(THIS_DIR, 'input_data', 'small_data.mat')])
        mock_plot_rad.assert_called_with(Any(RadarData),
                                         xdat='tnum',
                                         ydat='twtt',
                                         x_range=None,
                                         pick_colors=None,
                                         clims=None,
                                         cmap=Any(object),
                                         flatten_layer=None)
        mock_plot_rad.reset_called()
        plot.plot([os.path.join(THIS_DIR, 'input_data', 'small_data.mat')],
                  xd=True)
        mock_plot_rad.assert_called_with(Any(RadarData),
                                         xdat='dist',
                                         ydat='twtt',
                                         x_range=None,
                                         pick_colors=None,
                                         clims=None,
                                         cmap=Any(object),
                                         flatten_layer=None)
        mock_plot_rad.reset_called()
        plot.plot([os.path.join(THIS_DIR, 'input_data', 'small_data.mat')],
                  yd=True)
        mock_plot_rad.assert_called_with(Any(RadarData),
                                         xdat='tnum',
                                         ydat='depth',
                                         x_range=None,
                                         pick_colors=None,
                                         clims=None,
                                         cmap=Any(object),
                                         flatten_layer=None)
        mock_plot_rad.reset_called()
        plot.plot([os.path.join(THIS_DIR, 'input_data', 'small_data.mat')],
                  xd=True,
                  yd=True)
        mock_plot_rad.assert_called_with(Any(RadarData),
                                         xdat='dist',
                                         ydat='depth',
                                         x_range=None,
                                         pick_colors=None,
                                         clims=None,
                                         cmap=Any(object),
                                         flatten_layer=None)
        mock_plot_rad.reset_called()

        # Check that we can save
        plot.plot([os.path.join(THIS_DIR, 'input_data', 'small_data.mat')],
                  xd=True,
                  yd=True,
                  s=True)
        mock_plot_rad.assert_called_with(Any(RadarData),
                                         xdat='dist',
                                         ydat='depth',
                                         x_range=None,
                                         pick_colors=None,
                                         clims=None,
                                         cmap=Any(object),
                                         flatten_layer=None)
        mock_plot_rad.reset_called()
Exemplo n.º 2
0
 def test_plotLOADPE(self, mock_plot_rad):
     plot.plot([os.path.join(THIS_DIR, 'input_data', 'test_pe.DT1')],
               filetype='pe')
     mock_plot_rad.assert_called_with(Any(RadarData),
                                      xdat='tnum',
                                      ydat='twtt',
                                      x_range=None)
Exemplo n.º 3
0
def plot_radargram(fns=None,
                   s=False,
                   o=None,
                   xd=False,
                   yd=False,
                   o_fmt='png',
                   dpi=300,
                   in_fmt='mat',
                   picks=False,
                   clims=None,
                   cmap='gray',
                   flatten_layer=None,
                   **kwargs):
    """Plot data as a radio echogram."""
    plot.plot(fns,
              xd=xd,
              yd=yd,
              s=s,
              o=o,
              ftype=o_fmt,
              dpi=dpi,
              filetype=in_fmt,
              pick_colors=picks,
              cmap=cmap,
              clims=clims,
              flatten_layer=flatten_layer)
Exemplo n.º 4
0
 def test_plotPLOTSPECDENSE(self, mock_plot_specdense, mock_show):
     plot.plot([os.path.join(THIS_DIR, 'input_data', 'small_data.mat')],
               spectra=(0, 1),
               window=0,
               scaling=1)
     mock_plot_specdense.assert_called_with(Any(RadarData), (0, 1),
                                            window=0,
                                            scaling=1)
Exemplo n.º 5
0
 def test_plotLOADPE(self, mock_plot_rad, mock_show):
     plot.plot([os.path.join(THIS_DIR, 'input_data', 'test_pe.DT1')],
               filetype='pe')
     mock_plot_rad.assert_called_with(Any(RadarData),
                                      xdat='tnum',
                                      ydat='twtt',
                                      x_range=None,
                                      pick_colors=None,
                                      clims=None,
                                      cmap=Any(object),
                                      flatten_layer=None)
Exemplo n.º 6
0
def plot_power(fns=None,
               layer=None,
               s=False,
               o=None,
               o_fmt='png',
               dpi=300,
               in_fmt='mat',
               **kwargs):
    plot.plot(fns,
              power=layer,
              s=s,
              o=o,
              ftype=o_fmt,
              dpi=dpi,
              filetype=in_fmt)
Exemplo n.º 7
0
def plot_power(fns=None,
               layer=None,
               s=False,
               o=None,
               o_fmt='png',
               dpi=300,
               in_fmt='mat',
               **kwargs):
    """Plot the return power of a particular layer."""
    plot.plot(fns,
              power=layer,
              s=s,
              o=o,
              ftype=o_fmt,
              dpi=dpi,
              filetype=in_fmt)
Exemplo n.º 8
0
def plot_radargram(fns=None,
                   s=False,
                   o=None,
                   xd=False,
                   yd=False,
                   o_fmt='png',
                   dpi=300,
                   in_fmt='mat',
                   **kwargs):
    plot.plot(fns,
              xd=xd,
              yd=yd,
              s=s,
              o=o,
              ftype=o_fmt,
              dpi=dpi,
              filetype=in_fmt)
Exemplo n.º 9
0
def plot_traces(fns=None,
                t_start=None,
                t_end=None,
                yd=False,
                s=False,
                o=None,
                o_fmt='png',
                dpi=300,
                in_fmt='mat',
                **kwargs):
    plot.plot(fns,
              tr=(t_start, t_end),
              yd=yd,
              s=s,
              o=o,
              ftype=o_fmt,
              dpi=dpi,
              filetype=in_fmt)
Exemplo n.º 10
0
def plot_traces(fns=None,
                t_start=None,
                t_end=None,
                yd=False,
                s=False,
                o=None,
                o_fmt='png',
                dpi=300,
                in_fmt='mat',
                **kwargs):
    """Plot traces in terms of amplitude vs some vertical variable."""
    plot.plot(fns,
              tr=(t_start, t_end),
              yd=yd,
              s=s,
              o=o,
              ftype=o_fmt,
              dpi=dpi,
              filetype=in_fmt)
Exemplo n.º 11
0
    def test_plotPLOTARGS(self, mock_plot_rad):
        plot.plot([os.path.join(THIS_DIR, 'input_data', 'small_data.mat')])
        mock_plot_rad.assert_called_with(Any(RadarData),
                                         xdat='tnum',
                                         ydat='twtt',
                                         x_range=None)
        mock_plot_rad.reset_called()
        plot.plot([os.path.join(THIS_DIR, 'input_data', 'small_data.mat')],
                  xd=True)
        mock_plot_rad.assert_called_with(Any(RadarData),
                                         xdat='dist',
                                         ydat='twtt',
                                         x_range=None)
        mock_plot_rad.reset_called()
        plot.plot([os.path.join(THIS_DIR, 'input_data', 'small_data.mat')],
                  yd=True)
        mock_plot_rad.assert_called_with(Any(RadarData),
                                         xdat='tnum',
                                         ydat='depth',
                                         x_range=None)
        mock_plot_rad.reset_called()
        plot.plot([os.path.join(THIS_DIR, 'input_data', 'small_data.mat')],
                  xd=True,
                  yd=True)
        mock_plot_rad.assert_called_with(Any(RadarData),
                                         xdat='dist',
                                         ydat='depth',
                                         x_range=None)
        mock_plot_rad.reset_called()

        # Check that we can save
        plot.plot([os.path.join(THIS_DIR, 'input_data', 'small_data.mat')],
                  xd=True,
                  yd=True,
                  s=True)
        mock_plot_rad.assert_called_with(Any(RadarData),
                                         xdat='dist',
                                         ydat='depth',
                                         x_range=None)
        mock_plot_rad.reset_called()
Exemplo n.º 12
0
def plot_spectrogram(fns=None,
                     freq_lower=None,
                     freq_upper=None,
                     window=None,
                     scaling='spectrum',
                     yd=False,
                     s=False,
                     o=None,
                     o_fmt='png',
                     dpi=300,
                     in_fmt='mat',
                     **kwargs):
    """Plot a spectrogram."""
    plot.plot(fns,
              spectra=(freq_lower, freq_upper),
              window=window,
              scaling=scaling,
              yd=yd,
              s=s,
              o=o,
              ftype=o_fmt,
              dpi=dpi,
              filetype=in_fmt)
Exemplo n.º 13
0
def plot_hft(fns=None,
             s=False,
             o=None,
             xd=False,
             yd=False,
             o_fmt='png',
             dpi=300,
             in_fmt='mat',
             **kwargs):
    """
    Plot the fourier spectrum of the data in the horizontal.

    Might be useful for guessing how to horizontally filter.
    """
    plot.plot(fns,
              xd=xd,
              yd=yd,
              s=s,
              o=o,
              ftype=o_fmt,
              dpi=dpi,
              filetype=in_fmt,
              hft=True)
Exemplo n.º 14
0
def plot_ft(fns=None,
            s=False,
            o=None,
            xd=False,
            yd=False,
            o_fmt='png',
            dpi=300,
            in_fmt='mat',
            **kwargs):
    """
    Plot the fourier spectrum of the data.

    Can be useful if you have mystery data of unknown frequency.
    """
    plot.plot(fns,
              xd=xd,
              yd=yd,
              s=s,
              o=o,
              ftype=o_fmt,
              dpi=dpi,
              filetype=in_fmt,
              ft=True)
Exemplo n.º 15
0
 def test_plotHFT(self, mock_plot_hft, mock_show):
     plot.plot([os.path.join(THIS_DIR, 'input_data', 'small_data.mat')],
               hft=True)
     mock_plot_hft.assert_called_with(Any(RadarData))
Exemplo n.º 16
0
 def test_plotPLOTPOWER(self, mock_plot_power):
     plot.plot([os.path.join(THIS_DIR, 'input_data', 'small_data.mat')],
               power=0)
     mock_plot_power.assert_called_with(Any(RadarData), 0)
Exemplo n.º 17
0
 def test_plotPLOTTRACES(self, mock_plot_tr):
     plot.plot([os.path.join(THIS_DIR, 'input_data', 'small_data.mat')],
               tr=0)
     mock_plot_tr.assert_called_with(Any(RadarData), 0, ydat='twtt')
Exemplo n.º 18
0
 def test_plotBADINPUT(self):
     with self.assertRaises(ValueError):
         plot.plot([os.path.join(THIS_DIR, 'input_data', 'small_data.mat')],
                   tr=0,
                   power=1)