aloys-c / wx2pfpx

A simple weather data provider script for the discontinued Professional Flight Plan X software.
GNU General Public License v3.0
20 stars 2 forks source link

wx2pfpx v2.7 #9

Closed PinkPony89 closed 8 months ago

PinkPony89 commented 8 months ago

Hello Aloys,

As I mentioned in my last message yesterday, my suspicion was that https://aviationweather-cprk.ncep.noaa.gov/adds/dataserver_current/ is only a temporary fallback URL to the now obsolete Text Data Server for METAR/TAF observations/forecasts. Per the NOAA API the Text Data Server has "been replaced" so it is possible that this URL will eventually be disabled permanently.

I have now updated the METAR/TAF URL's to those officially listed under the latest NOAA API https://aviationweather.gov/cgi-bin/data/dataserver.php? and I have uploaded this as wx2pfpx v2.7

Thank you and best regards,

Leo

aloys-c commented 8 months ago

Hi,

I just checked the result and I believe as a first try that something is not right, the 2.7 version is stuck on "loading weather report" for me. I think with the new API more refactoring of code is needed and just changeing the URL is not enough as it displays too much result at once, the filters might not work the same way...

PinkPony89 commented 8 months ago

Hi Aloys, thank you for your feedback.

I just tried again and to my surprise it did not work on the first attempt. However on the second attempt it was successful. Sometimes successful on the first attempt while on other occasions it would take 6 attempts. On subsequent attempts it appeared it was stuck but after 4-5 minutes would begin downloading. Seems inconsistent. Maybe server maintenance or the new API URL throttles large queries?

Capture

Regarding the difference between the URLs

"old"

https://aviationweather-cprk.ncep.noaa.gov/adds/dataserver_current/httpparam?datasource=metars&requestType=retrieve&fields=raw_text,station_id&format=xml&mostRecentForEachStation=constraint&hoursBeforeNow=3&stationString=

"new"

https://aviationweather.gov/cgi-bin/data/dataserver.php?datasource=metars&requestType=retrieve&fields=raw_text,station_id&format=xml&mostRecentForEachStation=constraint&hoursBeforeNow=3&stationString=

Both URL show identically formatted .xml outputs in a browser, so I cant find a difference between the two. However I noticed that the is significantly longer in using https://aviationweather.gov/ versus https://aviationweather-cprk.ncep.noaa.gov/

This raises my suspicions that https://aviationweather.gov/ is either or occasionally rejecting the initial download attempt while wx2pfpx is attempting to downloading the METAR/TAF for each ICAO airport code.

The NOAA API does mention that "Cache Access to all current observations and forecasts in one file, updated once a minute. Use of these files is recommended instead of making excessively large custom queries"

https://aviationweather.gov/data/cache/metars.cache.xml https://aviationweather.gov/data/cache/tafs.cache.xml

Maybe a more permanent solution would be to make wx2pfpx to download the entire METAR/TAF .xml (using the above URL's) versus making individual queries through https://aviationweather.gov/cgi-bin/data/dataserver.php?datasource=metars&requestType=retrieve&fields=raw_text,station_id&format=xml&mostRecentForEachStation=constraint&hoursBeforeNow=3&stationString=**