Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Changing Baro Trends from 3 hour to 1 hour easily!

Discussion of Ken True's web site templates

Moderator: saratogaWX

User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Changing Baro Trends from 3 hour to 1 hour easily!

Post by William Grimsley »

Hi guys,

I've just been looking at my ajaxCUwx.js file and in fairness it uses 3 hour baro trends. But, it doesn't correctly give the right trend that Cumulus and Davis consoles give!

So, I've come up with a solution on how to make your baro trends more realistic; from 3 hour to 1 hour. :D

In my ajaxCUwx.js file I changed:

Code: Select all

   if ((btrnd >= -0.7) && (btrnd <= 0.7)) { return(langBaroTrend[0]); }
   if ((btrnd > 0.7) && (btrnd <2.0)) { return(langBaroTrend[1]); }
   if (btrnd >= 2.0) { return(langBaroTrend[2]); }
   if ((btrnd <-0.7) && (btrnd > -2.0)) { return(langBaroTrend[3]); }
   if (btrnd <= -2.0) { return(langBaroTrend[4]); }
  return(btrnd);
}
To

Code: Select all

   if ((btrnd >= -0.23) && (btrnd <= 0.23)) { return(langBaroTrend[0]); }
   if ((btrnd > 0.23) && (btrnd <0.6)) { return(langBaroTrend[1]); }
   if (btrnd >= 0.6) { return(langBaroTrend[2]); }
   if ((btrnd <-0.23) && (btrnd > -0.6)) { return(langBaroTrend[3]); }
   if (btrnd <= -0.6) { return(langBaroTrend[4]); }
  return(btrnd);
}
This change changed the baro trends from 3 hour to 1 hour and will also correspond correctly with Cumulus and your Davis console.

I hope many find this useful...

William
Last edited by William Grimsley on Sat 26 Jan 2013 7:40 am, edited 2 times in total.
User avatar
saratogaWX
Posts: 1185
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Changing Baro Trends from 3 hour to 1 hour easily!

Post by saratogaWX »

I hope you understand that the official definition of Barometer Trend uses a 3-hour time scale.

What you did was change the thresholds to accomplish what you'd desired, and the thresholds in the script were already at the levels corresponding with the official definitions.

I do not recommend that others apply your 'fix'.
User avatar
steve
Cumulus Author
Posts: 26701
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Changing Baro Trends from 3 hour to 1 hour easily!

Post by steve »

Cumulus supplies a three-hour trend value. It just divides it by three to give a rate, with units that can be easily understood (i.e. units per hour). So if the script expects a figure which is the change over a three hour period, then a more logical modification would be to multiply the Cumulus value by three and use that with the existing thresholds.
Steve
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Changing Baro Trends from 3 hour to 1 hour easily!

Post by William Grimsley »

saratogaWX wrote:I hope you understand that the official definition of Barometer Trend uses a 3-hour time scale.

What you did was change the thresholds to accomplish what you'd desired, and the thresholds in the script were already at the levels corresponding with the official definitions.

I do not recommend that others apply your 'fix'.
Ah, oops. :oops:
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Changing Baro Trends from 3 hour to 1 hour easily!

Post by William Grimsley »

steve wrote:Cumulus supplies a three-hour trend value. It just divides it by three to give a rate, with units that can be easily understood (i.e. units per hour). So if the script expects a figure which is the change over a three hour period, then a more logical modification would be to multiply the Cumulus value by three and use that with the existing thresholds.
Yes, I knew that, but from some reason the AJAX/PHP script doesn't use the same Baro Trend as what Cumulus gives as it uses the three-hour trend and not the 1-hour trend that Cumulus calculates... :lol:
water01
Posts: 3246
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Changing Baro Trends from 3 hour to 1 hour easily!

Post by water01 »

but from some reason
They just gave you the reason in the posts above !!! :roll: :roll:
David
Image
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Changing Baro Trends from 3 hour to 1 hour easily!

Post by William Grimsley »

water01 wrote:
but from some reason
They just gave you the reason in the posts above !!! :roll: :roll:
Did they? :lol:
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Changing Baro Trends from 3 hour to 1 hour easily!

Post by William Grimsley »

saratogaWX wrote:I hope you understand that the official definition of Barometer Trend uses a 3-hour time scale.

What you did was change the thresholds to accomplish what you'd desired, and the thresholds in the script were already at the levels corresponding with the official definitions.

I do not recommend that others apply your 'fix'.
I've had a think, should I go back to 3-hour baro trends?
User avatar
steve
Cumulus Author
Posts: 26701
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Changing Baro Trends from 3 hour to 1 hour easily!

Post by steve »

William Grimsley wrote:
steve wrote:Cumulus supplies a three-hour trend value.
the 1-hour trend that Cumulus calculates...
As I said - in the post that you actually quoted! - Cumulus calculates the trend over a THREE HOUR PERIOD. It supplies the THREE HOUR PERIOD figure as a RATE, e.g. mb/hr. But it's still calculated over a THREE HOUR PERIOD. If you want the absolute difference over the THREE HOUR PERIOD, just multiply the rate by three (as I've already said).

To determine the 'falling rapidly' etc descriptions, it uses the UK Met Office standard, e.g. as used in coastal station reports: http://www.metoffice.gov.uk/weather/mar ... ssary.html
Steve
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Changing Baro Trends from 3 hour to 1 hour easily!

Post by William Grimsley »

steve wrote:
William Grimsley wrote:
steve wrote:Cumulus supplies a three-hour trend value.
the 1-hour trend that Cumulus calculates...
As I said - in the post that you actually quoted! - Cumulus calculates the trend over a THREE HOUR PERIOD. It supplies the THREE HOUR PERIOD figure as a RATE, e.g. mb/hr. But it's still calculated over a THREE HOUR PERIOD. If you want the absolute difference over the THREE HOUR PERIOD, just multiply the rate by three (as I've already said).

To determine the 'falling rapidly' etc descriptions, it uses the UK Met Office standard, e.g. as used in coastal station reports: http://www.metoffice.gov.uk/weather/mar ... ssary.html
Sorry, but I'm not trying to be a PITA! Using capital letters makes me think that you're going at me! Ok, I understand what you are trying to get across. :D
User avatar
steve
Cumulus Author
Posts: 26701
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Changing Baro Trends from 3 hour to 1 hour easily!

Post by steve »

I should just add that what you're trying to do seems perfectly reasonable to me. If 'btrnd' in that code you quoted is supposed to be the absolute change over the last three hours, then using the rate of change over the last three hours, as supplied by Cumulus, won't get you the intended result. The other reason why the script may not give the same result as Cumulus would be if the script is not using the same UK Met Office 'bands' that Cumulus uses. And it appears that it doesn't.

If you want the script to give the same descriptions as Cumulus, then it seems to me that the obvious solution is to use the <#presstrend> web tag. But I don't know anything about how any of this works, so I'm probably only confusing matters and I should mind my own business ;)
Steve
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Changing Baro Trends from 3 hour to 1 hour easily!

Post by William Grimsley »

Hi Steve,

Yes, using the <#presstrend> tag would be an idea actually. It's very easy to code so I could give it a go. ;)

EDIT: It looks like the AJAX/PHP template already uses the <#presstrend> tag for the Baro Trend anyway...

William
User avatar
saratogaWX
Posts: 1185
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Changing Baro Trends from 3 hour to 1 hour easily!

Post by saratogaWX »

steve wrote:I should just add that what you're trying to do seems perfectly reasonable to me. If 'btrnd' in that code you quoted is supposed to be the absolute change over the last three hours, then using the rate of change over the last three hours, as supplied by Cumulus, won't get you the intended result. The other reason why the script may not give the same result as Cumulus would be if the script is not using the same UK Met Office 'bands' that Cumulus uses. And it appears that it doesn't.

If you want the script to give the same descriptions as Cumulus, then it seems to me that the obvious solution is to use the <#presstrend> web tag. But I don't know anything about how any of this works, so I'm probably only confusing matters and I should mind my own business ;)
Hi Steve,
Yes, the script doesn't use the exact Met Office 'bands' -- it uses the bands that Davis set for the text descriptions of 3-hr barometer trends (which I included in the code)

Code: Select all

// Change Rates
// Rapidly: =.06" inHg; 1.5 mm Hg; 2 hPa; 2 mb
// Slowly: =.02" inHg; 0.5 mm Hg; 0.7 hPa; 0.7 mb

// 5 Arrow Positions:
// Rising Rapidly
// Rising Slowly
// Steady
// Falling Slowly
// Falling Rapidly

// Page 52 of the PDF Manual
// http://www.davisnet.com/product_documents/weather/manuals/07395.234-VP2_Manual.pdf
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Changing Baro Trends from 3 hour to 1 hour easily!

Post by gemini06720 »

saratogaWX wrote:...the script doesn't use the exact Met Office 'bands' -- it uses the bands that Davis set for the text descriptions of 3-hr barometer trends (which I included in the code)
Ken, this is and has been perfectly acceptable (no sarcasm meant) as your scripts were originally written with the Davis Instruments weather station and the north american weather sites in mind (thank you for eventually including Canada to your scripts).

Why does it seem to be expected that you have to modify your scripts to comply with some government organizations that want to be different... :?
User avatar
steve
Cumulus Author
Posts: 26701
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Changing Baro Trends from 3 hour to 1 hour easily!

Post by steve »

gemini06720 wrote:Why does it seem to be expected that you have to modify your scripts to comply with some government organizations that want to be different... :?
Who is expecting Ken to change anything? But in any case, I rather think that the UK Met Office has been around for somewhat longer than Davis have, so it seems rather odd to suggest that they wanted to be different from Davis.
Steve
Post Reply