Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@michaelweinold
So first of all: This is WIP, and still rough around the edges but this is so we can have the data ready to go for the poster. The code itself will be refined on Monday, and the next week. (like moving the API calls etc.)
We have 4 files which generate the matrices. All the matrices are on the OneDrive here.
They are saved in a matrix format and give the following number between the the airports:
Average Available Seats/flight in this week (AAS/week)
So there are 52 .csv files and they have numbers between 100-300 mostly.
I held off on using the Aircraft API for now with the exact numbers of each aircraft using its registration, since I noticed how little flights actually had the registration in the API response. Instead I made a missing_aircraft.py file which identifies all the aircraft models from the routes and then used ChatGPT to give me the average number of seats on those models. I spotchecked the aircraft and the numbers I got for the seats that ChatGPT gave me, and they look good. They are also combined with the benchmark list you gave me Michael.
Does this hold up for now?
Next the matrix_generator.py takes the info from the {airport}.json on the flights between cities and accesses the number of seats from the aircraft_seat_list.py to add them up over one week into one matrix and then divides them by the number of aircraft it added up.
Then it skips forward 7 days and makes the next matrix.
QUICK AND DIRTY DATA VALIDATION
So just as a sanity check I calculated the numbers for the route in a specific week.
KLAX-KSFO on 2023-06-01 gives us 136 AAS/flight in that week as per our matrix.
From our other API call I get 37.86 average daily flights in that week from KLAX to KSFO.
37.86*'136*'7 days = 36'043 AAS that week
36'043*'52 weeks*'2 directions=3'748'472 Available seats that year.
If we apply an average load factor of 83% from that time of the year. See this IATA metric..
Then we get: 3'111'232 PAX.
From OAG we get the following figure.
![SEATS KLAX KSFO](https://private-user-images.githubusercontent.com/118805682/333832681-5b204da8-b0ae-4c3d-8447-1b0347ab5120.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MDQxNjEsIm5iZiI6MTczOTQwMzg2MSwicGF0aCI6Ii8xMTg4MDU2ODIvMzMzODMyNjgxLTViMjA0ZGE4LWIwYWUtNGMzZC04NDQ3LTFiMDM0N2FiNTEyMC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMlQyMzQ0MjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jYWQzOTViNzI5OGRhNDFmZWZhOWE1Njk4YWRmODc2NDJjY2ZjMzU1NmQ2NjI0NzJmN2E2YjkyYWFmY2RkZGFlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.7mE7U1c1bhXIrw_-7KFPfjYcGaZq1FDO5AK4EIPjUIM)
To me that kinda doesn't look too bad to be honest. What do we think?