Exemple #1
0
 def test_failure_3(self):
     dat = NoInitRadarData(big=True)
     dat.picks = Picks(dat)
     dat.picks.samp1 = np.ones((2, len(dat.lat)))
     dat.picks.samp2 = np.ones((2, len(dat.lat)))
     dat.picks.samp3 = np.ones((2, len(dat.lat)))
     with self.assertRaises(AttributeError):
         plot.plot_specdense(dat, 'bad')
Exemple #2
0
    def test_plot_specdense(self):
        # Only checking that these do not throw errors
        dat = NoInitRadarData(big=True)

        dat.picks = Picks(dat)
        dat.picks.samp1 = np.ones((2, len(dat.lat)))
        dat.picks.samp2 = np.ones((2, len(dat.lat)))
        dat.picks.samp3 = np.ones((2, len(dat.lat)))

        fig, ax = plot.plot_specdense(dat, 3.0e-7)
        plot.plot_specdense(dat, 3.0e-7, fig=fig)
        plot.plot_specdense(dat, 3.0e-7, fig=fig, ax=ax)
        plot.plot_specdense(dat, 3.0e-7, window='hamming')
        plot.plot_specdense(dat, 3.0e-7, scaling='density')

        # freq too low
        with self.assertRaises(ValueError):
            plot.plot_specdense(dat, -100)

        with self.assertRaises(ValueError):
            plot.plot_specdense(dat, 3.0e-7, scaling='dummy')

        with self.assertRaises(ValueError):
            plot.plot_specdense(dat, 3.0e-7, window='dummy')