Correct. The start of an interval depends on the current timestamp. The 
start of the interval right now may well be different to the start of the 
interval if it were five seconds later. Consider all time since epoch 
timestamp=0 split into intervals archive_interval seconds long. Then the 
start of the interval is the timestamp at the start of the current 
archive_interval interval if that makes sense, more easily explained 
mathematically, mathematically it is defined as:

archive_interval_start_ts = int(ts/archive_interval) * archive_interval

where:

archive_interval_start_ts is the epoch timestamp of the start of the 
archive interval
ts is the current epoch timestamp
archive_interval is length of the archive interval in seconds

Within WeeWX it is calculated by calling the 
weeutil.weeutil.startOfInterval() 
<https://github.com/weewx/weewx/blob/f90473fb97909a80151d097f6f9799c26bba798c/bin/weeutil/weeutil.py#L132>
 
function.

Gary
On Wednesday, 10 February 2021 at 06:06:28 UTC+10 Jan-Jaap van der Geer 
wrote:

> On Tuesday, February 9, 2021 at 1:48:18 PM UTC+1 gjr80 wrote:
>
>> Very simply, when your driver is emitting loop packets your time 
>> resolution is the time between loop packet timestamps, once your driver is 
>> emitting archive records your time resolution decreases and is the time 
>> between archive record timestamps. Similar but slightly different with 
>> actual values, loop packets give you the finest granularity of the 
>> observation values, once you move to archive records you get the average of 
>> the loop values (well actually you get whatever function is used to obtain 
>> an archive record value from a group of loop packet values, this is usually 
>> the average but it could be the sum or the last or the first value, it 
>> depends).
>>
>
> When is the start of an interval? If the interval chosen would be a silly 
> number, like for example 7, when is the start of it? Is that every multiple 
> of 7 minutes since unixtime 0, I assume?
>
> Cheers,
> Jan-Jaap 
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-development+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/f6808411-533c-4cde-a7e1-9a46473750fdn%40googlegroups.com.

Reply via email to