Struct CoverageStepWindow
The first and last sample times of a site, with the tolerance (one time-step interval) within which a request beyond either end still counts as in range.
public readonly record struct CoverageStepWindow : IEquatable<CoverageStepWindow>
- Implements
- Inherited Members
Constructors
CoverageStepWindow(DateTime, DateTime, TimeSpan)
The first and last sample times of a site, with the tolerance (one time-step interval) within which a request beyond either end still counts as in range.
public CoverageStepWindow(DateTime First, DateTime Last, TimeSpan Tolerance)
Parameters
FirstDateTimeFirst time step (UTC).
LastDateTimeLast time step (UTC).
ToleranceTimeSpanHow far beyond either end a requested time still counts as in range.
Properties
First
First time step (UTC).
public DateTime First { get; init; }
Property Value
Last
Last time step (UTC).
public DateTime Last { get; init; }
Property Value
Tolerance
How far beyond either end a requested time still counts as in range.
public TimeSpan Tolerance { get; init; }
Property Value
Methods
Covers(DateTime)
Whether time is within the window, allowing Tolerance at either end.
public bool Covers(DateTime time)
Parameters
timeDateTime
Returns
DistanceTo(DateTime)
public TimeSpan DistanceTo(DateTime time)
Parameters
timeDateTime
Returns
FromStation(DateTime, DateTime, TimeSpan, IReadOnlyList<DateTime>)
The window of a station's series: its sample times when it lists them, otherwise its start and end. The tolerance is the record interval, or the smallest gap between sample times when the interval is not set.
public static CoverageStepWindow FromStation(DateTime start, DateTime end, TimeSpan interval, IReadOnlyList<DateTime> sampleTimes)
Parameters
startDateTimeendDateTimeintervalTimeSpansampleTimesIReadOnlyList<DateTime>
Returns
FromSteps(IEnumerable<DateTime>)
The window of a set of time steps, with the smallest gap between them as the tolerance.
public static CoverageStepWindow FromSteps(IEnumerable<DateTime> steps)
Parameters
stepsIEnumerable<DateTime>The time steps, in any order; at least one.