In our requirements section (1.1), one requirement is to print an information summary of any requested airport. The printout should include information about the airport, its runways, landing aids and nearby navaids and waypoints. The airport and runway information will come from apt.dat. The trouble with this file is that it is huge; it is 366 MB and contains 10.4 million rows. So for this project, rather than going through the trouble of restructuring this datafile into airport and runway tables, I decided to just write a parser that will scan the file on demand. That is, the user will enter an ICAO code, and the program will scan through the airport data file to pull out the airport and runway information. We will use Cold Bay, Alaska (PACD) as our example airport.
Here is the top of apt.dat. It doesn't look as friendly as the earlier files...
Let's inspect what we have grabbed so far:
So far so good. Moving on to the next step...
We can print out some results for inspection. I've highlighted the new values that were extracted.
Next we parse the runway data and reform it into a dataframe; this dataframe will be stored in the 'runways' entry of our airport_data dictionary.
Inspect the results...
And here is the runway dataframe we created:
In real life, runway lengths are defined with "declared distances" that include dimensions of stopways and clearways. We don't have that level of granularity available in our data. So:
length_m means the physical strip length
Furthermore:
the runway lengths are not in the raw data; we calculated them using the runway threshold coordinates using PyGeodesy
likewise, the true bearing was calculated from the runway threshold coordinates
Now that we have extracted the runway data, we can also check whether these runways have ILS or Localizer landing aids. This data is in the file we looked at in the previous section: earth_nav.dat.
For PACD, a single row was found:
'4 55.194722222 -162.718705556 71 11030 18 52718.405 ICDB PACD PA 15 ILS-cat-I'
This is an ILS aid for RWY 15. After parsing the data out, the resulting table looks like this:
In the next section, we will continue populating our airport dictionary with values needed for our airport summary printout.