Cool. I don't see why the new xtypes facility <https://github.com/weewx/weewx/wiki/WeeWX-V4-user-defined-types> can't be used to calculate your version of growing degree days. It allows you to define new types. Take a look at it and see if it helps.
On Tue, Jun 23, 2020 at 10:40 AM Chuck Rhode <charlescurtisrh...@gmail.com> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Mon, 22 Jun 2020 18:39:28 -0700 > Tom Keffer <tkef...@gmail.com> wrote: > > > First, "growing degree days > > <http://www.weewx.com/docs/customizing.htm#[[DegreeDays]]>" is now a > > first-class type, analogous to heating- and cooling-degree days. > > Thanks for your reply. Yes, but it's more than analogous; it's the > identical code to cooling-degree days. This is the max-min > calculation used in crop science. > > What I refer to as growing-degree-days is a wide family of > insect-development models. These depend on temperature but, like > max-min, are non-linear at the threshold. Whether they become > independent of temperature above the cutoff or actually decline is up > to the modeler's interpretation of the behavior of his favorite insect > (sub)species, and he has various mathematical techniques with which to > work his will. > > I hope to be able to provide *python* functions for > growing-degree-days on daily max/min temps, threshold, and cutoff that > will exhaust the research literature. > > Here is why I regard growing-degree-days models superior to max-min. > For me in Sheboygan: > > The growing degree-days (GDD) calculated by Baskerville and Emin's > single sine horizontal cutoff method outruns the conventional > degree-days (DD) calculated by the max-min method by about a week. > > o http://lacusveris.com/cydia/models.shtml#x83 > > > Second, see issue #341 <https://github.com/weewx/weewx/issues/341>, > > which discusses support for generating JSON series using the Cheetah > > generator. The intention was to use these series to drive things like > > Highchart plots. Nothing much has happened to the issue recently > > (it's nearly 2 years old), but perhaps this is what you had in mind? > > Yes, *json* or *csv*-formatted strings (wrapped to sensible margin > widths, of course) would be nifty. This would make *html*-embedded > *javascript* code very terse. > > I'm under the impression the absence of the patch is not a stopper > because I've been generating *.csv files from *cheetah* all along ... > with *for* loops, of course. > > I'm also under the impression that *cheetah* can generate *python* > code from a template. I'd hope to keep all the specs for an image or > a suite of images together in one *python* module including the data, > cutoff dates, curve names, colors, axis labels, titles, etc, etc, etc. > It's not something you'd do with a compiled language, but interpreted > languages almost beg to be abused in this way. > > I haven't tried any of this, yet. I reserve the right to change my > mind. > > - -- > .. Be Seeing You, > .. Chuck Rhode, Sheboygan, WI, USA > .. Weather: http://LacusVeris.com/WX > .. > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iEYEARECAAYFAl7yPqAACgkQYNv8YqSjllLjDgCdHq+dKB0k8gLDjZU5dMJHaJlF > dKQAni3fbSe33utKBToZ6ojJtFA6xcmd > =iQZf > -----END PGP SIGNATURE----- > > -- > 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 weewx-user+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/weewx-user/20200623124048.5f5ff7e9%40quixote.LacusVeris.com > . > -- 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 weewx-user+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAPq0zEAJBqFqe8%2BRGP3%2BmbRSAKoYmK7dQUkFcMisbVhPkq%2BmFA%40mail.gmail.com.