deformed-offering

Weather station scripts - Images and Handlers

They're free, but use at your own risk

The scripts 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 weather station website.
RSS feed for Scripts Updates A RSS Feed is available to help keep you informed on updates to the scripts.

Many of these scripts are now available on GitHub at https://github.com/ktrue

Buy Me A Coffee If you find one or more of the scripts useful to you, please consider making a 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 and saratogaWXPHP Twitter account as they become available.

Note: Twitter widget has been disabled 3-Jul-2023 since it no longer displays the recent update Tweets.

This page was updated Tuesday, 13-Mar-2018 2:05 PM

Image handling scripts


Wind direction Icons

The following wind direction icons are 14x14 transparent GIF files:

S SSW SW WSW W WNW NW NNW N NNE NE ENE E ESE SE SSE

Wind Direction Icons: download [ see version history ]

You can easily use these icons with the wind direction (example for Weather-Display) by using this PHP code:

<?php
$avgspd = "%avgspd%"; // average wind speed (current)
$dirlabel = "%dirlabel%"; // wind direction (NNE etc)
if (strip_units($avgspd) <= 0.1 ) { echo "Calm";
} else { ?><img src="./images/<?php echo $dirlabel; ?>.gif" height="14" width="14" title="Wind from <?php echo $dirlabel; ?>" alt="Wind from <?php echo $dirlabel; ?>" /> <?php echo $dirlabel; ?>@ <?php echo strip_units($avgspd); ?> mph<?php } ?>

<?php
// strip trailing units from a measurement
// i.e. '30.01 in. Hg' becomes '30.01'
function strip_units ($data) {
preg_match('/([\d\.\+\-]+)/',$data,$t);
return $t[1];
} ?>


Resize Nexstorm.jpg and wasp2.png scripts

This script will resize the nexstorm.jpg graphic and cache the result. It is used on my lightning.php page to force the width of the image to be 640px max (so it fits in the layout of the website). The second script does the same for the WASP2 PNG image.

<img src="resize-nexstorm-image.php" alt="NexStorm Display" width="640" height="445" />
NexStorm Display

Resize Nexstorm JPG PHP script: download [ see version history ]

<img src="resize-wasp2-image.php" alt="Wide Area Storm Probe 2" width="640" height="562" />

Wide Area Storm Probe 2

Resize WASP-2 PNG PHP script: download [ see version history ]


Fetch/resize/cache NOAA Image of the Day script

This script will get and cache locally the NOAA Image of the Day, and download, resize and cache the image if it is updated on the NOAA server.
In March, 2018, the NNVL decided to discontinue offering this service, so the get-nnvl-iod.php script is deprecated and will no longer be distributed.

deformed-offering