Repo for paper Incorporating Dynamic Flight Network in SEIR to Model Mobility between Populations
.
See requirements.txt
.
This project leverages pyflightdata API, a wrapper around flightradar24, to fetch flights data.
.
|-- datasets
| |-- airports
| |-- edge_lists
| |-- historic_flights
| |-- unique_flights
|-- graphs
| |-- covid
| |-- flights
|-- logs
|-- src
| |-- data
| |-- model
|-- states
- Fetch all countries:
python src/data/fetch_countries.py
- Fetch all airports of all country:
python src/data/fetch_airports.py
- Collect a list of flights departing and arriving a the given country:
python src/data/fetch_unique_flights.py --countries Canada
Note: due to limitations ofpyflightdata
,fetch_unique_flights.py
can only fetch live flights. In order to obtain a comprehensive list of flights to and from Canada, one must run this script repeatly over a long period of time. - Fetches the historic flights of a given country:
python src/data/fetch_historic_flights.py --countries Canada
Note: by default,pyflightdata
only returns historic data for the past 7 days. In order to obtain 90/360 days of past flights, one must subscribe to the Silver/Gold plan on flightradar24 and login programmatically withf.login("username", "password")
. - Download
owid-covid-data.csv
from Total COVID-19 Tests Performed by Country and place it underdatasets
folder. - Download
can_covid19.csv
from Coronavirus disease (COVID-19): Outbreak update and place it underdatasets
folder. - Download
reported_flights_stats.csv
from Domestic and international Itinerant movements and place it underdatasets
folder. - Download
canada_population_by_prov.csv
and place it underdatasets
folder.
- Construct flight network edge list for Canada:
python src/data/construct_edge_list.py --country=Canada
followed bypython src/data/process_flights_data.py
- Construct flight network edge list for provinces:
python src/data/construct_edge_list.py --use_country --country=Canada
followed bypython src/data/process_flights_data.py --use_country
- To process test positive rates for the world, run
src/data/process_positive_rate_world.ipynb
to producetest-rate-processed.csv
- To process test positive rates for provinces, run
src/data/process_positive_rate_can.ipynb
to producecan_covid19_processed.csv
- To generate interpolated test positive rates, run
src/data/interpolate_positive_rate.ipynb
to produceinterpolated_positive_rates.csv
- To generate data used for experiments, run
src/data/flight-seir-Canada.ipynb
. The generated data will be saved in thestates
folder.
Run src/model/early_time_prediction.ipynb
or src/model/reopen_simulation.ipynb
.