freddie wrote: ↑Sun 20 Oct 2024 7:22 pm
I think it is a no-brainer for MX to have an internal counter that is completely independent of the station, and that is only updated by rainfall reports (including reading archive records) from the station and user corrections. It should start at zero from the time of earliest data. It should be persisted frequently to guard against crashes or sudden power loss. Each reading persisted should have an associated timestamp. Historic edits to rainfall data would be easy if there are timestamps, with the associated change propagated forward simply to the current data timestamp.
What MX really needs is an internal database. It cries out for it, and would make data edits (and the promulgation of those edits to external sources) consistent and simple. By external sources, I mean user's own databases and any logging done to files.
The internal counter with timestamp sounds logical enough.
But the internal database? Apart from the efforts by Mark in some alpha testing some years ago, where he made an SQLite database where all data went. For my, then three year or so, dataseries that already became huge. But you might look into some
timeseries database without relational/SQL access. That might indeed lead to something.
Apart from that, binary storage could be promising. You would also require
some user API data acces to actually access (and possibly modify?) those data using some form of block or record access or even retrieving the whole series one way or another. Unless you would not want users or actually do data analysis themselves which would make CMX less popular I guess.
A non-ascii (binary) internal rain counter would be logical as this number typically must be protected from direct user interference. And yes, the derivatives (rainfall on a day, per month, year etc.... should be easily - and automatically - modifiable when changing the internal counter on some time.
You might think of some hybrid data storage: rain in a (binary) timeseries db while maintaining the ascii db for easy access (the access of the inifiles for records I count outside the db storage). CMX could then ignore the ascii rain values currently in the ascii db and only use the binary. Hybrid is always confusing though and the idea might better be ignored.
broadstairs wrote: ↑Sun 20 Oct 2024 8:20 pm
That's fine for someone starting from scratch with CMX. My concern on that database would be how would it cope with someone like me wanting to import 17 years of previous data from another software when moving to CMX?
Import data would be some additional tool for that database of course. That would not be a user problem. And importing should only be permitted for data outside the period already in that binary CMX database: when importing, the existing data takes precedence. I do not see a problem there (for the user that is).
In general a new internal database sounds great - given some size and acces speed constraints - but it would require a rebuild of CMX - almost? - from the ground up.
mcrossley wrote: ↑Sun 20 Oct 2024 4:33 pm
[...] but the bug bear is always those times users/stations reset counters or subtract from crazy counts caused by hardware faults or cleaning rain tippers.
Hardware faults and power surges etc... are beyond a requirement as they would need some additional hardware to the weathercomputer. But they may need a good
and easy correction facility (also for other sensors).