Author Topic: Unified Script to Display Select NOAA-NWS Forecast Office Text Products  (Read 7273 times)

0 Members and 1 Guest are viewing this topic.

Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 724
    • Lake Huron Weather
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #25 on: March 17, 2016, 12:46:57 PM »
 :lol:

CW3699

Offline gus

  • Senior Member
  • **
  • Posts: 51
    • Halethorpe Weather-Watch
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #26 on: March 17, 2016, 12:55:43 PM »
 :grin:
Jerry had the quick fix is in the instructions

/************************** Version 2c 20160316 **************************/
/* The following code sets defaults for testing only.
    If these defaults adversely affect your production code, comment out
       this section by removing the slash behind this asterisk ->*/
if (!isset($_POST['wfo'])&&!isset($_POST['product'])) {
   $wfo='oax';
   $divWidth = '656';         // They are used for testing only
   $product = "HWO";
  $leftMargin = 50; // Left margin to display text
  $mapPath = './image/';
}
/* End of testing code defaults and section to comment out */
 
Per the instructions...
All is good if the slash behind the asterisk is removed.

Gus
« Last Edit: March 17, 2016, 01:03:49 PM by gus »
Davis VP2+, LabJack w/temp sensors & 1-Wire lightning counter on AMD Athlon IIx2 220, 4GB, Windows7

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #27 on: March 17, 2016, 01:40:27 PM »
 :oops: My code was faulty in a couple of places.  Firstly, I never assured that the default wfo, which I had set as "OAX", was moved to lower case, which it needs to be.  Secondly, my logic was faulty for entering the testing defaults in 'inc-show-wfo-products.php'.  This combination of errors allowed the script to run, but not really as desired.

I think these problems have been fixed in Version 2d.  The 'inc-show-wfo-products.php' $wfo is set to 'lix', New Orleans.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #28 on: March 17, 2016, 02:07:41 PM »
2d working fine with just the one wfo setting.

Tank U!  :roll:
John
W7JKG

Offline ValentineWeather

  • Forecaster
  • *****
  • Posts: 6364
    • Valentine Nebraska's Real-Time Weather
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #29 on: February 27, 2018, 04:55:07 PM »
Just heads up these are no longer working with changes made today. wxnoaadiscuss.php
wxnoaaproducts.php
Randy

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #30 on: February 27, 2018, 05:05:39 PM »
He can update with V1.06 of forecast-discussion.php 'guts' and it should work again.

https://saratoga-weather.org/scripts-NWSmisc.php
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 gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #31 on: February 27, 2018, 06:30:20 PM »
I'm off to a brass group rehearsal, and won't have time to do this right now.  Later...
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #32 on: February 27, 2018, 10:11:11 PM »
Thanks to Ken, this script has been updated.  You can download it here.

EDIT 2018 Feb 28:
CAUTION:  To get updated texts you may need to delete the related WFO-tagged file(s) from your cache directory!

« Last Edit: February 28, 2018, 08:04:19 AM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #33 on: February 27, 2018, 10:35:25 PM »
Thanks, Ken and Jerry. Working nicely at http://tiggrweather.net/wxnoaaproducts.php.

I don't have a WFO directory but all seems well.
John
W7JKG

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #34 on: February 28, 2018, 01:35:07 AM »
My 'WFO' directory is './cache/WFO'.  You should have a similar one.
That's exactly where I looked but tain't there.
John
W7JKG

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #35 on: February 28, 2018, 07:58:25 AM »
My 'WFO' directory is './cache/WFO'.  You should have a similar one.
That's exactly where I looked but tain't there.
Now it makes sense to me! #-o When testing the script's includes file my './cache/WFO' directory is used, but not when the main script is run because that setting is superseded by the Settings cache declaration.  The possibly hundreds of cache files generated by this script will get dumped into your normal cache directory.  Purging that directory of the WFO-tagged .txt files is a little more difficult.

Sorry for the confusion. (Message removed.)
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #36 on: February 28, 2018, 12:31:16 PM »
Now it makes sense to me! #-o When testing the script's includes file my './cache/WFO' directory is used, but not when the main script is run because that setting is superseded by the Settings cache declaration.  The possibly hundreds of cache files generated by this script will get dumped into your normal cache directory.  Purging that directory of the WFO-tagged .txt files is a little more difficult.
I had one -WFO file in /cache/ last night but it's gone today.
Sorry for the confusion. (Message removed.)
Not a problem. Mine seems to be working and that's the bottom line.

Thanks.
John
W7JKG

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3360
    • Emmett Weather
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #37 on: March 02, 2018, 02:37:04 PM »
Great new addition to the menus! Had to add some sub-folders to the cache folder to get it to run without errors. The sub-folders I added were as follows:
  • WFO
  • WFO/Winter Storm Wrn.
  • WFO/Winter Storm Wrn./Wtch.
  • WFO/Non-Precip. Wrn.
  • WFO/Non-Precip. Wrn./Wtch.
  • WFO/Non-Precip. Wrn./Wtch/Adv.
NOTE: Some of these sub-folders have periods (.) and spaces between the words. They must be exactly as shown above.
I found them by selecting each of the products one at a time and watching for errors on the resulting page.
Don - W3DRM - Emmett, Idaho --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KBOI7
Davis Wireless VP2, WD 10.37s150,
StartWatch, VirtualVP, VPLive, Win10 Pro
--- Logitech HD Pro C920 webcam (off-line)
--- RIPE Atlas Probe - 32849

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #38 on: March 17, 2018, 10:27:48 AM »
Tom Abell pointed out that Honolulu, HI was incorrectly identified as 'hnl' rather than 'hfo' in the script.  This has been corrected in the latest zip found on my site.

Thanks, Tom!
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #39 on: March 17, 2018, 11:59:03 AM »
Thanks, Jerry. It's a great combo of features.
John
W7JKG

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
At the urging of Thomas Abell I've modified the script to use a different font in the text display.  The trick was to change the html <pre> tag by inserting a 'pre' style in the main script, 'wxnoaaproducts.php' thus overriding the <pre> tag.

In context, this is the current style with one alternative commented out:
Code: [Select]
<style type="text/css">
div.center {
width:100%;
margin-left: auto;
margin-right: auto;
}
pre { /* Choose a font, or insert your own to display the text products */
/* font: 15px arial, sans-serif; */
font-style: italic; font-size: 15px; font-family: Comic Sans MS, Cursive, Sans-Serif;
}
</style>
</head>
<body>

This is the only modification to the script in addition to the version date, which is available on my scripts page.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
I noticed when loading this script this morning that the area polygons on the US Map stopped aligning, and I wondered why.  It turns out that Chrome stopped recognizing the height and width of the US Map when specified as follows:
Code: [Select]
<img src="<?php echo $mapPath ?>cwa2.png" alt="County Warning Area MAP" usemap="#cwamap" height="410" width="535" />
Instead Chrome now requires a CSS style to specify the map dimensions:
Code: [Select]
<img src="<?php echo $mapPath ?>cwa2.png" alt="County Warning Area MAP" usemap="#cwamap" style="width:535px; height:410px"/>
An updated zip is available.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #42 on: November 27, 2018, 09:37:15 AM »
A user has experienced problems with this script because of a jQuery conflict.  Attached is a version of wxnoaaproducts.php, wxnoaaproducts-jq.php, that should avoid this difficulty.  You can use it whether or not there's a jQuery conflict on the page that contains the script.

Edit 2019 March 9:  This script has been updated to include the missing 'Paducah, KY' entry.
« Last Edit: March 09, 2019, 12:22:58 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #43 on: March 09, 2019, 12:20:34 PM »
I discovered today while working on an addition to this script that Paducah, KY was missing!

This has been corrected in an updated wxnoaaproducts.zip on my scripts page.  The -jq version has also been updated and is included.

There's also an experimental version with a Graphical Enhanced Hazardous Weather Outlook (EHWO) that some WFO's are creating.  This version isn't yet on my menu system because these graphics aren't yet operational, but it can be viewed from here and from my scripts page.  Oddly neither Tom Abell nor myself can figure out how to detect whether or not these graphical images are on any given WFO's site.  Every attempt returns '403 Forbidden'!  Hence the script can't generate a separate message informing the viewer that the graphic is missing.  Only the 'alt="..."' message appears.  The includes file is still littered with these failed attempts all commented out. :-(  This script isn't available any more.

It turns out that I didn't appreciate the full complexity of the EHWO display.  An iframe displays it best so that the interactive graphics can be accessed because these are a key component of this project/product.  Accordingly, I've placed a site-specific iframed version of the EHWO's on my site with the script available on my scripts page.  The script must be set to your appropriate WFO, and I've included a link to the NWS's PDF that lists all participating WFO's.

EDIT: 2019 March 9, 4:45 pm CST
The iframe dimensions in the iframed script don't fit lots of the participating WFO's pages!  Manipulating the CSS and page width can help with this problem, but it's not a trivial exercise.  Perhaps the best solution for now in these cases is a link to the WFO's EHWO page?  Given time to mess around, I might be able to devise a solution, but it would be a tedious and time-consuming job.
« Last Edit: March 09, 2019, 05:43:14 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline rrrick8

  • Senior Contributor
  • ****
  • Posts: 224
    • Vermilion weather
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #44 on: April 06, 2019, 09:25:52 AM »
Jerry, I wouldn't mind tinkering around a bit with the script version that has the drop down wfo select array like you have on your site.
Can you pm that file to me if you don't mind. My particular wfo doesn't use it yet but a couple surrounding ones do so would like to experiment a bit with it.

Thanks,
Rick
 
« Last Edit: April 06, 2019, 09:31:35 AM by rrrick8 »
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #45 on: April 06, 2019, 09:49:45 AM »
Jerry, I wouldn't ming tinkering around a bit with the script version that has the drop down wfo select array like you have on your site.
Can you pm that file to me if you don't mind. My particular wfo doesn't use it yet but a couple surrounding ones do so would like to experiment a bit with it.

Thanks,
Rick
I've uploaded a zip of the selectable wxEHWO-byWFO script to my scripts page so that anyone who's interested might play around with it as well.  This supersedes the prior single WFO version.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline rrrick8

  • Senior Contributor
  • ****
  • Posts: 224
    • Vermilion weather
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #46 on: April 06, 2019, 09:52:12 AM »
Thanks Jerry. I like the concept and hope more offices, including mine (ILX) use it.
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #47 on: January 30, 2021, 08:44:17 AM »
I've added the Regional Min/Max Temperature and Precipitation Table to the script.  This is a very informative table that includes some local snow depths, not just snow depths as measured at the WFO site.

As usual, the updated script is available on my scripts page as 'wxnoaaproducts.zip'.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline mikeym2m

  • Senior Contributor
  • ****
  • Posts: 153
    • MikeyM's Thornhurst PA Weather
Re: Unified Script to Display Select NOAA-NWS Forecast Office Text Products
« Reply #48 on: January 30, 2021, 09:02:51 AM »
Thanks Jerry   [tup]

MikeyM