The gaps.R script and gapless_Datetimes() function create a sequence that is anchored to the minimum and maximum of the specified Datetime column. Due to minor time inaccuracies, I'm encountering frequent issues where there is a phase shift in time data sequence that occurs part way through files, e.g., 12:00:02 to 12:00:04 to 12:00:06 to 12:00:07 to 12:00:09 to 12:00:11. This results in a plot like the one below where gaps and irregular data are consistently found even during periods where data collect is actually regular:
I'd like to propose 2 alternative ideas for modifying the behavior of gap handler to handle this type of case. The first would be a procedure that does some basic phase shift detection based on some tolerance paramter to determine how far a timestamp can be from the expected sequence. Then if a phase shift is detected, align the gapless sequence based on actual timestamps instead of forcing alignment to the min/max.
Alternatively, one could simply round timestamps to the nearest epoch interval, so in the example above you would find where the phase shift starts and then round up to 12:00:02, 12:00:04, 12:00:06, 12:00:08, 12:00:10, etc.
The
gaps.Rscript andgapless_Datetimes()function create a sequence that is anchored to the minimum and maximum of the specified Datetime column. Due to minor time inaccuracies, I'm encountering frequent issues where there is a phase shift in time data sequence that occurs part way through files, e.g., 12:00:02 to 12:00:04 to 12:00:06 to 12:00:07 to 12:00:09 to 12:00:11. This results in a plot like the one below where gaps and irregular data are consistently found even during periods where data collect is actually regular:I'd like to propose 2 alternative ideas for modifying the behavior of gap handler to handle this type of case. The first would be a procedure that does some basic phase shift detection based on some tolerance paramter to determine how far a timestamp can be from the expected sequence. Then if a phase shift is detected, align the gapless sequence based on actual timestamps instead of forcing alignment to the min/max.
Alternatively, one could simply round timestamps to the nearest epoch interval, so in the example above you would find where the phase shift starts and then round up to 12:00:02, 12:00:04, 12:00:06, 12:00:08, 12:00:10, etc.