I saw the thread back in August when freddie asked about webtag output parameters for rounding (viewtopic.php?f=36&t=18402&p=145783&hil ... es#p145783) and note this is not an easy thing to do due to the number of tags. I would though like to try making an argument for one in particular, and that is pressure.
Although my argument applies more widely, I believe pressure is an extreme case. We currently display pressure in both tables and graphs ("trends") to 2 decimal places. I am sure there is some historic reason for this, but my Davis pressure sensor is quoted with an accuracy of +/-1mb, and I am sure this is fairly common. If we regularly calibrate, then maybe we could achieve a bit better than this, but certainly no better than 0.1mb.
I am worried that any users/recipients/subscribers of this data will come to the conclusion from the incredible precision with which we are quoting pressure values that our pressure accuracy is considerably higher than Davis state. We could (and I do) point out the actual accuracy but then it rather calls into question why we are quoting to 2 decimal places.
If there is a sub-waiting-list for specific output parameters I would like to request that pressure goes on it. Alternatively is there anyone out there that could write a script to take the webtag string, convert to decimal, round it, and convert back to a string? I'm not sure what that would do for the graphs though. Ideally the values should be global.
End of argument!
PS have upgraded to release 3.9.1 and it seems all good so far.
Welcome to the Cumulus Support forum.
Latest Cumulus MX V4 release 4.0.1 (build 4023) - 16 May 2024
(Note that 4.1.0 (build 4024) - 05 June 2024 remains available, but usage of this version is not recommended - particularly for Davis stations - and the included utility in this distribution for migrating to v4 is known to contain errors affecting conversion of dayfile.txt)
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 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
Latest Cumulus MX V4 release 4.0.1 (build 4023) - 16 May 2024
(Note that 4.1.0 (build 4024) - 05 June 2024 remains available, but usage of this version is not recommended - particularly for Davis stations - and the included utility in this distribution for migrating to v4 is known to contain errors affecting conversion of dayfile.txt)
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 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
Rounding of pressure values
-
- Posts: 1834
- Joined: Sat 17 Dec 2011 11:55 am
- Weather Station: Davis Vantage Pro2
- Operating System: Windows 11 x64
- Location: Dorset - UK
- Contact:
Re: Rounding of pressure values
As a workaround, you could round the pressure value with js or php?
Edit: Just read about needing a script.
I'm pretty sure it's just a simple calc client side?!
For example; I convert all of the webtags I use to php tags and then upload the file.
This would be in a file called php_tagsT.php, CMX does the processing, and uploads it as php_tags.php:
Then, on you webpage:
Ah - Or Marks suggestion below
Edit: Just read about needing a script.
I'm pretty sure it's just a simple calc client side?!
For example; I convert all of the webtags I use to php tags and then upload the file.
This would be in a file called php_tagsT.php, CMX does the processing, and uploads it as php_tags.php:
Code: Select all
<?php $press="<#press>";?>
Code: Select all
<?php echo floor($press);?>
Last edited by Mapantz on Mon 16 Nov 2020 12:08 am, edited 2 times in total.
- mcrossley
- Posts: 12966
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Rounding of pressure values
Pressure is displayed by default** to 1 dp for mb and Hpa, and 2 dp for kPa and inHg.
** For Davis VP and VP2 stations it is 2dp and 3dp respectively for some historic reason. But by adding a manual setting to Cumulus.ini [Station] section of
DavisIncrementPressureDP=0
Then Davis stations will also use 1dp and 2dp. Not what you are asking for, but half way there!
I do not understand why this is not the default, then all stations would be consistent - apart from the OS stations that only report whole hPa iirc.
To be honest I had forgotten Davis stations used the extra decimal as I switched it off years ago!
The Ini file already has settings for Wind Gust, Wind, Sunshine Hours decimals. So it would make sense to add pressure and temperature as well at some point.
Personally I find the whole unit hPa graphs too "blocky" for my taste, I prefer the smoother curve I get with 1 dp.
** For Davis VP and VP2 stations it is 2dp and 3dp respectively for some historic reason. But by adding a manual setting to Cumulus.ini [Station] section of
DavisIncrementPressureDP=0
Then Davis stations will also use 1dp and 2dp. Not what you are asking for, but half way there!
I do not understand why this is not the default, then all stations would be consistent - apart from the OS stations that only report whole hPa iirc.
To be honest I had forgotten Davis stations used the extra decimal as I switched it off years ago!
The Ini file already has settings for Wind Gust, Wind, Sunshine Hours decimals. So it would make sense to add pressure and temperature as well at some point.
Personally I find the whole unit hPa graphs too "blocky" for my taste, I prefer the smoother curve I get with 1 dp.
- mcrossley
- Posts: 12966
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Rounding of pressure values
To do the conversion in JS is easy as JS can treat strings as numbers and vice versa...
Code: Select all
var p = (1*<#press>).toFixed(0);
-
- Posts: 34
- Joined: Mon 03 Aug 2020 9:48 pm
- Weather Station: Davis Vantage Pro2 Plus
- Operating System: 64 bit Raspberry pi Debian
Re: Rounding of pressure values
Hi guys
Thanks for the suggestions. Server-side processing is next on my list but I will need to learn php first. I could possibly get your offering to work with a bit of playing around Mapantz, or your js suggestion Mark, but for now I like the Davis setting option.
I do actually have a VP2 Pro but was getting everything to 2dp. It's odd because the Davis console displays to 1dp. However your Cumulus ini fix works a treat. Now all my pressure tags and past 7 days graph are to 1dp. I cannot see any downside to this method (unless you can)? That will do nicely thanks!
Cheers
Thanks for the suggestions. Server-side processing is next on my list but I will need to learn php first. I could possibly get your offering to work with a bit of playing around Mapantz, or your js suggestion Mark, but for now I like the Davis setting option.
I do actually have a VP2 Pro but was getting everything to 2dp. It's odd because the Davis console displays to 1dp. However your Cumulus ini fix works a treat. Now all my pressure tags and past 7 days graph are to 1dp. I cannot see any downside to this method (unless you can)? That will do nicely thanks!
Cheers
Colin
ashingtonmet.co.uk
ashingtonmet.co.uk
-
- Posts: 34
- Joined: Mon 03 Aug 2020 9:48 pm
- Weather Station: Davis Vantage Pro2 Plus
- Operating System: 64 bit Raspberry pi Debian
Re: Rounding of pressure values
Just to be clear Mark, I assume the above will round values to 1dp and not truncate?mcrossley wrote: ↑Mon 16 Nov 2020 12:07 am ** For Davis VP and VP2 stations it is 2dp and 3dp respectively for some historic reason. But by adding a manual setting to Cumulus.ini [Station] section of
DavisIncrementPressureDP=0
Then Davis stations will also use 1dp and 2dp. Not what you are asking for, but half way there!
I do not understand why this is not the default, then all stations would be consistent - apart from the OS stations that only report whole hPa iirc.
To be honest I had forgotten Davis stations used the extra decimal as I switched it off years ago!
The Ini file already has settings for Wind Gust, Wind, Sunshine Hours decimals. So it would make sense to add pressure and temperature as well at some point.
Personally I find the whole unit hPa graphs too "blocky" for my taste, I prefer the smoother curve I get with 1 dp.
I agree with your other points too.
Thanks
Colin
ashingtonmet.co.uk
ashingtonmet.co.uk
- mcrossley
- Posts: 12966
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Rounding of pressure values
Yes, it rounds values.
A few web tags have a truncate option (primarily indices), but everything else is rounded.
A few web tags have a truncate option (primarily indices), but everything else is rounded.
- mcrossley
- Posts: 12966
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Rounding of pressure values
No downside that I can see, like I say that is what I have always run. Personally I think that should be the default setting, and the ini file setting only used if you want the extra decimals for some reason.
The Davis serial protocol uses thousandths of inches for pressure.