def test_get_satellites(self) -> None:
     obs = observations._get_satellites(self.points, set(["C", "E", "G", "R"]))
     data = satellitedata.SatelliteData()
     data._update_orbits(["2020042"])
     self.assertTrue(np.all([l in list(data.orbits["2020042"].keys()) for l in list(obs.svid)]))
     wgs=data._locate_sat(["2020042"],[3600*1e9],[obs.svid[0]])
     npt.assert_almost_equal(obs.loc[0,["sv_x","sv_y","sv_z"]],wgs.flatten(),decimal=1)
Example #2
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())))
Example #3
0
 def setUpClass(cls) -> None:
     cls.sp3 = sd._get_sp3_file('2020042')
     cls.example_orbits = sd._get_sp3_dataframe(cls.sp3)
     cls.SatelliteData=sd.SatelliteData()
     cls.truncated_orbits=cls.example_orbits.loc[np.isin(cls.example_orbits['svid'],["G18","G14"]) & (cls.example_orbits['time'] < 2*60*60*10**9)].reset_index(drop=True)
     cls.poly=sd._create_orbit(cls.truncated_orbits)
     for sv,dic in cls.poly.items():
         cls.SatelliteData.orbits['2020042'][sv]= OrderedDict(sorted(dic.items()))
Example #4
0
 def test_setup(self):
     empty=sd.SatelliteData()
     self.assertEqual(empty.orbits,{})