JASTERIX
C++ Library for EUROCONTROL's ASTERIX to JSON conversion.
Install / Use
/learn @OpenATSGmbH/JASTERIXREADME
jASTERIX
jASTERIX is a C++ Library for EUROCONTROL's ASTERIX to JSON conversion. It is part of the OpenATS COMPASS project, but released as a separate library to allow easy usage in other projects.
The library allows decoding of binary ASTERIX data into JSON. The ASTERIX definitions are configuration only, so additional or customized categories or editions can be added without having to recompile. Also, using the Intel TBB library allows for reasonable performance using multi-threading.
For a detailed list of features, as well as the offered commercial services, please refer to OpenATS jASTERIX.
Supported Editions
| CAT | Editions | REFs | SPFs | |-----|------------------|------|------------| | 001 | 1.1 | | | | 002 | 1.0 | | | | 004 | 1.4 | | | | 010 | 0.31 | | | | 019 | 1.2, 1.3 | | | | 020 | 1.5, 1.8 | 1.3 | | | 021 | 0.26, 2.1, 2.4 | | | | 023 | 1.2 | | | | 030 | 7.0 | | | | 034 | 1.26 | | | | 048 | 1.15, 1.23 | 1.9 | | | 062 | 1.12, 1.16, 1.18 | 1.2 | ARTAS TRIs | | 063 | 1.0,1.1 | | | | 065 | 1.2, 1.3 | | | | 247 | 1.2 | | | | 252 | 7.0 | | |
Contents
- Folder "analyze": Contains Python scripts for data analysis
- Folder "appimage": Contains files required for AppImage building
- Folder "cmake_modules": Contains cmake find scripts
- Folder "definitions": Contains ASTERIX configuration definitions
- Folder "include": Main headers
- Folder "lib": User header-only libraries
- Folder "src": Contains source code
- CMakeLists.txt: CMake config file
- LICENSE: GPL license
- README.md: This file
Requirements / Used Libraries
The following libraries are mandatory:
- Boost
- Intel Thread Building Blocks
The following libaries are optional (can be deactivated in CMakeList.txt):
- Log4Cpp
- OpenSSL
Also, the Nlohmann::JSON and the Catch2 libraries are used.
Client Installation without Building
Since v0.0.3 an client AppImage is supplied, which can be executed (without setup effort) under all recent Linux distributions (since Ubuntu 14.04).
Download the AppImage and the jASTERIX definitions from the Releases page, and extract the definitions into a local folder, e.g. 'definitions'. Execute the following command to add the executable flag to the AppImage:
chmod +x jASTERIX_client_v0.0.3-x86_64.AppImage
After this, the jASTERIX client can be run from the console (see Usage section).
Installation with Building
Download the source code from this page, then execute the following commands in the check-out folder:
mkdir build
cd build
cmake ..
make
To install the built libary in the system, execute the following command in the build folder:
sudo make install
Usage
Help
After building, the following jASTERIX client can be used (from the check-out folder):
./jASTERIX_client-x86_64.AppImage --help
INFO : Allowed options:
--help produce help message
--filename arg input file name
--definition_path arg path to jASTERIX definition files
--framing arg input framine format, as specified in the framing
definitions. raw/netto is default
--frame_limit arg number of frames to process with framing, default
-1, use -1 to disable.
--frame_chunk_size arg number of frames to process in one chunk, default
1000, use -1 to disable.
--data_block_limit arg number of data blocks to process without framing,
default 10000, use -1 to disable.
--data_write_size arg number of frame chunks to write in one file write,
default 1, use -1 to disable.
--debug print debug output (only for small files)
--debug_include_framing print debug output including framing, debug still
has to be set, disable per default
--single_thread process data in single thread
--only_cats arg restricts categories to be decoded, e.g. 20,21.
--log_perf enable performance log after processing
--add_artas_md5 add ARTAS MD5 hashes
--check_artas_md5 arg add and check ARTAS MD5 hashes (with record data),
stating which categories to check, e.g. 1,20,21,48
--add_record_data add original record data in hex
--print print JSON output
--print_indent arg intendation of json print, use -1 to disable.
--write_type arg optional write type, e.g. text,zip. needs
write_filename.
--write_filename arg optional write filename, e.g. test.zip.
Decoding Test & Performance
To test decode and measure performance, use:
./jASTERIX_client-x86_64.AppImage --definition_path definitions/ --filename example.ff --framing ioss --log_perf
INFO : jASTERIX client: decoded 674150 frames, 1073956 records in 0h 0m 8s 936ms: 75442 fr/s, 120183 rec/s
Performance depends on the used hardware, frame_chunk_size and ASTERIX data content. On the author's workstation (Intel i7 4790k) the performance varies between 50k-150k rec/s.
Decode & Print
To decode and print an ASTERIX file as JSON text, use:
./jASTERIX_client-x86_64.AppImage --definition_path definitions/ --filename src/test/cat020ed1.5.bin --print
{
"data_blocks": [
{
"category": 20,
"content": {
"index": 3,
"length": 98,
"records": [
{
"010": {
"SAC": 0,
"SIC": 2
},
"020": {
"CHN": 0,
"CRT": 0,
"DME": 0,
"FX": 1,
"FX2": 0,
"GBS": 0,
"HF": 0,
"MS": 1,
"OT": 0,
"RAB": 0,
"SIM": 0,
"SPI": 0,
"SSR": 0,
"TST": 0,
"UAT": 0,
"VDL4": 0
},
"041": {
"Latitude": 47.88232132925,
"Longitude": 16.32056296698
},
"042": {
"X": 173529.5,
"Y": 45109.0
},
"070": {
"G": 0,
"L": 1,
"Mode-3/A code": 7000,
"V": 0
},
"090": {
"Flight Level": 11.25,
"G": 0,
"V": 0
},
"140": {
"Time of Day": 33502.7109375
},
"161": {
"Track Number": 3528
},
"170": {
"CDM": 3,
"CNF": 0,
"CST": 0,
"FX": 0,
"MAH": 0,
"STH": 0,
"TRE": 0
},
"202": {
"Vx": -13.75,
"Vy": -9.25
},
"210": {
"Ax": 0.0,
"Ay": 0.0
},
"220": {
"Target Address": 148527
},
"230": {
"AIC": 0,
"ARC": 1,
"B1A": 0,
"B1B": 0,
"COM": 1,
"MSSC": 0,
"STAT": 0
},
"250": {
"Mode S MB Data": [
{
"BDS1": 1,
"BDS2": 0,
"MB Data": "10000000a00000"
},
{
"BDS1": 1,
"BDS2": 7,
"MB Data": "00000000000000"
}
],
"REP": 2
},
"400": {
"Contributing Receivers": [
{
"RUx": 0
},
{
"RUx": 0
},
{
"RUx": 0
},
{
