avwx-rest / avwx-engine

Aviation Weather parsing engine. METAR & TAF
MIT License
89 stars 30 forks source link

TAF not available at many airports #30

Closed eagleDiego closed 4 years ago

eagleDiego commented 4 years ago

Many European airports do not have TAF available using avwx-engine and avwx.rest.

For example:

>>> import avwx
>>> taf = avwx.Taf('EDDM')
>>> taf.update()
False

and

curl --request GET \
  --url 'https://avwx.rest/api/taf/EDDM?options=&airport=true&reporting=true&format=json&onfail=cache' \
  --header 'authorization: Bearer *******************'

Returns a cached report from 2020-03-30T17:51:54.476000Z.

The same result has been tested on EGLL, EDDF, EBBR, LFPG, LEMD.

I get up to date reports for these locations using NOAA's https://aviationweather.gov/taf/data?format=raw&ids=EDDM

devdupont commented 4 years ago

AVWX adds an extra parameter to the URL hours=2 so reports are no more than two hours old. This is to keep old METARs from populating, but I can increase the window to 7 hours when fetching TAFs since they are updated every 6 hours or so.

https://aviationweather.gov/taf/data?ids=EGLL&format=raw&hours=2

As of writing this comment, Heathrow's TAF is > 3 hours old

eagleDiego commented 4 years ago

Great, thanks! I think your latest commit fixes exactly that!