Page 1 of 2

Pressure Trends converted to words in Cumulus

Posted: Sun 16 Jan 2011 9:54 am
by RayProudfoot
Now that I've got the code in my signature banner to describe pressure trends I'm keen to make it match an official Met Office standard.

Here are the rules according to the UK Met Office...

Rising (or falling) slowly
Pressure change of 0.1 to 1.5 hPa in the preceding three hours

Rising (or falling)
Pressure change of 1.6 to 3.5 hPa in the preceding three hours

Rising (or falling) quickly
Pressure change of 3.6 to 6.0 hPa in the preceding three hours

Rising (or falling) v. rapidly
Pressure change of more than 6.0 hPa in the preceding three hours

The highest rise I've seen is a little over 2hPa/hour and this was described by Cumulus as Rising Rapidly but according to the rules above it would have to be rising greater than 6 hPa/hour. They don't have a rule for steady so I guess that would be 0 over the last 3 hours.

Comments welcome.

Re: Pressure Trends converted to words in Cumulus

Posted: Sun 16 Jan 2011 10:09 am
by daj
From what I can see on a previos post, Cumulus uses the same rules

https://cumulus.hosiene.co.uk/viewtopic.p ... 755#p36755

Maybe you could post a snapshot of your monthly log file covering the period you are questioning.

Re: Pressure Trends converted to words in Cumulus

Posted: Sun 16 Jan 2011 10:18 am
by nking
RayProudfoot wrote:Now that I've got the code in my signature banner to describe pressure trends I'm keen to make it match an official Met Office standard.

Pressure change of more than 6.0 hPa in the preceding three hours
The highest rise I've seen is a little over 2hPa/hour and this was described by Cumulus as Rising Rapidly but according to the rules above it would have to be rising greater than 6 hPa/hour. They don't have a rule for steady so I guess that would be 0 over the last 3 hours.

Comments welcome.
Met 3 hours, Cumulus 1 hour (average last 3 hours). They are the same

Re: Pressure Trends converted to words in Cumulus

Posted: Sun 16 Jan 2011 10:24 am
by RayProudfoot
Thanks for that David. That code is different to what betelguise supplied to me last night because of this 3 hour thing. It might be easier if I post what I now have.

$weather_trend = ret_value("presstrend") * 3;
if (($weather_trend >= -0.1) && ($weather_trend <= 0.1)) {
$pressure_trend_text = "Steady";
}
if (($weather_trend > 0.1) && ($weather_trend <= 1.5 )) {
$pressure_trend_text = "Rising Slowly";
}
if (($weather_trend > 1.5) && ($weather_trend <= 3.5 )) {
$pressure_trend_text = "Rising";
}
if (($weather_trend > 3.5) && ($weather_trend <= 6.0 )) {
$pressure_trend_text = "Rising Quickly";
}
if (weather_trend >= 6.0) {
$pressure_trend_text = "Rising Rapidly"; // rising rapidly
}
if (($weather_trend < -0.1) && ($weather_trend >= -1.5)) {
$pressure_trend_text = "Falling Slowly";
}
if (($weather_trend < -1.5) && ($weather_trend >= -3.5)) {
$pressure_trend_text = "Falling";
}
if (($weather_trend < -3.5) && ($weather_trend > -6.0)) {
$pressure_trend_text = "Falling Quickly";
}
if ($weather_trend <= -6.0) {
$pressure_trend_text = "Falling Rapidly"; // falling rapidly
}

That's as close as I can get to the Met Office (and Cumulus) standards although I tweaked the Steady value slightly.

Re: Pressure Trends converted to words in Cumulus

Posted: Sun 16 Jan 2011 10:26 am
by RayProudfoot
nking wrote: Met 3 hours, Cumulus 1 hour (average last 3 hours). They are the same
Thanks Neil. I think the code in the previous message sticks to those rules.

Re: Pressure Trends converted to words in Cumulus

Posted: Sun 16 Jan 2011 10:28 am
by daj
I'm confused. Why the code? Cumulus provides the trend in a web tag so you can use the surely?

Re: Pressure Trends converted to words in Cumulus

Posted: Sun 16 Jan 2011 10:36 am
by RayProudfoot
daj wrote:I'm confused. Why the code? Cumulus provides the trend in a web tag so you can use the surely?
I thought that but it didn't work. Have a read through this thread and you can see why I ended up using code. It starts around the 5th message.

Re: Pressure Trends converted to words in Cumulus

Posted: Sun 16 Jan 2011 10:44 am
by daj
Ah, right. I am late to the party and not basing my reply on any other thread as I did not know (and my crystal ball being at the cleaners lol)

If it were me I would create my own realtime file using web tags and include the pressure trend tag.

Equally, the php solution should get you there -- As with most things in life, there are several ways of achieving the same goal.

Re: Pressure Trends converted to words in Cumulus

Posted: Sun 16 Jan 2011 10:52 am
by RayProudfoot
When one is as experienced as you David there will be alternative solutions but for this beginner I'm just pleased that what I have been given works. :)

When retirement beckons and I have more time I want to get into this a lot more. But for now, making small tweaks helps me understand a little at a time.

Re: Pressure Trends converted to words in Cumulus

Posted: Sun 16 Jan 2011 10:56 am
by daj
Of course I should have realised at the start of the post that we were discussing the realtime file as it was to do with the banner -- and I know the banner user realtime.txt, which doesn't include the trend in words!

I will go to the back of the class. :lol:

Re: Pressure Trends converted to words in Cumulus

Posted: Sun 16 Jan 2011 11:01 am
by nking
RayProudfoot wrote:When one is as experienced as you David there will be alternative solutions but for this beginner I'm just pleased that what I have been given works. :)

When retirement beckons and I have more time I want to get into this a lot more. But for now, making small tweaks helps me understand a little at a time.
Ditto that :)

Do you feel a lesson coming on David - explaining how to create your own realtime file etc. :)

Re: Pressure Trends converted to words in Cumulus

Posted: Sun 16 Jan 2011 11:02 am
by RayProudfoot
:lol: Late night?

I did look through the variables in the Wiki help but it didn't list pressuretrendenglish which I believe is what is used on the main Cumulus page. It was then that the penny dropped that code was probably the only way to achieve what I wanted.

Maybe that's something that could be looked at? Not sure whether it's possible or not.

Re: Pressure Trends converted to words in Cumulus

Posted: Sun 16 Jan 2011 11:53 am
by mcrossley
Wouldn't Steve's code be more efficent - it stops testing values as soon as it finds a match.

Code: Select all

$weather_trend = ret_value("presstrend") * 3;
if ($weather_trend >= 6.0)
  $pressure_trend_text = "Rising Rapidly";
elseif ($weather_trend > 3.5)
  $pressure_trend_text = "Rising Quickly";
elseif ($weather_trend > 1.5)
  $pressure_trend_text = "Rising";
else if ($weather_trend > 0.1)
  $pressure_trend_text = "Rising Slowly";
elseif ($weather_trend > -0.1)
  $pressure_trend_text = "Steady";
elseif ($weather_trend > -1.5)
  $pressure_trend_text = "Falling Slowly";
elseif ($weather_trend > -3.5)
  $pressure_trend_text = "Falling";
elseif ($weather_trend > -6.0)
  $pressure_trend_text = "Falling Quickly";
else
  $pressure_trend_text = "Falling Rapidly";
  

Re: Pressure Trends converted to words in Cumulus

Posted: Sun 16 Jan 2011 12:13 pm
by RayProudfoot
Indeed it would Mark. Thanks! :D

Re: Pressure Trends converted to words in Cumulus

Posted: Sun 16 Jan 2011 12:15 pm
by daj
nking wrote:Do you feel a lesson coming on David - explaining how to create your own realtime file etc. :)
Will do! :D