snstac / aircot Goto Github PK
View Code? Open in Web Editor NEWAircraft classifiers for TAK
Home Page: https://aircot.rtfd.io
License: Apache License 2.0
Aircraft classifiers for TAK
Home Page: https://aircot.rtfd.io
License: Apache License 2.0
Add support for @sgofferj's TAK-ADSB-ID.
I'm getting data from airplanes.live and using adsxbcot to convert it into a CoT. It seems to work fine except for TIS-B data. I get the following traceback:
Traceback (most recent call last):
File "/home/administrator/airplanes_live2cot.py", line 26, in get_airplanes_live_data
event = adsbxcot.adsbx_to_cot(craft, known_craft=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/administrator/.venv/lib/python3.11/site-packages/adsbxcot/functions.py", line 203, in adsbx_to_cot
cot: Union[ET.Element, None] = adsbx_to_cot_xml(craft, config, known_craft)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/administrator/.venv/lib/python3.11/site-packages/adsbxcot/functions.py", line 150, in adsbx_to_cot_xml
cot_type = aircot.set_cot_type(icao_hex, cat, flight, known_craft)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/administrator/.venv/lib/python3.11/site-packages/aircot/functions.py", line 349, in set_cot_type
cot_type = aircot.adsb_to_cot_type(icao_hex, category, flight)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/administrator/.venv/lib/python3.11/site-packages/aircot/functions.py", line 88, in adsb_to_cot_type
icao = int(f"0x{icao.replace('~', 'TIS-B_')}", 16)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 16: '0xTIS-B_308639'
This is the data it's failing on:
{'hex': '~308639', 'type': 'tisb_other', 'alt_baro': 'ground', 'gs': 0.0, 'track': 0.0, 'lat': xx.xxxxxx, 'lon': xx.xxxxxx, 'nic': 8, 'rc': 186, 'seen_pos': 13.15, 'nac_p': 8, 'nac_v': 2, 'sil': 2, 'sil_type': 'unknown', 'mlat': [], 'tisb': ['gs', 'track', 'lat', 'lon', 'nic', 'rc', 'nac_p', 'nac_v', 'sil', 'sil_type'], 'messages': 11, 'seen': 13.2, 'rssi': -29.3, 'dst': 4.347, 'dir': 180.9}
I think a possible fix would be to change icao = int(f"0x{icao.replace('~', 'TIS-B_')}", 16)
to icao = int(f"0x{icao.replace('~', '')}", 16)
. If you're ok with that, I can submit a PR. Thanks!
https://ankushkunwar7777.medium.com/working-with-large-csv-file-using-python-1ec6577c5ce6
https://www.reddit.com/r/learnpython/comments/37mh7b/faster_way_to_store_lookup_tables_than_csv/
https://towardsdatascience.com/%EF%B8%8F-load-the-same-csv-file-10x-times-faster-and-with-10x-less-memory-%EF%B8%8F-e93b485086c7
https://www.reddit.com/r/sqlite/comments/xul9sa/is_there_a_way_to_convert_a_csv_file_into_an/
https://til.simonwillison.net/sqlite/import-csv
https://sqlite-utils.datasette.io/en/stable/cli.html#inserting-csv-or-tsv-data
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.