xoolive / traffic

A toolbox for processing and analysing air traffic data

Home Page:https://traffic-viz.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

opensky.history returns None

damsabella opened this issue · comments

The function opensky.history returns None and it's very difficult to debug.

If I would like to pull historical takeoff/landing data from LAX, I use the following code.

from traffic.data import opensky

opensky.history('2020-01-01', '2020-01-02', cached=False, departure_airport='LAX')    # returns None

The function correctly sends all 24 hourly requests as expected, however the function output is None. Can anyone explain this?

I use:

  • Python 3.9.7
  • Traffic==2.6.6
  • Ubuntu 20.04

I'm keen to find a solution as quickly as possible, so please let me know if you have any ideas.

Airports in opensky are encoded with their ICAO identifier. Replace LAX by KLAX.

I'll close the issue, feel free to reopen if need be.
For general assistance, please prefer https://gitter.im/xoolive/traffic

Thanks for the help, perhaps this could be updated in the documentation, or the function throws an error if an invalid airport code is provided?

Actually that's already in the documentation:
https://traffic-viz.github.io/opensky_impala.html#historical-traffic-data

How would you rephrase it? (PR welcome! 😄 )

Capture d’écran 2021-12-12 à 22 44 11

The issue persists even using the ICAO identifier of the airport. I don't want to create a new issue but there is a problem with running long opensky.history(start, stop, departure_airport || arrival_airport) jobs. I'm trying to pull months of data which takes a long time to run.

The progress bar will often freeze, requiring the script to be restarted (potentially related, but also another issue)

I still encounter the same issue that opensky.history returns None. This is very frustrating given the job takes so long to execute.

If things freeze, it's certainly a connection issue.
For this granularity, I would download data day per day (and save the results each time).

Hi,

I'm encountering the same issue as above but none of the solutions above are working for me.

I'm trying to get a list of all departures from LAX between two dates in Jan 2017.

traffic version 2.6.6

from traffic.data import opensky

flights = opensky.history(
    start='some datetime',
    stop='some datetime',
    departure_airport='KLAX',
    arrival_airport=None,
    icao24=None,
    cached=False
)

print(flights) # > None

Please can you advise where I'm going wrong?

Regards,
Will

I cannot reproduce the issue:

from traffic.data import opensky

flights = opensky.history(
    start='2022-01-01 00:00',
    stop='2022-01-01 01:00',
    departure_airport='KLAX',
    arrival_airport=None,
    icao24=None,
    # cached=False
)
flights

image

If data is empty on your side, it may not be in the database anymore. Please provide the timestamps you requested if you need further assistance.

Are you able to reproduce the issue in January 2017 for Bahrain airport, OBBI?

If it returns None that's because the database is empty for those dates/flight table