Closed PinkPony89 closed 8 months ago
Hi Leo,
You are probably right the function xml2array was quite unstable and depending on very strict structure to work, I think that what should need to be updated. Since the v2.7 doesn't add anything to the v.2.6 I think we should keep the latter for the moment and migrate to 2.7 once the code is fully working with both TAFS and METARS on new url...
By the way, I don't think the code in the "utils" folder is really called regarding the parsing of the stations, this was old code that is kept just in case...
Aloys
Hello again Aloys,
I submitted a new pull request for v2.7 As you mentioned my previous release was getting stuck on "Downloading last weather reports..." I tested it all day and it was very inconsistent. Sometime it would work sometimes it wouldn't, which make me look closer at the new Dataserver URL under the new API.
I noticed that the METAR .xml output was identical between the old https://aviationweather-cprk.ncep.noaa.gov/adds/dataserver_current/httpparam? and the new new https://aviationweather.gov/cgi-bin/data/dataserver.php? very unlikely that this was causing the download to get stuck.
However as I eventually realized the TAF outputs are indeed different!
old using EGLL as an example
https://aviationweather-cprk.ncep.noaa.gov/adds/dataserver_current/httpparam?datasource=tafs&requestType=retrieve&fields=raw_text,station_id&format=xml&mostRecentForEachStation=constraint&hoursBeforeNow=3&stationString=EGLL
new using EGLL as an example
https://aviationweather.gov/cgi-bin/data/dataserver.php?datasource=tafs&requestType=retrieve&fields=raw_text,station_id&format=xml&mostRecentForEachStation=constraint&hoursBeforeNow=3&stationString=EGLL
My suspicion is that the additional lines in the API Dataserver .xml output when using the new https://aviationweather.gov/cgi-bin/data/dataserver.php? TAF URL are somehow causing a problem during processing of the TAF. Maybe before/during to the xml2array process?
I have updated the METAR in v2.7 to the new API Dataserver URL. However I am still using the old fallback TAF URL https://aviationweather-cprk.ncep.noaa.gov/ as using the new TAF Dataserver URL is causing inconsistent downloads.
I made ~100 download attempts ranging from 1 to 6 forecasts and all of them were successful. v2.7 is now successful at downloading METAR/TAF each time. Please let me know if you are experienced the same?
I will continue to investigate what changes in the wx2pfpx code may be necessary to process the new TAF code consistently.
I still suspect that https://aviationweather-cprk.ncep.noaa.gov/ will eventually be "retired" permanently once NOAA and the stakeholders are satisfied with the new API.
The new TAF Dataserver URL is https://aviationweather.gov/cgi-bin/data/dataserver.php?datasource=tafs&requestType=retrieve&fields=raw_text,station_id&format=xml&mostRecentForEachStation=constraint&hoursBeforeNow=3&stationString=
If you have any time to check this, maybe you can determine what changes in the wx2pfpx code are necessary to consistently process download/process the new .xml output when using the new TAF Dataserver URL
Leo