示例#1
0
 def test_to_from_csv(self):
     flight = Flight.from_log('test/ekfv3_test.BIN')
     flight.to_csv('temp.csv')
     flight2 = Flight.from_csv('temp.csv')
     os.remove('temp.csv')
     self.assertAlmostEqual(flight2.duration, flight.duration)
     self.assertAlmostEqual(flight2.zero_time, flight.zero_time)
示例#2
0
 def test_baro(self):
     flight = Flight.from_log('test/ekfv3_test.BIN')
     atm = flight.read_fields(Fields.ATMOSPHERE)
     self.assertLess(atm.iloc[0, 0], 120000)
     self.assertGreater(atm.iloc[0, 0], 90000)
     self.assertLess(atm.iloc[0, 1], 30)
     self.assertGreater(atm.iloc[0, 1], 0)
示例#3
0
    def test_frequency(self):
        with open("test/test_inputs/manual_F3A_P21_21_09_24_00000052.json",
                  "r") as f:
            fc_json = load(f)
        flight1 = Flight.from_fc_json(fc_json)

        flight2 = Flight.from_log('test/test_inputs/test_log_00000052.BIN')
        freq1 = flight1.duration / len(flight1.data)
        freq2 = flight2.duration / len(flight2.data)
        self.assertAlmostEqual(freq1, freq2, 5)
示例#4
0
    def test_unique_identifier(self):
        with open("test/test_inputs/manual_F3A_P21_21_09_24_00000052.json",
                  "r") as f:
            fc_json = load(f)
        flight1 = Flight.from_fc_json(fc_json)
        self.assertIsInstance(flight1.unique_identifier(), str)

        flight2 = Flight.from_log('test/test_inputs/test_log_00000052.BIN')
        self.assertIsInstance(flight2.unique_identifier(), str)
        print(flight2.unique_identifier())

        self.assertEqual(flight1.unique_identifier(),
                         flight2.unique_identifier())
示例#5
0
    def test_ekfv2(self):
        flight = Flight.from_log("test/xkfv2_log.BIN")
        qs = flight.read_fields(Fields.QUATERNION)

        self.assertFalse(qs.isnull().values.all())
示例#6
0
 def test_quaternions(self):
     flight = Flight.from_log('test/00000150.BIN')
     quats = flight.read_fields(Fields.QUATERNION)
     self.assertFalse(quats[pd.isna(quats.quaternion_0) == False].empty)
示例#7
0
 def test_missing_arsp(self):
     flight = Flight.from_log('test/00000150.BIN')
     self.assertGreater(flight.duration, 500)
示例#8
0
    def test_axis_rates(self):
        flight = Flight.from_log("test/test_inputs/test_log_00000052.BIN")

        axis_rates = flight.read_fields(Fields.AXISRATE)

        self.assertFalse(axis_rates.isnull().values.all())