I have ~10k aircraft tracks (coordinates with altitude information) and I want to plot them in a way to show how far away they are from the lower boundary of a given airspace volume.
A quick primer on airspace structure
Airspaces are separated in controlled and uncontrolled volumes. In Europe everything above 10,000 ft altitude is controlled airspace and everything beneath it uncontrolled airspace. Simply speaking in controlled airspace there is an air traffic controller responsible for keeping aircrafts properly separated and in uncontrolled airspace this is the responsibility of the pilot. Most airports that see commercial traffic have therefore an extension of controlled airspace that reaches all the way to the ground. Its shape is similar to an inverted wedding cake:
What I tried so far
My idea was to use the airspace polygons to select all points of the tracks that lie inside that airspace with gmtselect
and use gmtmath
to subtract the lower altitude of said airspace from the altitude of the aircraft at that point.
- If the result is negative the aircraft is below and therefore outside the airspace (see (1) in the illustration above)
- If the result is positive but <1,000 ft then the aircraft is inside the airspace but too close to the floor (see (2) and (3) in the illustration above)
My problems
gmtselect
only gives me a subset of my points inside the airspace. My track gets torn apart. This is not desired.- Needs to be done for every “cake floor” separately. It seems I can’t pass a list of polygons to
gmtselect
- Gets really tedious with complex airspace geometries at large airports
I haven’t found an elegant solution so far. How would you tackle the problem?
Thank you for your ideas and all the best,
Kristof
Example to play with
You can clearly see the complex airspace structure in magenta. The lines with the color gradient are aircraft tracks with their altitude color-coded.
coordinates for the runways
FRA-rwy-thr.txt (249 Bytes)
airspaces, the number after the “>” is the floor of the airspace in feet
airspace.txt (2.1 KB)
a number of sample tracks in the Frankfurt area
tracks.txt (286.6 KB)
#!/usr/bin/env bash
gmt makecpt -T0/39000 -Cseis > track.cpt
gmt convert tracks.txt -i7,6,3 -Fv -o0,1,3,4,2 > trackv.txt
gmt begin FRA-airspace
gmt set MAP_FRAME_TYPE=plain
gmt coast -R007:24:13.64/49:01:59.90/009:54:13.64/51:01:59.90r \
-JL008:34:13.64/50:01:59.90/49:31:59.90/50:31:59.90/20c \
-B+t"EDDF \057 FRA"+s"Frankfurt am Main, Germany" \
-Ia/0.5p,lightblue -Saliceblue -W0.5p,lightblue \
--FONT_TITLE=24p,Helvetica-Bold,black
gmt plot airspace.txt -: -B -W5p,magenta2
gmt plot FRA-rwy-thr.txt -W0.5p,black
gmt plot trackv.txt -Sv1p+s -W2p+cl -Ctrack.cpt -i0,1,4,2,3
gmt end