The scripts in here serve to help you understand more about your ADS-B setup. I'm mostly interested in analyzing data for Wingbits, as it's a fun project, but this can apply to any of the Wiedehopf's ADS-B setups.
This Python script analyzes data from an ADS-B receiver tracking aircraft, specifically focusing on identifying unique aircraft within a specified time period. The script reads aircraft data from a JSON file, filters the data based on the 'seen' time, and then identifies unique aircraft based on their hexadecimal identifiers ('hex' codes).
- Read and Parse JSON Data: The script reads data from
aircraft.json
, which contains information about aircraft tracked by the ADS-B receiver. - Time Period Filtering: Aircraft data is filtered to focus on a specific time period, such as the last 15 minutes.
- Unique Aircraft Identification: The script identifies unique aircraft based on their 'hex' codes within the specified time frame.
-
Set Up the Data Source: Ensure
aircraft.json
is available at/run/readsb/aircraft.json
with current aircraft data from your ADS-B receiver. -
Run the Script: Execute the script to analyze the data. By default, it processes data from the last 15 minutes. Modify the
minutes
parameter infilter_data_by_time
function to change this duration. -
View Results: The script outputs the number of unique aircraft detected in the specified time frame.
- Python 3
- Access to
aircraft.json
generated by an ADS-B receiver.
Unique aircraft in the last 15 minutes: 99
Maximum range seen: 115.8 nautical miles
Average range seen: 51.0 nautical miles
- Time Frame Adjustment: Change the
minutes
argument in thefilter_data_by_time
function to analyze a different time period. - File Path: Update the
file_path
variable in themain
function if youraircraft.json
is located elsewhere.
This Python script is designed to analyze data from Automatic Dependent Surveillance-Broadcast (ADS-B) receivers. It calculates the average time period required to receive at least two messages from a specified number of unique aircraft. The script reads data from an aircraft.json
file, which contains information about aircraft detected by the ADS-B receiver.
- Read ADS-B Data: The script reads aircraft data from a JSON file (
aircraft.json
). - Unique Aircraft Identification: Identifies unique aircraft based on their hexadecimal identifiers ('hex' codes).
- Average Time Calculation: Calculates the average time period to receive at least two messages from a specified number of unique aircraft.
- Diagnostic Information: Provides details such as total aircraft processed, number of unique aircraft, minimum and maximum 'seen' values, and the length of the time period analyzed.
- The script relies on reading the
aircraft.json
file, which updates every 5 seconds. Without some cron jobbing, you'll get incorrect readings. This means the script might not capture every aircraft detected within the specified time frame, especially if the script's execution coincides with an update toaircraft.json
.
-
Ensure
aircraft.json
is Available: The script reads data fromaircraft.json
, typically located at/run/readsb/aircraft.json
. Ensure this file is present and being updated by your ADS-B receiver. -
Run the Script: Execute the script using Python. By default, it analyzes data for 100 unique aircraft but can be customized for a different number.
python3 path_to_script.py
-
View Results: The script outputs diagnostic information and the average time period for receiving at least two messages from the specified number of unique aircraft.
- Target Flights: Change the
target_flights
parameter in thecalculate_average_period
function to analyze a different number of unique aircraft.
- Python 3
- Access to
aircraft.json
generated by an ADS-B receiver.
Total aircraft processed: [Number]
Time period: [Start Time] to [End Time]
Length of time period: [X.XXX] minutes
Number of unique aircraft: [Number]
Minimum 'seen' value: [X] seconds
Maximum 'seen' value: [X] seconds
Average time period for receiving at least 2 messages from 100 unique flights: [X.X] minutes
This project is licensed under the MIT License.