Page 1 of 1

Last 3 hours variable [last3h...] request

Posted: Mon Nov 23, 2009 9:51 pm
by cbhiii
Boris,

We would like to see a [last3h...] variable choice for trends so we can get a more accurate trend indication from Meteohub.

The [last60m] is a bit too small of a window and the [last24h] is too large and not accurate if the falling temp is still higher than the 24hr average temp.

I called Davis Instruments today and confirmed that their barometer trend is based on a 3 hour window. I think it would be a benefit to have 3 hour trends for barometer, temp, dew and humidity as well in Meteohub.

Thanks!

Re:Last 3 hours variable [last3h...] request

Posted: Mon Nov 23, 2009 10:07 pm
by d_l
Some other weather forecasting tools, e.g. the Sager Weathercaster, use the last 6 hr trend for wind direction and barometric changes. How about that period instead?

Edit: I guess some of this info, either 3 hr or 6 hr trends, could be extracted from the seqhour6 strings.

Re:Last 3 hours variable [last3h...] request

Posted: Mon Nov 23, 2009 10:51 pm
by cbhiii
For 6 hour readings, this script might be useful. It takes the 6 hour temp reading used for WD and compares it to actual. Not sure how accurate it will be since I've not played with the 6 hour WD readings before. Best of luck.

Updated with simplified code

Code: Select all

<script type="text/javascript">

var now = "[actual_th0_temp_c]";
var act = "[seqhour6_th0_temp_c@1:-]";
}

if (now>act){trend="1"}
else if (now<act){trend="-1"}
else if (now==act){trend="0"}

document.write("<img border=\\"0\\" src =\\"icons/",trend,".gif\\">");

</script>

Re:Last 3 hours variable [last3h...] request

Posted: Wed Nov 25, 2009 4:18 am
by cbhiii
This code for the 6 hour trend has been updated and seems to be working fine on my site: http://weather.huffman.info

Email me if you have questions and I might be able to help.

Re:Last 3 hours variable [last3h...] request

Posted: Fri Nov 27, 2009 8:11 pm
by cbhiii
I can still see problems with using 6 hour blocks of time for the trend. It too provides sometimes incorrect results. I believe a 3 hour window is the best solution for this trend problem.

Re:Last 3 hours variable [last3h...] request

Posted: Sat Nov 28, 2009 2:23 am
by sevenless
Nearly the same code can be used to extract the data from three hours ago using the seqhour1_ variable. It's an identical concept and you can extract data from any previous hour going as far back as 31 hours prior to current time if you wanted, and all without adding yet more redundant variables into the already large all_sensors output.

Just change the line reading 'var act = "[seqhour6_th0_temp_c@1:-]";' to this:

Code: Select all

var act = "[seqhour1_th0_temp_c@4:-]"; 
(note that entry 1 in seqhour1_ entries is the current hour.)

Also you're always going to have the possibility of oddities if the temperature has a sudden spike or drop due to a front passing through, and the historic data trend will take a little while to catch up. It's impossible to avoid without either constant human observation or some complex regression analysis.

Re:Last 3 hours variable [last3h...] request

Posted: Sat Nov 28, 2009 3:21 am
by cbhiii
Actually the data for each of the last 3 hours needs to be evaluated not just a single value from 3 hours ago.

See this thread where I posted a script to do this.