Exemplo n.º 1
0
 def test_naming(self) -> None:
     time = tm.utc_to_gps(
         pd.Series([np.datetime64('2020-02-11T00:59:42', 'ns')]))
     data = sd.SatelliteData()
     out = data.name_satellites(time)
     self.assertSetEqual(set(out.iat[0]),
                         set(list(data.orbits['2020042'].keys())))
Exemplo n.º 2
0
 def test_locate_satellites(self):
     time = pd.Series([np.datetime64('2020-02-11T00:59:42', 'ns')])
     time = tm.utc_to_gps(time)
     time.name = 'gpstime'
     doy = tm.gps_to_doy(time)
     svid = pd.Series(["G18"],name='svid').convert_dtypes()
     predict=self.SatelliteData.locate_satellites(svid,time)
     entry=self.truncated_orbits.loc[(self.truncated_orbits['svid']=="G18") & (self.truncated_orbits['time']==doy['time'][0]),:].reset_index(drop=True)
     npt.assert_almost_equal(np.array(predict.loc[:,'sv_x':'sv_z']).flatten(),np.asarray([entry.x,entry.y,entry.z]).flatten(),decimal=0)
Exemplo n.º 3
0
 def test_locate_sat_check_entries(self):
     entries = pd.Series(
         np.arange(np.datetime64('2020-02-11T00:14:42', 'ns'),
                   np.datetime64('2020-02-11T01:39:42', 'ns'),
                   np.timedelta64(20, 'm')))
     entries = pd.Series(
         np.append(entries, np.datetime64('2020-02-11T01:39:42', 'ns')))
     entries = tm.gps_to_doy(tm.utc_to_gps(entries))
     npt.assert_almost_equal(
         list(self.SatelliteData.orbits["2020042"]["G18"]),
         list(entries['time']))
Exemplo n.º 4
0
 def test_locate_sat(self):
     time = pd.Series([np.datetime64('2020-02-11T00:59:42', 'ns')])
     gpstime = tm.gps_to_doy(tm.utc_to_gps(time))
     entry = self.truncated_orbits.loc[
         (self.truncated_orbits['svid'] == "G18") &
         (self.truncated_orbits['time'] == gpstime['time'][0]
          ), :].reset_index(drop=True)
     predict = self.SatelliteData._locate_sat(gpstime['date'][0],
                                              gpstime['time'][0], "G18")
     npt.assert_almost_equal(predict,
                             np.asarray([entry.x, entry.y,
                                         entry.z]).flatten(),
                             decimal=3)
Exemplo n.º 5
0
 def test_gps_utc(self) -> None:
     ns = pd.Series([(1167264018 * 10**9),1167264018*10**9+1],index=[2,3],name='foo').convert_dtypes()
     ts = pd.Series([pd.Timestamp(year=2017,month=1,day=1,hour=0,minute=0,second=0,nanosecond=0),pd.Timestamp(year=2017,month=1,day=1,hour=0,minute=0,second=0,nanosecond=1)],index=[2,3],name='foo').convert_dtypes()
     pt.assert_series_equal(tm.gps_to_utc(ns),ts,check_exact=True)
     pt.assert_series_equal(tm.utc_to_gps(ts),ns,check_exact=True)
Exemplo n.º 6
0
 def test_gps_utc(self) -> None:
     ns = pd.Series([(1167264018 * 10**9),pd.NA],dtype='Int64')
     ts = pd.Series([pd.Timestamp(year=2017, month=1, day=1, hour=0, minute=0, second=0, nanosecond=0), pd.NaT])
     pt.assert_extension_array_equal(tm.gps_to_utc(ns).array,ts.array,check_exact=True)
     pt.assert_extension_array_equal(tm.utc_to_gps(ts).array,ns.array,check_exact=True)