示例#1
0
文件: run.py 项目: aeroevan/pyModeS
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
示例#2
0
文件: run.py 项目: astrofrog/pyModeS
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
示例#3
0
文件: run.py 项目: aeroevan/pyModeS
def test_ehs_BDS40_functions():
    assert ehs.alt_mcp("A000029C85E42F313000007047D3") == 3008
    assert ehs.alt_fms("A000029C85E42F313000007047D3") == 3008
    assert ehs.pbaro("A000029C85E42F313000007047D3") == 1020.0
示例#4
0
文件: run.py 项目: astrofrog/pyModeS
def test_ehs_BDS40_functions():
    assert ehs.alt_mcp("A000029C85E42F313000007047D3") == 3008
    assert ehs.alt_fms("A000029C85E42F313000007047D3") == 3008
    assert ehs.pbaro("A000029C85E42F313000007047D3") == 1020.0