def test_read_iff_callsigns(self): filename = os.path.join(THIS_DIR, '..', 'sample_data/IFF_SFO_ASDEX_3aircraft.csv') df = read_iff_file(filename, callsigns='ABC123') self.assertEqual(len(df), 194) self.assertEqual(len(df['callsign'].unique()), 1) df = read_iff_file(filename, callsigns=['DEF456','GHI789']) self.assertEqual(len(df), 372) self.assertEqual(len(df['callsign'].unique()), 2)
def test_read_iff(self): filename = os.path.join(THIS_DIR, '..', 'sample_data/IFF_SFO_ASDEX_ABC123.csv') df_dict = read_iff_file(filename, 'all') expected_rows = {0:1, 1:1, 2:1, 3:724, 4:6} # Basic consistency check on number of entries for each record: for rec, df in df_dict.items(): self.assertEqual(len(df), expected_rows[rec])
################################################################################### """ Step 1a: Read in IFF Data using PARA-ATM """ ################################################################################### from paraatm.io import iff, gnats, utils from paraatm.io.iff import read_iff_file import pandas as pd iff_fname = 'IFF_SFO+ASDEX_20190511_080104_86221.csv' iff_data = read_iff_file(iff_fname, record_types=[2, 3, 4, 8]) ################################################################################### """ Step 1b: Select IFF data within the specified timeframe """ ################################################################################### time_interval = 1200 start_time = iff_data[2]['time'].iloc[0] end_time = pd.to_datetime(start_time.value * 10**(-9) + time_interval, unit='s') iff_data[2] = iff_data[2].loc[iff_data[2].time <= end_time, :] iff_data[3] = iff_data[3].loc[iff_data[3].time <= end_time, :] iff_data[4] = iff_data[4].loc[iff_data[4].time <= end_time, :] iff_data[8] = iff_data[8].loc[iff_data[8].time <= end_time, :] ################################################################################### """