def base_mag_1min_plot(starttime, endtime, coords, ax=None): """ Plot spectrogram of MAG data """ magdata = heliopydata.mag_1min(starttime, endtime, coords) for Baxis in ['Bx', 'By', 'Bz']: ax.plot(magdata.index, magdata.to_dataframe()[Baxis], label=Baxis) ax.set_ylabel("MAG \n{0} coords \n[\\nT] ".format(coords))
def test_mag(self): df = cassini.mag_hires(self.starttime, self.endtime) check_data_output(df) # Check that a RTN co-ordinate download works too starttime = datetime(2004, 5, 1) endtime = datetime(2004, 5, 2) df = cassini.mag_hires(starttime, endtime) check_data_output(df) # Check that no data raises an error starttime = datetime(2040, 5, 1) endtime = datetime(2040, 5, 2) with pytest.raises(RuntimeError): df = cassini.mag_hires(starttime, endtime) df = cassini.mag_1min(self.starttime, self.endtime, 'KSO') check_data_output(df)