At this point I'm starting to feel like this would be a neat little project for me to get familiar with a number of things (weewx, python, sqlite, etc.), so I'm feeling a bit ambitious and think I'll give this a try myself.
I definitely think storing the info in a database is the way to go. mwall mentioned creating a separate database and then running a service twice a day. I like this approach because it will allow me to mess around as a noob without potentially screwing up the real database. I also like the sunrise/sunset as the day/night boundary idea. With that said, what do you guys think makes the most sense from the standpoint of database construction and then calling upon it usefully later? This is what I was thinking (and please let me know if this is silly, especially if my primary key makes no sense). The DB will have one table with the primary key, day, and night values. I can use something like YYYY-MM-DD as the primary key. Night would be the average temperature between sunset the previous day and sunrise of the present day. Day would be populated at sunset with the average temperature between sunrise and sunset. Alternatively, the primary key could be the unix epoch for 00:00 GMT of that day to keep conversions more fluid (since the service would only populate it at sunrise and sunset and the value is not really time-dependent but rather date-dependent). Or it could just be the unix epoch for the time that the service runs. Whatever makes it easier for later recall. On Monday, January 16, 2017 at 4:33:26 PM UTC-5, gjr80 wrote: > > weewx-WD provides warmest night/coldest day stats by maintaining two > fields, outTempDay and outTempNight, in the weewx-WD database. Data is > stored using the 0600-1800 day. Aggregates over month, year all time etc > now become very simple, just part of the standard weewx machinery and you > avoid some pretty messy and slow queries that would have to operate on the > archive. The downside is you are essentially double recording outTemp but > what's another few Mbytes. > > I agree it's a very useful statistic and one that is quite relevant here > at this time of year. > > Gary > > -- 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. For more options, visit https://groups.google.com/d/optout.