WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: gwwilk on July 19, 2019, 07:49:46 AM

Title: CPC Outlook and Drought Monitor - Old Style
Post by: gwwilk on July 19, 2019, 07:49:46 AM
I looked for a topic devoted to this script (https://www.gwwilkins.org/wxdrought3.php), but couldn't find one.  So here it is.

This script has been on my scripts page (https://www.gwwilkins.org/gwwScripts.php) since I set it up, but other than an oblique reference in other threads I couldn't find anything.

The script emulates the old CPC home page that was designed for narrower views with single graphical map displays rather than the current side-by-side display (https://www.cpc.ncep.noaa.gov/).  It better fits into the narrow Saratoga template.

The CPC once again changed the url's, this time three month outlook locations for the temperature and precipitation maps.  These links have been updated in the current script.
Title: Re: CPC Outlook and Drought Monitor - Old Style
Post by: 92merc on July 19, 2019, 12:26:18 PM
One thing I've liked to do is add in another slot at the bottom for my state's drought.  But I don't have it quite working fully. 

I had copied the US Drought Information section and modified it for my state.  If you roll over my state, it shows the correct image.  But when you go above to Monthly Outlook, it keeps my ND image and adds in the US version below that.  What did I do wrong?

Thanks for all your work.

https://www.bismarckweather.net/wxdrought3.php
Title: Re: CPC Outlook and Drought Monitor - Old Style
Post by: 92merc on July 19, 2019, 12:31:12 PM
Nevermind.  I just figured it out.  I was missing adding in the document.getElementbyID section at the top.

Thanks for all of your work.
Title: Re: CPC Outlook and Drought Monitor - Old Style
Post by: gwwilk on January 18, 2020, 11:46:10 AM
There was a severe problem in this script with the logic to update the 'One Month Outlook' graphics on the third Thursday of each month.  I think this has been corrected in the new script (http://selincolnwx.info/wxdrought3.php) a zip of which is available for download on my site (https://www.gwwilkins.org/gwwScripts.php).
Title: Re: CPC Outlook and Drought Monitor - Old Style
Post by: 92merc on January 18, 2020, 03:40:24 PM
Would you consider a suggestion?  Make an option to add in a state drought info page.  Maybe even pull from the Settings to enable and point it?

https://www.bismarckweather.net/wxdrought3.php

I tried adding in my state like usual to your updated script.  For some reason, it kills the US Drought Information:Monitor section picture.  So I've left it to the previous version for now.

Thanks for your work.
Title: Re: CPC Outlook and Drought Monitor - Old Style
Post by: gwwilk on January 26, 2020, 09:08:24 AM
Another subtle bug in the script logic appeared this morning.  :-( #-o It was only present on Sundays and only with the UNL drought monitor graphic which was displaying the prior week's map.

This has been corrected in the latest zip of the script which is available on my scripts page (https://www.gwwilkins.org/gwwScripts.php).  I've left some comments in the script if you're interested in what went wrong every Sunday.
Title: Re: CPC Outlook and Drought Monitor - Old Style
Post by: gwwilk on January 27, 2020, 08:10:27 AM
...and my fix bombed this morning by pointing to the week prior's drought map! :oops:

Another revised zip is up on my scripts page (https://www.gwwilkins.org/gwwScripts.php).  I'll see how the new script plays out this week, as it hopefully points to the correct, most recent drought map.  (I may just be getting too old for this because the proper logic has persistently eluded me.  :-(  Hope not!)
Title: Re: CPC Outlook and Drought Monitor - Old Style
Post by: Big Sky Weather on January 27, 2020, 12:39:08 PM
...and my fix bombed this morning by pointing to the week prior's drought map! :oops:

Another revised zip is up on my scripts page (https://www.gwwilkins.org/gwwScripts.php).  I'll see how the new script plays out this week, as it hopefully points to the correct, most recent drought map.  (I may just be getting too old for this because the proper logic has persistently eluded me.  :-(  Hope not!)

Thank you for your hard work and dedication to providing such useful scripts for us that are not versed in web development/scripts/coding.
Title: Re: CPC Outlook and Drought Monitor - Old Style
Post by: gwwilk on January 29, 2020, 07:56:56 AM
Another failed attempt yesterday manifested in today's missing drought map because the script pointed to this Tuesday instead of last Tuesday.  #-o The maps aren't generated until Thursdays, later in the day.  Someday I might get the logic working correctly, maybe...

A corrected zip is once again available on my scripts page (https://www.gwwilkins.org/gwwScripts.php).
Title: Re: CPC Outlook and Drought Monitor - Old Style
Post by: gwwilk on January 30, 2020, 09:26:45 AM
The script once again contained an error in the logic such that it was pointing to last week's drought map when this week's map is now up.  A re-re-re...revised script is up on my scripts page (https://www.gwwilkins.org/gwwScripts.php).

Also, I think I may have a way to avoid all of this wailing and gnashing-of-teeth altogether.  :shock: I will test this revision and put it up after wringing it out for a week or so.  Here's hoping, anyway!
Title: Re: CPC Outlook and Drought Monitor - Old Style
Post by: gwwilk on February 06, 2020, 08:20:59 AM
The script fell over regarding the UNL Drought Monitor graphic again this morning :sad:, but the revised logic (https://www.gwwilkins.org/wxdrought3.php) kept right on ticking :grin:.  Accordingly, the revised logic has become the new standard (https://www.gwwilkins.org/gwwScripts.php) (until it in turn becomes dysfunctional.)
Title: Re: CPC Outlook and Drought Monitor - Old Style
Post by: gwwilk on September 22, 2022, 08:42:00 AM
The CPC has foregone week 1 and moved to week 2 and week 3 for their tropical hazards forecast graphic (https://www.cpc.ncep.noaa.gov/products/precip/CWlink/ghaz/gth_full.png).  Accordingly, a revised script is once again available on my scripts page (https://www.gwwilkins.org/gwwScripts.php) as 'wxcpcdrought.zip'.
Title: Re: CPC Outlook and Drought Monitor - Old Style
Post by: mikeym2m on September 24, 2022, 09:14:18 AM
Thanks Jerry  [tup]

MikeyM
www.mikeymsweather.com
Title: Re: CPC Outlook and Drought Monitor - Old Style
Post by: gwwilk on July 25, 2023, 08:17:54 AM
The CPC has again modified their creation scripts for this page by omitting the final step in the creation of the week 2-3 Global Hazards Outlook that added the blue ocean background.  A modified script is available on my scripts page (https://www.gwwilkins.org/gwwScripts.php) as wxcpcdrought.zip.