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

0 Members and 1 Guest are viewing this topic.

Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 487
    • 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:

Davis Vantage Pro2, Serial Data Logger
WD 10.37S-(b60), VWS V15.00p03, Weatherlink 6.0.3,  Fling 2.35, Broadwave 2.0, Win 7 Pro 64Bit
KMICHEBO10 - CW3699 - Cheboygan, MI

Offline gus

  • Senior Member
  • **
  • Posts: 50
    • 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: 1959
    • 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@inebraska.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1152
  • unnamed weather station, 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
BUY FROM AMAZON  HERE... Thank You! :-)

Online ValentineWeather

  • Forecaster
  • *****
  • Posts: 4861
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: 6666
  • 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, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1959
    • 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@inebraska.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1959
    • 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@inebraska.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1152
  • unnamed weather station, 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
BUY FROM AMAZON  HERE... Thank You! :-)

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1152
  • unnamed weather station, 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
BUY FROM AMAZON  HERE... Thank You! :-)

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1959
    • 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@inebraska.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1152
  • unnamed weather station, 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
BUY FROM AMAZON  HERE... Thank You! :-)

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3312
    • Carson Valley 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 - Minden, Nevada --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KRNO2
Davis Wireless VP2, WD 10.37s72,
StartWatch, VirtualVP, VPLive, , Win10 Pro
--- Logitech HD Pro C920 webcam
--- RIPE Atlas Probe - 32849

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1959
    • 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@inebraska.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1152
  • unnamed weather station, 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
BUY FROM AMAZON  HERE... Thank You! :-)

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1959
    • 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@inebraska.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1959
    • 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@inebraska.com

 

anything