Author Topic: PHP to display NEXRAD Radar Status  (Read 3803 times)

0 Members and 1 Guest are viewing this topic.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
PHP to display NEXRAD Radar Status
« on: January 21, 2008, 04:34:17 PM »
Since we've been having issues with my local radar (KMUX), and I got tired of checking the NWS WSR-88D Transmit/Receive Status page for what's going on, I've written a script to fetch and parse the page for status and display the condition/messages associated with any NOAA NEXRAD Station.

Samples of the output:

The above 'Active' message is usually suppressed, but can be enabled by a setting of $noMsgIfActive = false; (the default setting is 'true').





Script and instructions at http://saratoga-weather.org/scripts-NEXRAD.php#NEXRADStatus

You can see your local radar by invoking the script with ?nexrad=[station]&show=active like this:

http://saratoga-weather.org/radar-status.php?nexrad=KSOX&show=active


Best regards,
Ken
« Last Edit: January 21, 2008, 05:45:11 PM by saratogaWX »
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 edpnjax

  • Senior Member
  • **
  • Posts: 94
    • RiverCityWeather.Net
Re: PHP to display NEXRAD Radar Status
« Reply #1 on: January 21, 2008, 05:18:37 PM »
Quote
The above 'Active' message is usually suppressed, but can be enabled by a setting of $noMsgIfActive = true; (which is the default setting).

Shouldn't that be "= false" to enable the message?
Emmett


Weather for Jacksonville / St Johns FL
Davis VP2 Plus w/24hr FARS | Live Weather | Boltek / NexStorm | GRLevel3

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: PHP to display NEXRAD Radar Status
« Reply #2 on: January 21, 2008, 05:46:03 PM »
Emmett, you're right... :oops: .. I've corrected the post above.

Thanks for spotting that!

Best regards,
Ken
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 edpnjax

  • Senior Member
  • **
  • Posts: 94
    • RiverCityWeather.Net
Re: PHP to display NEXRAD Radar Status
« Reply #3 on: January 21, 2008, 05:56:17 PM »
No problem  :lol:

Thanks for another useful script!!!

One question, if you look at KJAX it is good, but there are old messages that show up. Is it possible to have the script if the radar site is up and Active, trim everything after the Active message?
Emmett


Weather for Jacksonville / St Johns FL
Davis VP2 Plus w/24hr FARS | Live Weather | Boltek / NexStorm | GRLevel3

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: PHP to display NEXRAD Radar Status
« Reply #4 on: January 21, 2008, 06:07:24 PM »
Yes, It's possible .. I'm not sure I recommend it.

My radar (KMUX) has been flakey for about 2 days with it dropping off and on.  I find the last status message helpful to show what's going on, and even if it is active for now, the event may continue.

To do what you'd like to do (suppress messages if current status is active), just change
Code: [Select]
  if (isset($radarMsgs[$myRadar])) {
     foreach ($radarMsgs[$myRadar] as $timestamp => $msg) {
to
Code: [Select]
  if ($statColor <> '#33FF33' and isset($radarMsgs[$myRadar])) {
     foreach ($radarMsgs[$myRadar] as $timestamp => $msg) {
and that should do it.

I should point out that the script eliminates duplicate messages for a particular radar (based on identical timestamps), unlike the raw feed page from the NWS :-)
Best regards,
Ken
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 edpnjax

  • Senior Member
  • **
  • Posts: 94
    • RiverCityWeather.Net
Re: PHP to display NEXRAD Radar Status
« Reply #5 on: January 21, 2008, 07:19:38 PM »
I understand, Thanks!
Emmett


Weather for Jacksonville / St Johns FL
Davis VP2 Plus w/24hr FARS | Live Weather | Boltek / NexStorm | GRLevel3

Offline weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: PHP to display NEXRAD Radar Status
« Reply #6 on: January 21, 2008, 07:36:18 PM »
Thanks for another great script, Ken :-)
Ann-Marie
Beamsville, Ontario, Canada

 

anything