×

Notice

The forum is in read only mode.

download flight trajectories for 2021/07/21

2 years 8 months ago - 2 years 8 months ago #1812 by milenko
Hello,

I am successfully running the example:

examples.pyviz.org/opensky/opensky.html#opensky-gallery-opensky

Now I would like to download and display the flight trajectories for 2021/07/21

How can I do that with the upper jupyter example file?

In the jupyter nootebook ist written:

"Here we will use a subset of the data that was polled from their REST API at an interval of 1 minute over 4 days (September 5-13, 2016), using the collect_data.py and prepare_data.py."

How can I apply this in Windows 10 to receive the data for 2021/07/21?

Thank you for your help.

Best regards,
Milenko





content of collect_data.py:

"""
Run a cron job with the following script running at one-minute intervals
over a four-day period to collect the data used in the notebook.
"""
import json, sqlite3, requests, pandas as pd
DB='./data/opensky.db'
conn = sqlite3.connect(DB)
api_url = 'opensky-network.org/api/states/all'
cols = ['icao24', 'callsign', 'origin', 'time_position', 'time_velocity',
        'longitude', 'latitude', 'altitude', 'on_ground', 'velocity',
        'heading', 'vertical_rate', 'sensors']
req = requests.get(api_url)
content = json.loads(req.content)
states = content
df = pd.DataFrame(states, columns=cols)
df = content
df.to_sql('opensky', conn, index=False, if_exists='append')
 
2 years 8 months ago #1813 by strohmeier
You're probably supposed to install the whole thing somehow, haven't tested it. The parq file is linked here though, still works github.com/pyviz-topics/examples/blob/f3...anaconda-project.yml
Powered by Kunena Forum