Author Topic: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script  (Read 9028 times)

0 Members and 1 Guest are viewing this topic.

Offline ed2kayak

  • Ed
  • Forecaster
  • *****
  • Posts: 613
  • Davis Vantage Pro2 w/12 hr FARS, solar/uv
    • Cumberland Valley Weather
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #50 on: July 09, 2019, 10:28:24 AM »
Thanks Beteljuice, update in place and working. [tup]
Ed
CoCoRaHS PA-CD-6,  Weather Underground KPAMECHA7, CWOP DW5425

Offline thebigboi

  • Member
  • *
  • Posts: 24
    • Murfreesboro Weather Station
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #51 on: July 14, 2019, 10:53:11 AM »
The Betle Juice,

Everything has been working fine until yesterday and I noticed after the morning NOAA update I started getting odd information. I pulled the text file for today and it is doing it again. Using an NOAA update doesn't work in that it simply repeats the same text file. You can see the info on the webpage www.murfreesboroweather.com

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #52 on: July 14, 2019, 06:43:14 PM »
Too late .....

Everything has 'cleared' now !

So I don't know what the corruption was on the NOAA page.

Because there were figures to 'parse' the prog accepted them as genuine and stored them, and when those figures persisted with no obvious errors everything had to wait until next 'tomorrow' check.

If it happens again do noaarec.php?noaabug - view source and copy the actual report section either as txt, or if you do it from the <head> section as html.

Was it the same time time-slot that normally has missing data ? - perhaps they partially fixed it, but made things worse for us  ](*,)

Why doesn't NOAA like your location ??  :roll:
Imagine what you will KNOW tomorrow !

Offline thebigboi

  • Member
  • *
  • Posts: 24
    • Murfreesboro Weather Station
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #53 on: July 14, 2019, 06:53:28 PM »
The Beteljuice,

Yes, it happens during the period when there is insufficient info. It certainly does look like they don't want us to use the data. Thanks.

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #54 on: July 14, 2019, 07:03:51 PM »
BTW ..

From your attached cachefile:

14,104,3,56,4,1,1

Translates as:

Day 14, MaxTemp 104, MaxYear 3, MinTemp 56, MinYear 4, MaxAvg 1, Minavg 1

So at least the Min/Max temp seems to be reported at last, but the rest  :lol:
Imagine what you will KNOW tomorrow !

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #55 on: July 15, 2019, 10:36:22 AM »
Hmpph ..

Today your 08:00 report has gone back to all Max and average data missing (Which the prog copes with) So someone must be playing somewhere ....

Watch that space  :roll:

Edit: Difficult to say without knowing what was in that 'crashing' report, but I suspect that only the first digits of year(s) and averages(s) were being produced else the cache values would look different (the 'fields' are in a different order to the report, but the min / max values were being parsed correctly)
« Last Edit: July 15, 2019, 11:41:17 AM by the beteljuice »
Imagine what you will KNOW tomorrow !

Offline K3JAE

  • Contributor
  • ***
  • Posts: 137
  • Davis VP2 Wireless
    • K3JAE's Weather Station
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #56 on: July 29, 2019, 01:10:20 PM »
Is there a specific time when these reports actually roll over to the current date? If so I will build a CRON event to auto grab these at a specific time. Based on what I've seen, MEG (assuming local WFO is the ones who actually run this) does them whenever they feel like it and may run it multiple times per day, once per day or within seconds of the first run.

Would be hard to schedule a event to grab the data unless I force a CRON event to run say every 4 hours.


73's de K3JAE

John
K3JAE Weather Station

Offline thebigboi

  • Member
  • *
  • Posts: 24
    • Murfreesboro Weather Station
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #57 on: July 29, 2019, 02:12:56 PM »
My NOAA site (Nashville) usually puts out four different reports, early morning, late morning, early evening and late evening. It is  the late morning report that does not list the maximum high or average high. To date, the last version issued by The betlejuice has worked good.

Offline K3JAE

  • Contributor
  • ***
  • Posts: 137
  • Davis VP2 Wireless
    • K3JAE's Weather Station
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #58 on: July 29, 2019, 03:04:53 PM »
I will check Memphis' reports to ensure all reports show the Daily HIGH/LOW records. I had not paid that too much attention. I believe I am using the latest version (v3) so I should be OK. I have not noticed any discrepancies and script appears to be working properly.


73's de K3JAE

John
K3JAE Weather Station

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #59 on: July 29, 2019, 05:26:31 PM »
... and script appears to be working properly.
... So why do you feel the need to cron  #-o
Imagine what you will KNOW tomorrow !

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #60 on: December 07, 2019, 04:24:29 AM »
Sir beteljuice,
Hope things are well.

If you get a moment, could you point me into the right direction to take care of a little hiccup with this script.

Day before yesterday and today, the record low temp for the Bradford Airport was 0°, but the script was throwing a -100° reading as seen below


This is from the noaarecdat.txt file
Code: [Select]
7,63,1998,,1970,36,21with the low temp missing.

From the URL to the Bradford site, this is what I see



Again, no rush as I don't see many more '0°' days coming down the pike, but just wanted to see if there's an easy fix.

All the Best beteljuice,

Brad
Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #61 on: December 07, 2019, 10:37:25 AM »
The -100 value is an error 'response' from the script when neither the current value nor the cached value exist.

It is deliberately an absurd value and the other clue is the 'epoch' year of 1970  ;)
Imagine what you will KNOW tomorrow !

Offline K3JAE

  • Contributor
  • ***
  • Posts: 137
  • Davis VP2 Wireless
    • K3JAE's Weather Station
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #62 on: December 07, 2019, 10:45:09 AM »
... and script appears to be working properly.
... So why do you feel the need to cron  #-o

.... I don't use a CRON for this script?  Where'd you get that idea? I use CRON only for the NWS-Alerts script. My reference above to CRON was if I had to pull that script multiple times per day.
« Last Edit: December 07, 2019, 10:48:42 AM by K3JAE »


73's de K3JAE

John
K3JAE Weather Station

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #63 on: December 07, 2019, 10:50:03 AM »
.... If so I will build a CRON event to auto grab these ..... and may run it multiple times per day, ...

... unless I force a CRON event to run say every 4 hours.
Imagine what you will KNOW tomorrow !

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #64 on: December 07, 2019, 05:44:53 PM »
The -100 value is an error 'response' from the script when neither the current value nor the cached value exist.

It is deliberately an absurd value and the other clue is the 'epoch' year of 1970  ;)

Hmmm,

Like I mentioned beteljuice, the day before yesterday and today both had a record low temp of 0°, for both the 5th and the 7th of December.

Not only did it show up in the URL for your script to the Bradford site, but they also show up for two different years from a NWS site at https://www.weather.gov/ctp/climateRecordsBradford if you scroll down to December in the list of records.


I truly believe that the actual record was 0° in both instances, but if there's nothing we can do, so be it.

Brad
Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #65 on: December 07, 2019, 07:15:59 PM »
As you stated earlier ... data was missing ...

You give no link to your site nor page  :sad:

You can always get some info by view source of your page, and in html <!-- comments
there will be 'feed-back' from the prog OR you can noaarec.php?noaabug which will clear the cache file and start from scratch and show the now 'page' that is being scraped.
Imagine what you will KNOW tomorrow !

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #66 on: December 07, 2019, 07:33:52 PM »
As you stated earlier ... data was missing ...

You give no link to your site nor page  :sad:

You can always get some info by view source of your page, and in html <!-- comments
there will be 'feed-back' from the prog OR you can noaarec.php?noaabug which will clear the cache file and start from scratch and show the now 'page' that is being scraped.
Your script shows up on my home page about 1/2way down.

Not to get into an argument here, as it's totally not worth it, but the data was missing in the noaarecdat.txt file, not on the website from your URL in the script. It read 0° on both days. I believe, somehow, that a 0° reading is throwing an error, the -100° value in your script, instead of scraping the 0° as an actual figure.

And looking at the debug, https://mckeanweather.com/mwnoaarec.php?noaabug it's showing a 0° reading, but outputting -100


Like I said, not a big deal, but it's not picking up a Zero as a reading and throwing an error INMO.

Brad
Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #67 on: December 07, 2019, 08:18:38 PM »
Quote
... but it's not picking up a Zero as a reading and throwing an error IMHO
YHO is correct  :shock:

My version 3 validation checks are incomplete  :oops: - regarding zero values as the same as null.

BTW I was looking for a banner / text link for your site, never thought to look at the little icon on the right left  :roll:.

I'll get to work on a new release ......
« Last Edit: December 07, 2019, 09:48:42 PM by the beteljuice »
Imagine what you will KNOW tomorrow !

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #68 on: December 07, 2019, 09:39:39 PM »
Fixed the link on my banner, didn't realize it wasn't working.
I'm sure you'll work out the 0°/null thingy, no shot for a shooter like you.
Thx...

Brad
« Last Edit: December 07, 2019, 09:44:59 PM by MackerelSky »
Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #69 on: December 07, 2019, 11:34:19 PM »
Please try this, if it isn't too late ..
 [ You are not allowed to view attachments ]
Imagine what you will KNOW tomorrow !

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #70 on: December 08, 2019, 03:32:10 AM »
Please try this, if it isn't too late ..
 [ You are not allowed to view attachments ]

Yeah, I missed that chance, but I have it installed and the next day looking ahead that has a 0° for a thisDayMin is on the 16th of this month. Will let you know as soon as I can on that day!

Thx,
Brad
Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #71 on: November 20, 2020, 08:25:50 AM »
Unfortunately this script has bombed on my site overnight:  noaarec.php?noaabug=true

I've disabled this section of my alternate dashboard under 'Temperature', because Beteljuice's code is beyond me. :?
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #72 on: November 20, 2020, 12:10:55 PM »
Seems to be alright now ?
Imagine what you will KNOW tomorrow !

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #73 on: November 20, 2020, 12:34:14 PM »
Indeed it does.  Now to back out of my changes to restore my dashboards 'Temperature' offerings.

Thanks for looking!  Much appreciated.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: 'This day' Max / Min / Avg Temperatures (NOAA) - PHP Script
« Reply #74 on: November 20, 2020, 04:03:43 PM »
*** IMPORTANT ***

I just ran my test bed and thought "That doesn't look right"

at the bottom of the report it says ..
Quote
The U.S. Naval Observatory (USNO) data is currently unavailable. The links provided are from other US Government sources. When USNO data is returned to service, the links will be updated.
Quite what that means, and how much impact it may have, and for how long ?  :roll:
Imagine what you will KNOW tomorrow !

 

anything