def ehs_decode_all(n=None): print "===== Decode all Mode-S EHS sample data=====" import csv f = open('ehs.csv', 'rt') for i, r in enumerate(csv.reader(f)): if n and i > n: break ts = r[1] m = r[2] icao = ehs.icao(m) vBDS = ehs.BDS(m) if vBDS: if vBDS == "BDS20": print ts, m, icao, vBDS, ehs.callsign(m) if vBDS == "BDS40": print ts, m, icao, vBDS, ehs.alt_mcp(m), \ ehs.alt_fms(m), ehs.pbaro(m) if vBDS == "BDS50": print ts, m, icao, vBDS, ehs.roll(m), ehs.track(m), \ ehs.gs(m), ehs.rtrack(m), ehs.tas(m) if vBDS == "BDS60": print ts, m, icao, vBDS, ehs.heading(m), ehs.ias(m), \ ehs.mach(m), ehs.baro_vr(m), ehs.ins_vr(m) else: print ts, m, icao, vBDS
def test_ehs_BDS60_functions(): assert ehs.heading("A000029CFFBAA11E2004727281F1") == 180.9 assert ehs.ias("A000029CFFBAA11E2004727281F1") == 336 assert ehs.mach("A000029CFFBAA11E2004727281F1") == 0.48 assert ehs.baro_vr("A000029CFFBAA11E2004727281F1") == 0 assert ehs.ins_vr("A000029CFFBAA11E2004727281F1") == -3648