Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- example decode of message5
- cat > foo.ais << EOF
- !BSVDM,2,1,9,A,55QI<002A9>7<Hm3F20Lht84j085V2222222221?BpDA:7<h,0*03
- !BSVDM,2,2,9,A,0GPQC30PFH8888888888880,2*5C
- EOF
- ais_normalize.py -a -T foo.ais > foo.ais.norm
- cat foo.ais.norm
- !BSVDM,1,1,9,A,55QI<002A9>7<Hm3F20Lht84j085V2222222221?BpDA:7<h0GPQC30PFH8888888888880,2*5A
- ./noaadata/ais/ais_msg_5.py -d '!BSVDM,1,1,9,A,55QI<002A9>7<Hm3F20Lht84j085V2222222221?BpDA:7<h0GPQC30PFH8888888888880,2*5A'
- shipdata:
- MessageID: 5
- RepeatIndicator: 0
- UserID: 370560000
- AISversion: 0
- IMOnumber: 9512161
- callsign: 3FMP5
- name: GLOBAL BAY
- shipandcargo: 79
- dimA: 151
- dimB: 20
- dimC: 17
- dimD: 10
- fixtype: 1
- ETAmonth: 12
- ETAday: 25
- ETAhour: 16
- ETAminute: 0
- draught: 9.4
- destination: BELLBAY
- dte: 0
- Spare: 0
- cd libais
- make -f Makefile-custom python2
- find . -name \*.so
- ./build/lib.macosx-10.8-x86_64-2.7/ais.so
- export PYTHONPATH=./build/lib.macosx-10.8-x86_64-2.7
- ipython
- Python 2.7.6 (default, Nov 17 2013, 16:05:36)
- In [1]: import ais
- In [2]: ais.decode('55QI<002A9>7<Hm3F20Lht84j085V2222222221?BpDA:7<h0GPQC30PFH8888888888880')
- ---------------------------------------------------------------------------
- error Traceback (most recent call last)
- <ipython-input-2-96fc8c8f20e2> in <module>()
- ----> 1 ais.decode('55QI<002A9>7<Hm3F20Lht84j085V2222222221?BpDA:7<h0GPQC30PFH8888888888880')
- error: Ais5: AIS_ERR_BAD_BIT_COUNT
- In [3]: ais.decode('55QI<002A9>7<Hm3F20Lht84j085V2222222221?BpDA:7<h0GPQC30PFH8888888888880', 2)
- Out[3]:
- {u'ais_version': 0L,
- u'callsign': u'3FMP5 ',
- u'destination': u'BELLBAY ',
- u'dim_a': 151L,
- u'dim_b': 20L,
- u'dim_c': 17L,
- u'dim_d': 10L,
- u'draught': 9.399999618530273,
- u'dte': 0L,
- u'eta_day': 25L,
- u'eta_hour': 16L,
- u'eta_minute': 0L,
- u'eta_month': 12L,
- u'fix_type': 1L,
- u'id': 5L,
- u'imo_num': 9512161L,
- u'mmsi': 370560000L,
- u'name': u'GLOBAL BAY ',
- u'repeat_indicator': 0L,
- u'spare': 0L,
- u'type_and_cargo': 79L}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement