How ameliacmu/ameliaswim works
1. What this repository is
AmeliaSWIM is a data preparation pipeline, not an application server. Its job is to turn raw FAA SWIM trajectory feeds into research-ready airport-surface movement datasets used by Amelia/Amelia-10/Amelia-42.
2. Main external dependency boundary
The pipeline starts from raw .njson.gz files downloaded from a public OpenStack Swift dataset. Everything else in the repo is about downloading, filtering, geometrically constraining, and converting those raw records into CSV-based scene windows.
3. Core processing path
The central flow is:
raw SWIM files → airport/month configuration selection → filtering and coordinate conversion → windowed CSV outputs.
The key executable for this is process.py, with process_parrallel.py providing the same logical pipeline for multi-core execution.
4. Configuration-driven architecture
The repo is heavily config-based. conf/config.yaml, conf/data/*, and conf/airports/* define the processing run.
- Month configs determine the time range and dataset slice.
- Airport configs define airport metadata such as reference latitude/longitude, altitude filtering, and geofence selection.
This makes the pipeline parameterized by airport and time period rather than hardcoded.
5. Airport ROI / geofence subsystem
Airport boundary logic lives in conf/fences/*.csv and conf/airports/*.yaml. These define the region of interest used to keep only relevant surface movement around each airport.
The repository treats the geofence as a first-class artifact: filtering is not just temporal, but spatial.
6. GIS asset subsystem
conf/qgist/ contains QGIS project and GIS source assets (.qgz, .shp, .osm, .dbf, .prj, etc.). These are the source-of-truth map artifacts used to create or edit airport polygons and ROI boundaries.
In the architecture, this is a separate GIS authoring boundary feeding the preprocessing pipeline.
7. Raw-data acquisition subsystem
download_raw.py handles fetching raw data over a time interval into a local directory such as swim_data/.
This is the ingestion boundary between the external Swift-hosted dataset and local processing storage.
8. Data transformation subsystem
The transform stage converts trajectory messages from raw JSON-like records into structured CSVs. Based on the configs described in the README, this stage:
- filters by airport and time window,
- applies altitude limits,
- converts to Cartesian coordinates using airport reference lat/lon,
- writes segmented CSV files for downstream model training and benchmarking.
9. Batch and scale-out execution
The scripts/ directory contains orchestration helpers for larger runs and HPC environments:
- run.sbatch, run_pair.sbatch, run_all.sh, run_all_slurm.sh
- load_azure.bash
- utility scripts like gen_split.py, gen_unix_stamps.py, compare_csvs.py
These are operational wrappers around the same preprocessing pipeline, used to scale dataset generation and validate outputs.
10. Datasets and output organization
The repo includes config/data collections for two major dataset families:
- Amelia10: benchmark subsets by month/airport
- Amelia42: the larger 42-airport corpus, split into many run-specific YAML fragments
The expected output of the pipeline is processed CSV data plus associated map assets, organized so downstream forecasting experiments can consume them consistently.
11. Validation and reproducibility boundary
test.py, compare_csvs.py, and the versioned config/assets indicate an emphasis on reproducible dataset generation. The repository’s outputs are meant to be deterministic for a given airport, time range, and configuration set.
12. Packaging/runtime
This is a Python project packaged with pyproject.toml, with environment definition in environment.yml. The repo is meant to be run locally or on batch compute, with configuration overrides supplied at launch time in a Hydra-like style.
Main entry points: process.py Main process · run_all_slurm.sh HPC wrappers · compare_csvs.py CSV checks · config.yaml Base config
Components 18
External data
Raw FAA SWIM trajectory files and local staging for fetched inputs.
- Swift SWIM · Public OpenStack Swift source of raw .njson.gz trajectory feeds.
- Local cache · Downloaded raw SWIM files stored locally for processing.
Config & GIS
Airport, month, and geofence assets that parameterize dataset generation.
- Base config · Top-level pipeline defaults and shared configuration wiring.
amelia_swim/conf/config.yaml - Dataset slices · Amelia10 and Amelia42 run definitions that select time spans and corpus slices.
amelia_swim/conf/data/default.yaml - Airport configs · Per-airport settings such as reference coordinates and altitude constraints.
amelia_swim/conf/airports/kdca.yaml - Geofences · Airport region-of-interest polygons used to spatially filter movement records.
amelia_swim/conf/fences/kdca.csv - GIS assets · QGIS projects and shapefile/osm assets used to author airport polygons.
amelia_swim/conf/qgist/maps.qgz
Processing
Primary pipeline stages that download, filter, convert, and emit CSV windows.
- Raw downloader · Fetches SWIM records over a requested time interval into local storage.
amelia_swim/download_raw.py - YAML generator · Builds or expands processing configuration fragments for airports and dataset runs.
amelia_swim/generate_yaml.py - Main process · Single-process end-to-end transformation from raw feeds to scene-window CSVs.
amelia_swim/process.py - Parallel process · Multi-core variant of the same preprocessing pipeline.
amelia_swim/process_parrallel.py - Filter & gate · Applies airport, time-window, altitude, and ROI filtering to raw records.
- Coordinate convert · Converts trajectories into airport-relative Cartesian coordinates.
- Window builder · Segments processed trajectories into CSV scene windows for downstream use.
- Processed CSVs · Final structured CSV outputs consumed by Amelia forecasting experiments.
Ops & validation
Batch wrappers and output comparison helpers for scale-out runs.
- HPC wrappers · SBATCH and shell entrypoints for repeated or large-scale dataset generation.
scripts/run_all_slurm.sh - Azure load · Helper for moving data to or from cloud-backed batch environments.
scripts/load_azure.bash - CSV checks · Utilities for splitting, timestamp generation, and output comparison.
scripts/compare_csvs.py
Connections 19
- Swift SWIM → Raw downloader: source · Raw SWIM feeds are fetched by the downloader.
- Raw downloader → Local cache: writes · Downloaded files are stored in local staging.
- Base config → Main process: drives · Base configuration wires the main pipeline.
- Dataset slices → Main process: selects · Dataset slices determine the temporal and corpus scope.
- Airport configs → Main process: parameterizes · Airport metadata configures filtering and conversion.
- Geofences → Main process: bounds · Geofence polygons constrain the spatial filter.
- GIS assets → Geofences: authoring source · GIS assets feed the maintained fence boundaries.
- YAML generator → Base config: generates · YAML generation prepares run configuration fragments.
- Local cache → Main process: input · Local raw files are consumed by the processing driver.
- Main process → Filter & gate: executes · The main driver orchestrates filtering.
- Parallel process → Filter & gate: executes · The parallel driver runs the same logical stages.
- Filter & gate → Coordinate convert: feeds · Filtered trajectory records are converted to local coordinates.
- Coordinate convert → Window builder: feeds · Coordinate-transformed tracks are segmented into windows.
- Window builder → Processed CSVs: produces · Windowed CSV outputs are written for downstream experiments.
- HPC wrappers → Main process: wraps · Batch scripts launch the main preprocessing pipeline.
- HPC wrappers → Parallel process: wraps · Batch scripts also launch the parallel variant.
- Azure load → Local cache: supports · Cloud transfer helpers support staging input data.
- CSV checks → Processed CSVs: checks · Validation tools compare generated CSV outputs.
- CSV checks → Window builder: inspects · Utilities help verify segmentation and timestamping behavior.