Author Topic: NOAA NWS decomissioning weather.noaa.gov website June 15, 2016 (METAR source)  (Read 3961 times)

0 Members and 1 Guest are viewing this topic.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7259
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
But.. all is not lost.  They have activated HTTP access to an older site which contains the METAR data in the same format.

The METAR information is used in the Saratoga template set for current conditions (all WX software plugins except Weather-Display) and for the wxmetar.php page.
A new version of get-metar-conditions-inc.php (V1.14 23-May-2016) is available on the updates page Query for Base-*,Plugin-* 23-May-2016 or direct download here

The URLs used are changing
from:  http://weather.noaa.gov/pub/data/observations/metar/stations/<ICAO>.TXT
to:     http://tgftp.nws.noaa.gov/data/observations/metar/stations/<ICAO>.TXT


Please do your updates before June 15, 2016 -- the weather.noaa.gov site will be taken offline then and your conditions and metar displays will cease to function on your website if you have not updated the get-metar-conditions-inc.php script to V1.14.  The V1.14 script works NOW and will work after the NWS site decommission.

Thanks to Wim for reminding me about this upcoming change so we (collectively) can be ready.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 459
    • LexMAWeather
Do you know of any similar change with the forecast site? I have a cron job that runs every 15 mins to get the forecast (and alerts) and I'll occasionally get an email from my provider with an output message from the job (see below) indicating that a redirect was seen. It isn't happening all that often and sometimes comes in spurts for up to an hour. I started seeing these on May 18.

Quote
<!-- redirect found in
HTTP/1.1 200 OK
Server: Apache
X-NIDS-ServerID: vm-lnx-nids-www34
X-Powered-By: PHP/5.3.3
X-UA-Compatible: IE=Edge
Access-Control-Allow-Origin: *
Content-Type: text/html
Date: Tue, 24 May 2016 09:45:01 GMT
Content-Length: 123
Connection: close

&lt;script language='javascript'&gt;window.location.href='http://forecast.weather.gov/MapClick.php?zoneid=MAZ014&amp;zflg=1'&lt;/script&gt; -->

If this has nothing to do with the original subject, I'll create a new question.

Thanks!

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8589
    • Meteotemplate
Thanks Ken!

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 459
    • LexMAWeather
I'll note that I got an "unable to load" display rather than my current condition displayed until I deleted the current METAR cache file. All is well otherwise.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7259
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Do you know of any similar change with the forecast site? I have a cron job that runs every 15 mins to get the forecast (and alerts) and I'll occasionally get an email from my provider with an output message from the job (see below) indicating that a redirect was seen. It isn't happening all that often and sometimes comes in spurts for up to an hour. I started seeing these on May 18.

Quote
<!-- redirect found in
HTTP/1.1 200 OK
Server: Apache
X-NIDS-ServerID: vm-lnx-nids-www34
X-Powered-By: PHP/5.3.3
X-UA-Compatible: IE=Edge
Access-Control-Allow-Origin: *
Content-Type: text/html
Date: Tue, 24 May 2016 09:45:01 GMT
Content-Length: 123
Connection: close

&lt;script language='javascript'&gt;window.location.href='http://forecast.weather.gov/MapClick.php?zoneid=MAZ014&amp;zflg=1'&lt;/script&gt; -->

If this has nothing to do with the original subject, I'll create a new question.

Thanks!

The redirect issue is unrelated to this change (but no need to create a separate topic).  The NWS is decommissioning the weather.noaa.gov website.  That was used by my scripts to get METAR information.  It is used by others for text forecasts, radar images, etc.  The tgftp.nws.noaa.gov site (in existence for many years) was formerly only useable by FTP, but HTTP access has been enabled, and the same document tree (minus the /pub/) exists on the tgftp.nws.noaa.gov site (a blessing for us).

Your issue is with the forecast.weather.gov website.  They have a funky way of doing redirects (with a JavaScript location setting v.s. the normal HTTP 302 redirect with a Location: header) when the normal point-printable forecast is not available -- the redirect sends you to the text-only Zone forecast for the area instead.  My advforecast2.php script detects that, and just parses the text-only forecast to extract and interpolate icons and temperatures for the display.  The point forecast nonavailability happens when they're updating their database, doing maintenance, or something causes a disconnect in their forecast database:webserver connection.

Hope this helps...
Best regards,
Ken

 
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 459
    • LexMAWeather
Thanks for the detailed explanation, Ken!!

Offline Joel

  • Senior Member
  • **
  • Posts: 72
Thanks for the reminder !

Offline Mearns

  • Senior Member
  • **
  • Posts: 61
    • Glenbervie Weather
Earlier today I updated my get-metar-conditions-inc.php to V1.14 23-May-2016.  All works okay but whereas before my cloud height was shown in feet it is now shown in metres.  I have not changed anything else and as I've not looked at this for many years (and with my limited knowledge) I can't recall how to change cloud height back to feet.  Any help greatly appreciated! http://www.glenbervie-weather.org/wxmetar.php
Tony
Glenbervie, North East Scotland, http://www.glenbervie-weather.org

Vantage Pro 2 - Weather Display 10.37S Build 81

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 459
    • LexMAWeather
Ken will probably chime in here, but until then maybe I can get you close.

In the file get-metar-conditions.php, search for the variable $doMetric. It gets set at the top of the function mtr_get_cloud_cover() based upon the units of temperature used. If you are using C (which I assume you are), then $doMetric gets set true and when CLOUD-DETAILS are processed later in the function, the metric conversion of the value is used.

         $mtrInfo['CLOUDS'] = $cloudCode[$pieces[1]];
         $altitude = (integer) 100 * $pieces[2];  // units are feet
         $altitudeM = round($altitude/3.28084);
         if(!isset($mtrInfo['CLOUD-DETAILS'])) {$mtrInfo['CLOUD-DETAILS'] = '';}
         if($doMetric) {
            $mtrInfo['CLOUD-DETAILS'] .= $cloudCode[$pieces[1]]." ${altitudeM} m\t";
         } else {
            $mtrInfo['CLOUD-DETAILS'] .= $cloudCode[$pieces[1]]." ${altitude} ft\t";
         }


So you'd have to modify the code in one place or the other to display feet.

Offline Mearns

  • Senior Member
  • **
  • Posts: 61
    • Glenbervie Weather
Brilliant!! Thanks very much Jasiu. Once you had pointed me to the correct bit I managed to work it out and my cloud bases are now in feet. =D&gt;
Tony
Glenbervie, North East Scotland, http://www.glenbervie-weather.org

Vantage Pro 2 - Weather Display 10.37S Build 81

 

anything