Upon reflection, the biggest difference seems to be that cooling-degree days are weighted by the temperature difference from the baseline. You just want the total number of hours.
This is best done as an XTypes extension <https://github.com/weewx/weewx/wiki/WeeWX-V4-user-defined-types>. Yes, it's Python, and it's in the bowels of WeeWX, but it's actually a pretty simple calculation. Several other users have successfully written xtypes extensions. On Tue, Jan 18, 2022 at 4:36 PM [email protected] <[email protected]> wrote: > I would be very interested in this calculation as well! Unfortunately I > am of a limited proficiency when it comes to Python. > > As I understand cooling degree days, they reference a temperature mean for > the day. Chill hours would be a different subset, and is specifically the > amount of time below 45 degrees Fahrenheit. Cooling hours are cumulatively > counted between October 1 through February 28 (at least in Texas). A more > specific model only counts time with temperatures greater than 32 and less > than 45 degrees. Newer models (still being reviewed I believe) have begun > subtracting the time below 32 degrees from the cumulative number for a more > exact count. > > Seth, I think you are on the right track. If you could calculate on a > daily basis and include that in the summary database, you would then only > need to add the summaries together for a selected period. This is the same > process used for rain (I think). > > -Jonathan Z > On Tuesday, January 18, 2022 at 6:11:03 PM UTC-6 [email protected] wrote: > >> What's the difference between chill hours and the existing cooling-days, >> except for the value of the base? >> >> On Tue, Jan 18, 2022 at 3:47 PM Seth Ratner <[email protected]> wrote: >> >>> Ok, I'm looking at this from a different angle, and was wondering if >>> someone knew the "right" way to do this before I go inventing a more >>> complicated solution. >>> >>> For Chill Hours, I just need to add up the time that the temp is below >>> XX degrees between two dates. As I understand WeeWX, every database entry >>> has the interval length and the average temp for that interval. So in >>> theory I can query the DB for the number of entries between two timestamps >>> where the temp is below XX, and multiply the number of entries by the >>> interval duration (5 minutes default). >>> >>> However, that would have me doing that query every time I wanted to >>> display the value, which might be unnecessary processing power. It would >>> also limit my display options. For example, if I wanted a chart to show >>> chill hours the same way rain can be shown (with a cumulative line, an >>> absolute line, etc), I'd have to come up with a more complicated query. >>> >>> Which got me thinking, chill hours are somewhat similar to rain, in that >>> they are additive. So do I just create a service that gets triggered on an >>> archive entry, looks at the temp for that archive entry, and if the temp is >>> below the threshold it adds a value to column 'chill_hours' equal to the >>> interval duration is? Then instead of inches, I'm using "minutes" as the >>> unit of measurement. >>> >>> And is there any way to influence the daily summary table that would be >>> created for this new "chill hours" field? Or do they all have to follow the >>> same logic? >>> >>> Am I going about this the entirely wrong way? Ultimately I'd like to >>> create the ability to track the accumulated hours of various custom temp >>> ranges, and use that data for charting similar to other existing fields. >>> >>> Thanks, >>> Seth >>> >>> >>> >>> >>> >>> On Saturday, December 25, 2021 at 11:48:43 AM UTC-6 Seth Ratner wrote: >>> >>>> Hi everyone, >>>> >>>> I was wondering if anyone had already come up with a way to monitor >>>> chill hours (cumulative hours below 45℉) in WeeWx. I'm using Belchertown, >>>> and it would be nice to have a readout with Oct-May chill hours, and maybe >>>> a chart that shows the per-week and cumulative hours together. >>>> >>>> Thanks! >>>> Seth >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "weewx-user" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/weewx-user/dcff6386-f236-43ab-92e2-c2e0c76acd37n%40googlegroups.com >>> <https://groups.google.com/d/msgid/weewx-user/dcff6386-f236-43ab-92e2-c2e0c76acd37n%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- > You received this message because you are subscribed to the Google Groups > "weewx-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/weewx-user/f7932dc4-02de-4d37-bf8a-3d5b000c7a7en%40googlegroups.com > <https://groups.google.com/d/msgid/weewx-user/f7932dc4-02de-4d37-bf8a-3d5b000c7a7en%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAPq0zECGkC%3DuKE1u_LTarXawcHOmRz9Y7%3D-7J-OjkKhtuNdhuQ%40mail.gmail.com.
