Esempio 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()
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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()
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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))
Esempio 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)
Esempio 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')
Esempio 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)