Weather station scripts - NOAA Climate Report display

They're free, but use at your own risk

The scripts in PHP and Perl referenced here are used in the operation of this weather station, and may be freely copied and used to support your station. Please note that you use these scripts at your own risk. No warranty is expressed or implied. I accept no liability for any damages that may ensue from their use.
You will need to configure them for your own particular station website.
RSS feed for Scripts Updates A RSS Feed is available to help keep you informed on updates to the scripts.

If you find one or more of the scripts useful to you, please consider making a small donation to help offset the routine expenses of operation of this website.
Thanks for your kind support!

A Version History is available -- check back from time to time to see if there are updates to scripts you have downloaded earlier. Announcements of version updates and new scripts are made on WXForum.net and Weather-Watch forums as they become available.

Latest postings about Saratoga-weather.org Weather PHP scripts on Twitter

follow Saratoga-Weather.org PHP script updates on Twitter

This page was updated Wednesday, 02-Sep-2009 9:29 AM

PHP Scripts (run on webserver)

These scripts have run on PHP 4.1.2, and PHP 4.4.1. I don't have access to PHP 3.x, so it is not known if they will work on versions below PHP 4.1.2. If you try them and they work (or not) on earlier versions of PHP, please send me a message at webmaster[at]saratoga-weather.org and let me know the results.

Display .TXT NOAA style forecasts PHP

I needed to safely display a series of .TXT files (NOAA style climate reports) using the overall style of the website. My WeatherLink software produces regular reports (NOAAMO.TXT, NOAAPRMO.TXT, NOAAYR.TXT, NOAAPRYR.TXT) as part of the 5-minute update. I've also produced reports and named them NOAAyyyy.TXT for yearly reports and NOAAyyyy-mm.TXT for monthly reports. These I've uploaded (monthly) to a sub-directory on the website /NOAA-reports.

Version 1.04 (01-Dec-2007) adds a new feature for WeatherLink users to create new NOAAyyyy-mm.TXT and NOAAyyyy.TXT files from the respective NOAAPRMO.TXT and NOAAPRYR.TXT files when the month/year rolls over. It will copy the appropriate file to the $NOAAdir and name it so you have no monthly maintenance to do (except to view the NOAA reports page on the first of each month).

The NOAA-reports.php will read the sub-directory, sort the filenames produce a menu of available names, and display the file requested. It automatically uses NOAAMO.TXT and NOAAYR.TXT (WeatherLink version) for the current monthly and current yearly files. The nice thing about the script is it strictly controls what can be displayed (existing files only, no directory browsing). The following is a live display of WeatherLink produced NOAA style reports for this station.

<?php $doInclude = true; require("NOAA-reports-test.php"); ?>
2010: Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec 
2009: Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec 
2008: Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec 
2007: Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec 
2006: Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec 
2005: Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec 
2004: Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec 

Report for 2010 02
MONTHLY CLIMATOLOGICAL SUMMARY for FEB. 2010 NAME: KCASARAT1 CITY: Saratoga STATE: CA ELEV: 375 ft LAT: 37° 16' 28" N LONG: 122° 01' 23" W TEMPERATURE (°F), RAIN (in), WIND SPEED (mph) HEAT COOL AVG MEAN DEG DEG WIND DOM DAY TEMP HIGH TIME LOW TIME DAYS DAYS RAIN SPEED HIGH TIME DIR ------------------------------------------------------------------------------------ 1 50.1 62.3 1:15p 39.9 7:15a 14.9 0.0 0.00 0.3 12.0 1:15p NE 2 49.6 59.2 2:05p 42.6 6:50a 15.4 0.0 0.04 0.1 6.0 1:20p N 3 51.4 63.7 1:45p 41.6 7:20a 13.6 0.0 0.01 0.4 12.0 3:55p NW 4 52.3 61.3 12:45p 46.4 12:05a 12.7 0.0 1.42 2.8 26.0 7:35p ESE 5 54.3 63.9 2:10p 46.7 7:20a 10.7 0.0 0.04 2.1 20.0 4:35p S 6 50.8 57.0 2:25p 44.6 11:20p 14.2 0.0 0.82 1.2 14.0 3:05a NW 7 50.4 58.6 2:15p 42.6 10:40p 14.6 0.0 0.00 1.3 14.0 2:15p NW 8 50.0 55.4 2:05p 42.9 12:05a 15.0 0.0 0.04 0.6 16.0 11:30p WNW 9 47.9 48.3 12:05a 47.7 12:35a 1.6 0.0 0.00 3.5 13.0 12:10a E 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 ------------------------------------------------------------------------------------- 50.8 63.9 5 39.9 1 112.7 0.0 2.37 1.4 26.0 4 NW Max >= 90.0: 0 Max <= 32.0: 0 Min <= 32.0: 0 Min <= 0.0: 0 Max Rain: 1.42 ON 02/04/10 Days of Rain: 5 (>.01 in) 2 (>.1 in) 1 (>1 in) Heat Base: 65.0 Cool Base: 65.0 Method: Integration

Downloads .. please customize for your directory and file naming convention ( WL or VWS).
Download WeatherLink/ VWS version (V1.06 - 03-Oct-2008) [ see version history ]