Author Topic: Question about the alerts and forecasts  (Read 264 times)

0 Members and 1 Guest are viewing this topic.

Offline MackerelSky

  • Senior Member
  • **
  • Posts: 95
    • McKean County Weather, Smethport Pa.
Question about the alerts and forecasts
« on: May 29, 2019, 11:03:38 AM »
Hi Ken and All,

I did a search, prolly not long enough, but it's bugged me for a while now.

Living in the mountains of NW Pa., a 'Hazardous Weather Outlook' from our NWS office in State College Pa. always precedes a watch or a warning, and contains some helpful info for upcoming weather.

So where I'm heading is that the advforecast2.php script picks up the outlook, but my top warning for the home page nor the new Curly's forecast do. I was wondering if someone could point me in the right direction that I could do some fiddling and try an get them involved? Zone and County are all pulled from the Settings.php.

My home page then
advforecast2.php page https://www.mckeanweather.com/mwforecast.php
Curly's forecast https://www.mckeanweather.com/mwCforecast.php

I've included a screen grab of all three taken at the same time.

Thanks for having a look
Brad
Mckean County Weather
Located on upper Marvin Creek

Davis VP2 + fars
Cumulus 1.9.4-b1092

https://McKeanWeather.com

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 591
    • LexMAWeather
Re: Question about the alerts and forecasts
« Reply #1 on: May 29, 2019, 11:54:55 AM »
The short answer is that the Hazardous Weather Outlook link appears in the HTML page that is scraped for the old version of the forecast but isn't included in the JSON forecast data. So that's why it doesn't appear.

To duplicate that feature in the new script, the code would have to check to see if there is an active HWO for the office that issues the forecast. That information under the new API is at:

   https://api.weather.gov/products/types/HWO/locations/[office code]

and a second fetch is then necessary to get the actual HWO text. That fetch would only have to be done if the latest HWO listed in the results from the first fetch is current. What "current" means isn't clear to me as there is an "issuance time" for each outlook but no expiration time. Maybe if within 24 hours??

Offline MackerelSky

  • Senior Member
  • **
  • Posts: 95
    • McKean County Weather, Smethport Pa.
Re: Question about the alerts and forecasts
« Reply #2 on: May 29, 2019, 12:16:53 PM »
Thanks for the response Jasiu,

https://api.weather.gov/products/types/HWO/locations/CTP shows the last 7 HWO's, with the current one on the top as seen by the date and time, 2019-05-29T07:36:00+00:00

Current text can be found at https://forecast.weather.gov/product.php?site=NWS&issuedby=CTP&product=HWO
Edit: Actual HWO is at this URL. https://forecast.weather.gov/showsigwx.php?warnzone=PAZ005&warncounty=PAC083&firewxzone=PAZ005&local_place1=Smethport+PA&product1=Hazardous+Weather+Outlook#.XO6y_hZKjb0
Now I just have to put the two together somehow? Not the sharpest nail in the pouch when it comes to the API's, but I'll give it a look and see what I can come up with.

Brad
« Last Edit: May 29, 2019, 12:30:12 PM by MackerelSky »
Mckean County Weather
Located on upper Marvin Creek

Davis VP2 + fars
Cumulus 1.9.4-b1092

https://McKeanWeather.com

Online AWL

  • Forecaster
  • *****
  • Posts: 668
    • Ardmore Weather Live
Re: Question about the alerts and forecasts
« Reply #3 on: May 29, 2019, 01:00:36 PM »
Don't know if this is any help but you can modify Ken's forecast discussion script to grab the HWO. Never tried to combine it with any other script.

Doug

Offline MackerelSky

  • Senior Member
  • **
  • Posts: 95
    • McKean County Weather, Smethport Pa.
Re: Question about the alerts and forecasts
« Reply #4 on: May 29, 2019, 03:01:52 PM »
Don't know if this is any help but you can modify Ken's forecast discussion script to grab the HWO. Never tried to combine it with any other script.

Doug
Thanks Doug,

Stopped working on it to take the better 2/3 to lunch. Squall line came thru with tornado watches/warnings, thankfully no damage, but now all alerts and HWO's are cancelled.
Will have to wait until later tonight or tomorrow when the next round of storms approach.

Thanks Again...
Brad
Mckean County Weather
Located on upper Marvin Creek

Davis VP2 + fars
Cumulus 1.9.4-b1092

https://McKeanWeather.com

 

anything