Page 1 of 1

Trends from Realtime data

Posted: Wed 12 Jan 2011 5:16 pm
by Blackmyre
The realtime file doesn't contain trend text (e.g. 'Rising very rapidly' etc.) for temp/pressure - the equivalents of <#temptrendtext> and <#presstrend>. I guess that would be difficult given that the file is space-delimited. For temperature I guess that can be determined from the trend value - can anyone tell me what the thresholds are for the various categories? With pressure I think it would be harder because I gather it's based on the change in the last three hours. Is there any way to derive it from any of the othr data in realtime.txt?

Re: Trends from Realtime data

Posted: Wed 12 Jan 2011 5:29 pm
by steve
All of the fields in realtime.txt have web tag equivalents, so you could create your own version of realtime.txt and put the trend strings on the end (put them in quotes). Or you could use something like javascript to convert the values.

I don't really understand what you're saying about the pressure trend; yes, it's based on the change over the last three hours, but the pressure trend value is just the three hourly figure divided by three, just the same as the temperature trend.

Here's the code which converts the pressure trend to text:

Code: Select all

  if ThreeHourlyPressureChangeMB > 6 then
    presstrendstr := Risingveryrapidly
  else if ThreeHourlyPressureChangeMB > 3.5 then
    presstrendstr := Risingquickly
  else if ThreeHourlyPressureChangeMB > 1.5 then
    presstrendstr := Rising
  else if ThreeHourlyPressureChangeMB > 0.1 then
    presstrendstr := Risingslowly
  else if ThreeHourlyPressureChangeMB > -0.1 then
    presstrendstr := Steady
  else if ThreeHourlyPressureChangeMB > -1.5 then
    presstrendstr := Fallingslowly
  else if ThreeHourlyPressureChangeMB > -3.5 then
    presstrendstr := Falling
  else if ThreeHourlyPressureChangeMB > -6 then
    presstrendstr := Fallingquickly
  else
    presstrendstr := Fallingveryrapidly;
The temperature trend text is simply 'Steady' for zero change, and 'Rising' for an increase and 'Falling' for a decrease.

Re: Trends from Realtime data

Posted: Wed 12 Jan 2011 6:43 pm
by Blackmyre
steve wrote:All of the fields in realtime.txt have web tag equivalents
So I gathered, but I didn't see how that helped as the converse isn't true.
you could create your own version of realtime.txt
Does Cumulus expose a mechanism for doing that? [Thinks] Ah - I guess with a custom template? It's perhaps moot though because...
I don't really understand what you're saying about the pressure trend; yes, it's based on the change over the last three hours, but the pressure trend value is just the three hourly figure divided by three, just the same as the temperature trend.
My thinking was that the pressure trend value was based on a rolling hour, which would mean I would be missing the information about the previous two. If I can just multiply it by three and apply the logic in your code snippet, that's fine.

As for the temperatures, I thought they were reported as different rates of change like pressures. If not then, again, all the information I need is already in realtime.txt.

Thanks very much for the response.


Steve.