Page 1 of 1

Custome Website Wind tags

Posted: Mon 19 Jan 2009 2:57 pm
by Stephen-wx
Firstly a big hi to Steve and everyone else on here, I stumbled on Cumulus through google searching for an alternative to that rubbish Heavy Weather software shipped with the La Crosse WS-2307, I installed Cumulus and within a couple of hours had it communicating with a developing weather station database called weathercast which in turn communicates with our #weather IRC bot (I'm part of a national organisation of Aussie stormchasers so we are majorly into running our own stations and weather info for everyone to make use of).

Anyhow I also have my own local weather site to run things on, I choose to not run the realtime as the people who look at my site don't need the data quite that fast so 10 minute updates are more than fine and I have my data saved and displayed here at home in real time for my own purposes anyways.

Now every single data feed works fine but is there a tag or script to have it process and generate a wind direction in compass heading words e.g ENE or NE etc that can be used for this site or does anyone know of a script I can load to convert the bearing values to words?

Personally I can translate direction bearings no worries because I'm a stormchaser and used to working with numbers but a lot of my site recipients are just general public so am just finding out if I can make something that is friendlier for them to read.

Well hope everyone has a great day/evening
Stephen :mrgreen:

Re: Custome Website Wind tags

Posted: Mon 19 Jan 2009 3:06 pm
by steve
The <#wdir> tag produces the averaged wind bearing as a compass point, as on the default index page.

Steve

Re: Custome Website Wind tags

Posted: Mon 19 Jan 2009 3:15 pm
by Stephen-wx
Thanks for that Steve top support on here, that tag wasn't in the custom tags list thats all

Stephen :D

Re: Custome Website Wind tags

Posted: Mon 19 Jan 2009 3:19 pm
by beteljuice
Try the following JavaScript to convert bearings:

Code: Select all


function windDir ($winddir) // used for direction graphics
// Take wind direction value, return the
// text label based upon 16 point compass -- function by beeker425
//  see http://www.weather-watch.com/smf/index.php/topic,20097.0.html
{
   $windlabel = new Array("N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW");
   return $windlabel[Math.floor(((parseInt($winddir) + 11) / 22.5) % 16 )];
}	// END function windDir
Then your html you would have something like:

Code: Select all

Wind from <script> windir(<#avgbearing>);</script>

Re: Custome Website Wind tags

Posted: Mon 19 Jan 2009 3:39 pm
by steve
Stephen-wx wrote: that tag wasn't in the custom tags list thats all
Oops - slapped wrist. I'll fix that... :)

Steve

Re: Custome Website Wind tags

Posted: Mon 19 Jan 2009 3:57 pm
by Stephen-wx
ahh thanks for the conversion script too...

ahh well I figure you made such an awesome proggie that tiny things missing are easy to come across its rock solid, I've been involved with testing a program called Australian Weather Monitor that even though its my friend who makes it the old version had some shocking issues including no stabliity after being run for a couple of days.

theres the prelim site which is a hybrid of the old obs layout as I'm currently working on a new one to accomodate the many more parameters I now have on the new AWS.

http://stephen.bsch.au.com/ofaws

Stephen :D