Count days since the last recorded rainfall

This section covers the Meteobridge PRO, PRO2, NANO SD, Raspberry Pi and VM platforms exclusively

Moderator: Mattk

Rodribrif
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: Sat Jun 18, 2022 8:47 am

Count days since the last recorded rainfall

Post by Rodribrif »

Hello from Spain, firstly i would like to intruduce myself, my name is Rodrigo, im a wildland firefighter, and weather entusiastic. sorry if this question is a repeat, but I have searched on forum and can not see any relevant informatión.

Im using meteobridge pro(red) connected yo David VP pro2 posting on Twitter som relevant weather data for wildfire prevention and firefighting, i would like to show the number of days since the last recorded rainfall but i cant find the way to get this data.
Any help must be must apreciated
Thanks and best regards from spain
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

Re: Count days since the last recorded rainfall

Post by admin »

Please try variable "[rain0total-nonzerotime:--]". It should report timestamp of last time some rain was depicted.

Wiki also explains available variables: https://meteobridge.com/wiki/index.php/Templates
masgio69
Senior Boarder
Senior Boarder
Posts: 67
Joined: Thu Apr 23, 2020 12:38 pm

Re: Count days since the last recorded rainfall

Post by masgio69 »

Hi, the tag works, but the return value is the date of the last rain, not the days that it doesn't rain.
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1387
Joined: Mon Sep 22, 2014 3:24 am

Re: Count days since the last recorded rainfall

Post by Mattk »

Include an expression which determines the number of days between the timestamp of the last rain depicted and current timestamp for today
masgio69
Senior Boarder
Senior Boarder
Posts: 67
Joined: Thu Apr 23, 2020 12:38 pm

Re: Count days since the last recorded rainfall

Post by masgio69 »

How do you do ? I don't know the right tag, thank you so much for your help !!!
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1387
Joined: Mon Sep 22, 2014 3:24 am

Re: Count days since the last recorded rainfall

Post by Mattk »

The following will give you the number of whole and decimal part days from the current time to the time of last rain record. This simply determines the number of seconds between the current epoch (in linux time) to the linux epoch time of last rain record. Divide that by 86400 (# seconds in a day) and you have the number of complete days

{*([epoch]-[rain0total-nonzerotime=epoch])/86400:--*}

By including a 0 (zero) *0} before the end of the expression then the output will be an integer number of whole days rounded

{*([epoch]-[rain0total-nonzerotime=epoch])/86400:--*0}
masgio69
Senior Boarder
Senior Boarder
Posts: 67
Joined: Thu Apr 23, 2020 12:38 pm

Re: Count days since the last recorded rainfall

Post by masgio69 »

Thank you so much!!!!
masgio69
Senior Boarder
Senior Boarder
Posts: 67
Joined: Thu Apr 23, 2020 12:38 pm

Re: Count days since the last recorded rainfall

Post by masgio69 »

Hi mattk, with the same principle is it possible to obtain the temperature difference between now and 1 year ago? Thanks a lot for the answer.
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1387
Joined: Mon Sep 22, 2014 3:24 am

Re: Count days since the last recorded rainfall

Post by Mattk »

No not really, not using epoch time anyway but you could go back in hours and determine the min, max or avg hourly temp value using the @specifier and compare that to the min60, max60 or avg60 being the now /current temp for the past hour. This method gets a little quirky with leap years but for the purpose just assume 1 year ago is 365 days or 8760 hours in the past. Then something like the following would provide the average delta temperature from the hour 365 days ago to the current hour. Replacing avg with min or max would give the result based on minimum or maximum temp within the hour. If you wanted the resultant sign +/- temp difference to mean something then simply swap the template variables over within the expression

{*[th0temp-avg60]-[th0temp-avg@h8760]*}
masgio69
Senior Boarder
Senior Boarder
Posts: 67
Joined: Thu Apr 23, 2020 12:38 pm

Re: Count days since the last recorded rainfall

Post by masgio69 »

Thank you very much, as always it works correctly, one problem, the expression returns to me with 2 decimals, is it possible to do only 1?
A thousand thanks.
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1387
Joined: Mon Sep 22, 2014 3:24 am

Re: Count days since the last recorded rainfall

Post by Mattk »

No problem {*[th0temp-avg60]-[th0temp-avg@h8760]*1}
masgio69
Senior Boarder
Senior Boarder
Posts: 67
Joined: Thu Apr 23, 2020 12:38 pm

Re: Count days since the last recorded rainfall

Post by masgio69 »

Thank thank thank you so much!!!
masgio69
Senior Boarder
Senior Boarder
Posts: 67
Joined: Thu Apr 23, 2020 12:38 pm

Re: Count days since the last recorded rainfall

Post by masgio69 »

Hi, since you are so kind and competent I ask you another thing, I don't know if it is possible to do it, but I try. In practice I would like to find a tag that indicates the difference in rainfall in one period compared to another, for example the difference in mm from January 1st to today compared to the same period last year.
I thank you in advance.
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1387
Joined: Mon Sep 22, 2014 3:24 am

Re: Count days since the last recorded rainfall

Post by Mattk »

No I can't see a means to go back in time and determine rainfall total over a specific interval. Rainfall total for this year Jan 1 to today is no problem but there is no mechanism to simply determine the rain total from Jan 1 to today's date in 2021?
masgio69
Senior Boarder
Senior Boarder
Posts: 67
Joined: Thu Apr 23, 2020 12:38 pm

Re: Count days since the last recorded rainfall

Post by masgio69 »

Dont worry , thank you so much.
Post Reply