Page 1 of 2

Consecutive Hours Below Freezing

Posted: Thu 18 Feb 2021 11:32 pm
by ai5u
Greetings,

With our record breaking temperatures and snowfall occurring over the last 10 days and still counting here in Oklahoma and Texas (Polar Vortex), is it possible to add a new entry into the records section that will track consecutive hours/days below freezing? I was trying to help my local TV weatherman out by providing my data to him, but he had to up-me-one by finding something that wasn't included in the CumulusMX weather console records section.

No big deal if its not possible. Just a thought for grins and giggles.

Thanks

Tim - NG7P

Re: Consecutive Hours Below Freezing

Posted: Fri 19 Feb 2021 5:16 am
by sfws
Tracking cumulative hours below a selected temperature functionality has existed for over a decade already, please read the Cumulus Wiki documentation at https://cumuluswiki.org/a/Heat/cold_deg ... hill_hours section 1.3.

You can see this cumulative number reported on the example this year web template included with MX, as well as in "today.ini" log file.

You used the descriptor "consecutive", that suggests you want a figure that is reset to zero whenever temperature goes above zero, and therefore restarts the count when it next freezes???

The Chill Hours functionality has not changed all the years since it was originally implemented. There was a previous request for extra related functionality to Steve Loft, the creator of the software, but he "lost" his request database (like he lost the earliest support forum posts) before all the requests were addressed, and I can't remember what was proposed. However, please note that developer Mark recently said (in respect of another recent request) he is doing bug fixing rather than implementing new features in his current MX development.

I run a batch job that (effectively) compares the "today.ini" for successive days to extract daily incremental figure, I have a novel web page that shows those (and other derivatives) for each day in last week; and both cumulative and daily incremental figures are stored by a batch script automatically run each day of last decade by Cumulus in my custom database daily summary table schema. An alternative approach MX only approach for storing just daily cumulative figures is described in documentation at https://cumuluswiki.org/a/MX_Administra ... mary_table. Having daily incremental values allows me to see which days it was 24 hours and which days it was 0 hours, and it would be possible to report last time a particular figure was seen.

Re: Consecutive Hours Below Freezing

Posted: Mon 22 Feb 2021 12:34 pm
by mcrossley
If you upload to a MySQL database then that is the sort of thing it is fairly easy to make a query for yourself. ;)

The closest I do is consecutive frost days - longest run of days where the temperature drops below zero at any time.

But it's an interesting idea* - any up votes?

* Does not mean it would get done any time soon!

Re: Consecutive Hours Below Freezing

Posted: Tue 23 Feb 2021 7:50 am
by ConligWX
upvoted - yep I'll second the motion, though hear in NI we rarely see that many consecutive days below 0°C but its another nice stat to have all the same.

Re: Consecutive Hours Below Freezing

Posted: Tue 23 Feb 2021 12:33 pm
by mcrossley
Bonus points for anyone coming up with a MySQL query for this! My first attempts time out before they return :(

Re: Consecutive Hours Below Freezing

Posted: Tue 23 Feb 2021 3:56 pm
by mcrossley
Best I can do so far is...

Code: Select all

SELECT 
  MIN(LogDateTime) AS start,
  MAX(LogDateTime) AS end,
  MIN(state) AS state,
  TIMEDIFF(MAX(LogDateTime), MIN(LogDateTime)) AS hrs
FROM (
  SELECT 
    @r := @r + 
          (@state!=IF(h.Temp<=0,1,0) OR @state IS NULL) 
      AS state_change,
    @state := IF(h.Temp<=0,1,0) AS current,
    h.LogDateTime, IF(h.Temp<=0,1,0) AS state
  FROM (
    -- one-row virtual table
    SELECT @r:=0, @state:=NULL ) AS vars  
    CROSS JOIN Monthly AS h                   
    -- order to track state changes
    ORDER BY LogDateTime, state
  ) q
GROUP BY state_change
HAVING state = 1
ORDER BY hrs DESC;
Which takes 11 seconds(!) on 998,000+ rows.
And the answer appears to be the period 2010-12-16 16:20 to 2010-12-22 13:00 is my longest time at or below freezing, at 140 hours...

My "Top 10"...

Code: Select all

start                end                 hrs
2010-12-16 16:20:00  2010-12-22 13:00:00 140:40:00
2010-12-22 15:30:00  2010-12-26 12:50:00 93:20:00 
2018-02-27 15:55:00  2018-03-02 12:00:00 68:05:00 
2010-12-05 15:30:00  2010-12-07 12:50:00 45:20:00 
2010-11-27 15:10:00  2010-11-29 11:20:00 44:10:00 
2010-12-07 14:30:00  2010-12-09 10:40:00 44:10:00 
2010-11-30 15:40:00  2010-12-02 11:00:00 43:20:00 
2010-12-02 15:20:00  2010-12-03 22:50:00 31:30:00 
2012-02-03 15:50:00  2012-02-04 20:10:00 28:20:00 
2013-01-18 07:40:00  2013-01-19 07:40:00 24:00:00 

Re: Consecutive Hours Below Freezing

Posted: Tue 23 Feb 2021 4:06 pm
by PaulMy
I had to go to my Data Summary http://www.komokaweather.com/cumulusmx/ ... hp?lang=en to see we went above freezing yesterday after 16 days consecutive below freezing. But that wasn't even the longest as 2015 was a c o l d winter with 20 consecutive days below freezing in February and only 2 days in the month above freezing.

I also had to go to my TOP10 http://komokaweather.com/mysql/top10.php (thanks Mark) to see my consecutive days with freezing, and that this winter is the most and still nearly a month to go.

Now if I could figure out how to get the snow days and depth in a nice graph!

Brrrrr
Paul

Re: Consecutive Hours Below Freezing

Posted: Mon 19 Dec 2022 5:55 pm
by Paul C
Hi

Could I bounce this one to the top again please ?

I am looking for any graphs/charts/figures for frost hours

With the current cold period ending it would be good to compare previous cold spells to see how they compare , "Frost Hours" would be a very good parameter to have

Has anyone got anything working on this yet - Many thanks

Re: Consecutive Hours Below Freezing

Posted: Mon 19 Dec 2022 8:25 pm
by Mapantz
There's no charts for it, only webtags.

Code: Select all

<#chillhours> The number of 'chill hours' so far this season (threshold temperature and start date are configurable).

Code: Select all

<#chillhoursToday> The incremental chill hours figure since start of today (Compare with Cumulative seasonal Chill Hours at end of today <#chillhours> found in Current Conditions table) 

Code: Select all

<#Ychillhours>	The Cumulative Chill Hours as recorded at rollover (the end of meteorological yesterday)

Code: Select all

<#chillhoursYest> The incremental Chill Hours yesterday (compare with <#chillhoursToday> described in #Today.ini table)

Re: Consecutive Hours Below Freezing

Posted: Mon 19 Dec 2022 8:37 pm
by Paul C
Cheers Thankyou

What would be the easiest way to create a page to show that ?

I only have basic computer knowledge unfortunately. Does anyone have any examples I could copy

Thanks 👍

Re: Consecutive Hours Below Freezing

Posted: Tue 20 Dec 2022 7:42 am
by HansR
Paul C wrote: Mon 19 Dec 2022 8:37 pm Cheers Thankyou

What would be the easiest way to create a page to show that ?

I only have basic computer knowledge unfortunately. Does anyone have any examples I could copy

Thanks 👍
@Paul C : Since you are also using CUtils, I would like to point to the UserReport feature (with which you can report any webtag/parameter combination you wish). If you use that, you can use any menu item to have the report shown/click. See the wiki User menu System 2 and User Reports. Wiki entry for the Webtags. If any questions, let me know.

Creating the HTML would principally only require some knowledge of the webtags and the <br/> HTML tag. Any addition would be layout and nice to have (but may be very useful). Andy (@AndyKF650) has said he is willing to help users on this type of configuration.

Re: Consecutive Hours Below Freezing

Posted: Tue 20 Dec 2022 9:46 am
by water01
Ran the query Mark and obviously Burnham-on-Sea is hotter than Wilmslow!!

Image

Although the first four results are for the last two weeks or so but we went back above zero more often!!

Re: Consecutive Hours Below Freezing

Posted: Tue 20 Dec 2022 1:22 pm
by Paul C
HansR wrote: Tue 20 Dec 2022 7:42 am
Paul C wrote: Mon 19 Dec 2022 8:37 pm Cheers Thankyou

What would be the easiest way to create a page to show that ?

I only have basic computer knowledge unfortunately. Does anyone have any examples I could copy

Thanks 👍
@Paul C : Since you are also using CUtils, I would like to point to the UserReport feature (with which you can report any webtag/parameter combination you wish). If you use that, you can use any menu item to have the report shown/click. See the wiki User menu System 2 and User Reports. Wiki entry for the Webtags. If any questions, let me know.

Creating the HTML would principally only require some knowledge of the webtags and the <br/> HTML tag. Any addition would be layout and nice to have (but may be very useful). Andy (@AndyKF650) has said he is willing to help users on this type of configuration.
Hi Hans

Many thanks for the reply - sadly I dont understand the wiki entry or how I would get it to show anything.
Are you able to tell me in simple terms what to do.

Thankyou
Paul

Re: Consecutive Hours Below Freezing

Posted: Tue 20 Dec 2022 2:16 pm
by HansR
Hi Paul,

If you look at my site , menu=>Reports=>Test you get a report in the ReportView on the right.

The upper four lines are created by exactly those which Mapantz showed in his post above.

The file is called CURPTTest.txt and it is attached, store it in the utils directory. I put a bit more in from another test than necessary just to show some possibilities. You can put any webtag with any valid parameter(s) you want, and with any free text you want, to create your own personal reports.

You will have to use HTML to format it further to your requirements. I can't help you there but some elementary self study in HTML should help you.

You can easily experiment by just editing CURPTTest.txt and then run

Code: Select all

utils/bin/cumulusutils.exe UserReports
If it then is not what you want, just modify CURPTTest.txt and run again. This way you can iterate to what you want.

To get this report item in the menu, You need to use the User menu System 2. The file CutilsMenu.def then becomes something like:"

Code: Select all

Home
Reports
  Item Test Report Test.txt EndItem

Graphs
Records
Extra
Misc
ToggleDashboard
About
Run

Code: Select all

utils/bin/cumulueutils.exe website
to make this effective.

The technique CMX / Cutils offers to make UserReports is the combination of Elementary HTML and CMX webtags.
If you do it step by step, no doubt you will arrive at your goal.

Hope the above helps.

Regards,

Re: Consecutive Hours Below Freezing

Posted: Tue 20 Dec 2022 2:23 pm
by mcrossley
water01 wrote: Tue 20 Dec 2022 9:46 am Ran the query Mark and obviously Burnham-on-Sea is hotter than Wilmslow!!
Lucky you!

How long did the query take to run?