TimeSeries-Interval is a subclass of TimeSeries class. Its purpose is to store timestamped data, but on the assumption that the data is continuous at some set interval. This is the case for much of the data that I intend to use it for.
The same basic scheme is followed as for the parent class; e.g., no timeseries file will span a year, timestamps are in UTC internally, and the basic epoch is the start of the year.
But in this case, all entries in a single file are contiguous, with no gaps; this allows dropping the timestamp value itself, since it can be calculated by counting the lines. Effectively, the interval control or index files are arrays of lines. The file names include the year and the first and last entry timestamps included.
The interval files are stored under a directory named for the interval, using a simple convention of VALUE-UNIT, where the unit can be one of s, m, h, d, w. So an interval of one hour would be stored under "1h/".
By default, the offset in seconds from the nominal timestamp is included in the control file. This allows exact event times to be stored.
Optionally, an assumed offset can be specified, in which case no entry is made in the control file; only the data itself would be stored. In this case, the offset is indicated in the directory name, e.g., "1h-5m" or "1m-2s".
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
TimeSeries-Interval is a subclass of TimeSeries class. Its purpose is to store timestamped data, but on the assumption that the data is continuous at some set interval. This is the case for much of the data that I intend to use it for.
The same basic scheme is followed as for the parent class; e.g., no timeseries file will span a year, timestamps are in UTC internally, and the basic epoch is the start of the year.
But in this case, all entries in a single file are contiguous, with no gaps; this allows dropping the timestamp value itself, since it can be calculated by counting the lines. Effectively, the interval control or index files are arrays of lines. The file names include the year and the first and last entry timestamps included.
The interval files are stored under a directory named for the interval, using a simple convention of VALUE-UNIT, where the unit can be one of s, m, h, d, w. So an interval of one hour would be stored under "1h/".
By default, the offset in seconds from the nominal timestamp is included in the control file. This allows exact event times to be stored.
Optionally, an assumed offset can be specified, in which case no entry is made in the control file; only the data itself would be stored. In this case, the offset is indicated in the directory name, e.g., "1h-5m" or "1m-2s".