Ejemplo n.º 1
0
 def test_read_csv_(self) -> None:
     raw_var, fix = log.read_csv_(self.filepath)
     raw_expected = pd.DataFrame({
         'TimeNanos': [34554000000],
         'FullBiasNanos': [-1265446151445559028],
         'Svid': [2],
         'ConstellationType': [1],
         'State': [16431],
         'Cn0DbHz': [22.340620040893555]
     }).convert_dtypes()
     fix_expected = pd.DataFrame({
         'Latitude': [51.524707],
         'Longitude': [-0.134140],
         'Altitude': [114.858938],
         '(UTC)TimeInMs': [1581410967999]
     }).convert_dtypes()
     pt.assert_frame_equal(
         raw_var.loc[0:0, [
             'TimeNanos', 'FullBiasNanos', 'Svid', 'ConstellationType',
             'State', 'Cn0DbHz'
         ]], raw_expected)
     pt.assert_frame_equal(
         fix.loc[0:0,
                 ['Latitude', 'Longitude', 'Altitude', '(UTC)TimeInMs']],
         fix_expected)
Ejemplo n.º 2
0
 def test_datatype(self) -> None:
     raw_var, fix = log.read_csv_(self.filepath)
     test_columns = [
         "TimeNanos", "FullBiasNanos", 'ReceivedSvTimeNanos',
         'ConstellationType', 'Svid', 'State'
     ]
     self.assertTrue(all(raw_var[c].dtype == 'Int64' for c in test_columns))
     self.assertTrue(fix['(UTC)TimeInMs'].dtype == 'Int64')
Ejemplo n.º 3
0
 def setUp(self):
     self.filedir = "./tests/data/"
     self.filepath = self.filedir + "log_20200211.txt"
     raw_var, fix = log.read_csv_(self.filepath)
     self.gnss_obs = log.process_raw(raw_var[0:50])
     self.gnss_fix = fix[0:1]
Ejemplo n.º 4
0
 def test_joining(self) -> None:
     raw_var, gnss_fix = log.read_csv_(self.filepath)
     gnss_obs = log.process_raw(raw_var)
     self.assertWarnsRegex(
         UserWarning, '37 observations discarded without matching fix.',
         log.join_receiver_position, gnss_obs, gnss_fix)
Ejemplo n.º 5
0
 def test_processing(self) -> None:
     raw_var, _ = log.read_csv_(self.filepath)
     log.process_raw(raw_var)