ADSbDataParser
The ADSbDataParser can be used to filter and preprocess ADS-B data and is especially adapted to historic traffic data with format state_vectors_data4 of The OpenSky Network.
Install / Use
/learn @LSchmidt-TUBS/ADSbDataParserREADME
ADSbDataParser
The ADS-B data parser is based on the work of L.L. Schmidt and C. Bloemer-Zurborg conducted at the Institute of Flight Guidance, TU Braunschweig. It can be used to filter and preprocess ADS-B data and is especially adapted to historic traffic data with format state_vectors_data4 of The OpenSky Network.
Notices:
- The data parser can do its best, when fed with the whole raw trajectory available. Even though if only parts of the trajectory are of interest.
- If not deactivated: Redundant samples of the trajectory are filtered by the data parser (see redundancy-filtration). The returned parsed trajectory therefore needs to be interpolated to regain the aircraft state at any timestamp.
Example:

Note: This version (2-23) of the ADSbDataParser supports log-files of the Trino interface with the CLI-Client, but log-files of the previous Impala interface with PuTTY are still supported. (June 2024)
Quick start guide (MATLAB required)
- Download (and extract - if zipped) this repository.
- Start MATLAB and navigate to directory './MatlabInterface' in the downloaded repository-folder
- This step is optional (for completeness metric required): Download, recompile and set airport database
i. Download airport database from OurAirports here: https://ourairports.com/data/airports.csv and save the file to './MatblabInterface/airports.csv' in the downloaded repository-folder
ii. Recompile airport database with following command in MATLAB:
javaADSbParserRecompileAirportDatabase("./airports.csv", "./airportDatabase.attapt");
iii. Set airport database directory ("./airportDatabase.attapt") in files javaADSbParser.m and javaADSbParserParallel.m in variable AIRPORT_DATABASE_FILE_DIR (you may just use the presets in the comments - see lines 13 and 15 in the function files)
- Gather ADS-B data from the Historical Database of The OpenSky Network
i. Connect to the Historical Data Interface of The OpenSky Network with the Trino CLI and log the communication to the file './MatlabInterface/trinoFiles/flight_DLH9U.log'.
java -jar trino-cli-*-executable.jar --user=USER --password --server=https://trino.opensky-network.org --external-authentication --catalog "minio" --schema "osky" > ./MatlabInterface/trinoFiles/flight_DLH9U.log
Please note the hint to write the user name in all lower case letters (A Quick Guide To OpenSky's Historical Data Interface)
ii. Request flight 'DLH9U' from the Historical Database via the Trino interface with the following command:
SELECT time, icao24, lat, lon, velocity, heading, vertrate, callsign, onground, alert, spi, squawk, baroaltitude, geoaltitude, lastposupdate, lastcontact, hour FROM state_vectors_data4 WHERE callsign='DLH9U ' AND time>=1494235200 AND time<=1494246600 AND hour>=1494234000 AND hour<=1494248400;
iii. End connection (Trino - Historical Data Interface):
exit;
5. Parse the flight in Matlab with:
<pre> parsedTrajectory = javaADSbParser("./trinoFiles/flight_DLH9U.log"); </pre>- Plot the parsed trajectory in Matlab (with interpolated aircraft states - max. time-step: 10 sec.):
Redundancy-filtration, interpolation and reliability-channel
Initially the data parser is filtering redundant samples in horizontal and vertical plane. That is to say, samples which can be interpolated on an orthodrome (great circle) in the horizontal plane and with linear interpolation in the vertical plane (within certain margins) are removed from the parsed trajectory. <br> Margins are set to: <br> -> horizontal plane: cross-track-distance: +-0.01 NM, along-track-distance: +-0.1 NM<br> -> vertical plane: +-26 ft<br> <br> In combination with the filtering of faulty data, this led to a reduction of the number of samples to 7.5 % in a dataset comprising 5467 trajectories. <br> <br> When using the MATLAB-interface, the underlying raw-data (version used by the parser, not initial state-vectors-data4 trajectory) is stored in the return-struct (parsedTrajectory.raw). To utilize the aforementioned memory reduction of redundancy-filtration it is proposed to clear this field (parsedTrajectory.raw) from the result-struct, if it's not required anymore. Especially datasets with numerous parsed trajectories benefit from this memory reduction. <br> <br> To re-obtain the aircraft states, the position (horizontal plane) needs to be interpolated on an orthodrome (great circle) and the baro altitude (vertical plane) needs to be interpolated linearly. The margins of redundancy-filtration apply for these interpolated states. When using the MATLAB-interface, the interpolation can be done with following function-call:
<pre> interpolatedStates = javaADSbParserInterpolate(parsedTrajectory, timestamps); </pre> <br> The filtering of redundant samples also removes information about the timestamps of underlying supporting samples. These samples passed the data-fault filtering and are considered to be valid samples to define the final trajectory. But some of them are probably removed during redundancy filtration. <br> <br> With this removal also information about the timestamps of received state updates via ADS-B are removed. Therefore the data parsers output contains a reliability-channel (in case of MATLAB-interface: [parsedTrajectory.reliabilityTime, parsedTrajectory.reliability]). This channel shall indicate the reliability of the final (re-interpolated) trajectory, ranges from 0 to 1 and has a time-step of 5 sec. For example: In trajectory segments without receiver coverage (no supporting samples) the reliability-channel shall take 0 as value. To assess the reliability of the (re-interpolated) trajectory, this channel is recommended to be used. <br> <br> In case of the MATLAB-interface the returned struct furthermore contains all used valid (fault-filtered, but not redundancy-filtered) sample-timestamps of horizontal and vertical plane (within parsedTrajectory.samplingTime). You may also clear this field for memory reduction, if it's not required anymore. <br> <br> <br>The redundancy filtration, which is initially activated, can be turned off. For the MATLAB-interface please use the variable FILTER_REDUNDANT_SAMPLES in files javaADSbParser.m (line 16) and javaADSbParserParallel.m (line 22). To deactivate redundancy filtration in command line mode for the current execution you can use the command line argument '-r=OFF'.
Flight phase recognition
The data parser comprises functions which try to identify the flight phases of parsed trajectories. <br> <br> If the flight phase type is not specified directly by name, following indexing may be used: <br> (Please note: The enum in the source code has a different indexing.)
-1: undefined/ unknown
0: cruise
1: level
2: climb
3: descent
MATLAB plots of the data parser use the following color coding:
<img src="./images/flightPhaseColorCoding.png" alt="flight phase color coding" width="271" height=146>How to use
The data parser is developed using Java technology. You may use it directly from command line, by starting its GUI or by using the provided m-files of the MATLAB-interface.
Input data
Requests of historic flights of table state_vectors_data4 from The OpenSky Network via the Trino interface serve as input to the data parser. That is to say the parser directly loads the log-files of Trino connections, whereby each flight needs to be stored in a separate log-file. For gathering these log-files you may use the Command Line Interface (Trino). <br> To request a historic flight you can use the following request template:
SELECT time, icao24, lat, lon, velocity, heading, vertrate, callsign, onground, alert, spi, squawk, baroaltitude, geoaltitude, lastposupdate, lastcontact, hour FROM state_vectors_data4 WHERE callsign='CALLSIGN' AND time>=0 AND time<=0 AND hour>=0 AND hour<=0;
Please replace CALLSIGN with the desired callsign, whereby the String always needs to be sized to eight characters by adding spaces. For example:
Correct: callsign='FLIGHT '
Wrong: callsign='FLIGHT'
Also the time- and hour-specification needs to be adapted. For further reading please refer to A Quick Guide To OpenSky's Historical Data Interface.
How to set up an airport database (for completeness metric)
The determination of the completeness metric needs an airport database. In case there is no database available, the ADS-B data parser will work as well, but the completeness metric will be assigned as -1. The airport database needs to be in csv-format with the following table-structure:
#name,city,country,IATA code,ICAO code,lat [deg],lon [deg],elevation [ft]
In the current version of the parser only fields of lat, lon and elevation are required. The other fields may be left blank. Character # specifies the table-structure header line, whereas % can be used to set line-comments in the database file.
It is suggested to use the airport database of OurAirports, which can be found here: https://ourairports.com/data/airports.csv
MATLAB: To automatically generate the required format for the ADS-B data parser, you may use the m-function javaADSbParserRecompileAirportDatabase provided within this package:
javaADSbParserRecompileAirportDatabase("./airports.csv",
Related Skills
pestel-analysis
Analyze political, economic, social, technological, environmental, and legal forces
next
A beautifully designed, floating Pomodoro timer that respects your workspace.
product-manager-skills
45PM skill for Claude Code, Codex, Cursor, and Windsurf: diagnose SaaS metrics, critique PRDs, plan roadmaps, run discovery, and coach PM career transitions.
task.tpl
use this ALWAYS to create/update a task in json
