Author Topic: NOAA Climate Reports  (Read 920 times)

0 Members and 1 Guest are viewing this topic.

Offline Mark / Ohio

  • Live from Mars!
  • Forecaster
  • *****
  • Posts: 2511
    • Fairfield County Weather
NOAA Climate Reports
« on: August 08, 2017, 11:32:40 PM »
One of my loyal website viewers reported to me today that my June report was actually the same as my May report.  Turns out it also did the same for 2016.  Years before that are ok though.  I can bring up the correct report in WeatherLink but somehow the May report got loaded and filed as June the last two years.

Thoughts?

Click on June for both 2017 and 2016 and you'll see what I mean.

http://fairfieldcountyweather.com/NOAAarchive.php?yr=2017&mo=06

Actually your report for June 2017 is also showing the May report instead as well Ken but your 2016 report is OK.

http://saratoga-weather.org/scripts-NOAAtxt.php?yr=2017&mo=06

 ;)  So it must not be something I done to break it for a change.  :lol:
« Last Edit: August 08, 2017, 11:49:42 PM by Mark / Ohio »
Mark 
2002 Davis VP I Wireless, WeatherLink (Serial), GRLevel3, VirtualVP, StartWatch, Weather Display, Windows 10


Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Climate Reports
« Reply #1 on: August 09, 2017, 12:38:21 AM »
Oooh.. I'm embarrassed to have not caught that on my own site!  It looks like I was running some old code that didn't change the timezone properly, so it did the copy of NOAAPRMO.TXT early (before the month ended) instead of later (8 hrs after the month starts, and same for the yearly copy).

It started in April on my site (when I moved to a new VPS), so Apr, May, Jun, Jul were all incorrect (each containing the prior month).  Now it's all fixed (I hope).. that's the problem with debugging something that happens once per month or year.

What I changed in the script version was
Code: [Select]
putenv("TZ=$ourTZ");
to
Code: [Select]
if (!function_exists('date_default_timezone_set')) {

if (! ini_get('safe_mode') ) {
   putenv("TZ=$ourTZ");  // set our timezone for 'as of' date on file
}
  } else {
   date_default_timezone_set($ourTZ);
 }
so the timezone would be correctly set.  It was only with WeatherLink that this was important, as the script copies NOAAPRMO.TXT (and NOAAPRYR.TXT) to be the prior month (and year) NOAA reports.. for VWS or Cumulus, the files are named and handled by the weather software.

Thanks for spotting the issue(s) Mark!
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 Mark / Ohio

  • Live from Mars!
  • Forecaster
  • *****
  • Posts: 2511
    • Fairfield County Weather
Re: NOAA Climate Reports
« Reply #2 on: August 10, 2017, 12:27:09 AM »
As always thanks for such a quick fix Ken!   :grin:

I made the script changes and uploaded the correct pages for the prior months.
Mark 
2002 Davis VP I Wireless, WeatherLink (Serial), GRLevel3, VirtualVP, StartWatch, Weather Display, Windows 10


Offline spweather

  • Contributor
  • ***
  • Posts: 130
    • Sand Point Weather
Re: NOAA Climate Reports
« Reply #3 on: August 10, 2017, 12:05:28 PM »
Hi,

In what file are these changes applied?

I'm confused when to use/include include-NOAA-reports.php vs NOAA-reports-test.php

Thanks,
Dennis
« Last Edit: August 11, 2017, 11:08:22 AM by spweather »
Regards,
Dennis

- Davis Wireless Vantage Pro2 Plus w/24hr FARS
- Davis (Ultra)Sonic Anemometer
- Boltek/MicroLDN TOA Lightening Detection
- Porcupine Labs LR4/Fluke 414D Laser Rangefinder snow depth measuring sensor


Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Climate Reports
« Reply #4 on: August 10, 2017, 12:12:10 PM »
That fix was for the standalone version of the script (NOAA-reports-test.php) -- the one in the Saratoga template (include-NOAA-reports.php) already had the fix :)
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 spweather

  • Contributor
  • ***
  • Posts: 130
    • Sand Point Weather
Re: NOAA Climate Reports
« Reply #5 on: August 10, 2017, 12:19:48 PM »
Thanks for the clarification Ken.

Dennis
Regards,
Dennis

- Davis Wireless Vantage Pro2 Plus w/24hr FARS
- Davis (Ultra)Sonic Anemometer
- Boltek/MicroLDN TOA Lightening Detection
- Porcupine Labs LR4/Fluke 414D Laser Rangefinder snow depth measuring sensor


Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 727
    • Lake Huron Weather
Re: NOAA Climate Reports
« Reply #6 on: August 10, 2017, 12:51:17 PM »
Yes thanks for the clarification Ken, appreciate it  :-)

CW3699

 

anything