Author Topic: advforecast2.php question  (Read 929 times)

0 Members and 1 Guest are viewing this topic.

Offline tcooper

  • Member
  • *
  • Posts: 3
    • 92.1 WGYT
advforecast2.php question
« on: October 30, 2017, 07:19:46 PM »
Hi Eveyone,
I'm having a problem with my advforecast2.php page on my website (921wgyt.com...Saratoga based)  It keeps displaying old weather.  Specifically, the data that was downloaded the day I created the site.  I've checked the cache folder (and deleted the obvious stuff).  It downloads the correct data but continues to show the old data.  I'm going crazy!! Can anyone give any thoughts on what may be going on?

Thanks!
Trey Cooper

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast2.php question
« Reply #1 on: October 30, 2017, 09:19:54 PM »
loading wxforecast.php?force=1 and doing a view source shows
Quote
<!-- advforecast2.php (JSON) - V5.04 - 11-Oct-2017 on PHP 5.6.30-->
<!-- RAW NWS URL: http://forecast.weather.gov/MapClick.php?lat=34.93837000000008&lon=-82.22758999999996&unit=0&lg=english&FcstType=text&TextType=2 -->
<!-- zone=SCZ006 -->
<!-- corrected NWS API URL='https://api.weather.gov/points/34.9384,-82.2276/forecast' -->
<!-- curl fetching 'https://api.weather.gov/points/34.9384,-82.2276/forecast' -->
<!-- HTTP stats:  RC=503 dest=23.36.68.92 port=443 (from sce=192.155.252.228)
      Times: dns=0.000 conn=0.020 pxfer=0.081 get=0.244 total=0.325 secs -->
<!-- headers returned:
HTTP/1.1 503 Service Unavailable
Server: nginx
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Content-Type: application/problem+json
Retry-After: 120
Access-Control-Allow-Origin: *
X-Server-ID: vm-bldr-nids-apiapp177.ncep.noaa.gov
X-Correlation-ID: ee3c23bc-2211-42ac-957f-578b953a4e31
X-Request-ID: ee3c23bc-2211-42ac-957f-578b953a4e31
Cache-Control: max-age=600
Expires: Tue, 31 Oct 2017 01:25:34 GMT
Date: Tue, 31 Oct 2017 01:15:34 GMT
Connection: close
Vary: Accept
 -->
<!-- Oops.. point forecast unavailable RC=503 - using Zone instead -->
<!-- curl fetching 'https://api.weather.gov/zones/JSON-LD/SCZ006/forecast' -->
<!-- HTTP stats:  RC=200 dest=23.36.68.92 port=443 (from sce=192.155.252.228)
      Times: dns=0.000 conn=0.020 pxfer=0.070 get=0.023 total=0.093 secs -->
<!-- loaded (Zone forecast) https://api.weather.gov/zones/JSON-LD/SCZ006/forecast - 13298 bytes -->
<!-- wrote cache file ./cache/forecast-SCZ006-0-json.txt -->
so this just indicates that the point-forecast wasn't available, so the zone forecast was fetched/cached and used.

The NWS is still tinkering with the api.weather.gov site, and sometimes there are long periods where the point-forecast may not be available, so the zone forecast will be substituted (when it's available).

The script seems to be performing as designed, and your website's access to the api.weather.gov is fine, as is the use of the cache directory.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline tcooper

  • Member
  • *
  • Posts: 3
    • 92.1 WGYT
Re: advforecast2.php question
« Reply #2 on: October 31, 2017, 07:51:07 AM »
Thank for taking a look Ken!

That explains the error message on the point forecast.  Any thoughts on why the backup zone forecast would be showing old info?

I really appreciate you and everyone else that has made code available to others.  There is no way I could have ever come up with something this nice.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast2.php question
« Reply #3 on: October 31, 2017, 02:29:09 PM »
I guess that your particular point and zone forecasts were in the NWS 'Twilight Zone' for a while.  I've encountered other sites (with different point and Zone forecasts) showing the same symptoms:  point-forecast API unavailable, Zone forecast via API showing 'stale' data.

It's all connected with how the NWS api.weather.gov site gets refreshed data from the GFS system -- that part has been problematic and is likely one of the reasons why forecast-v3.weather.gov site is still 'beta' and not scheduled (yet) for cutover to production at this time.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP