Class WeatherTimeStep
One time step of a weather parameter: its valid time and a callback that decodes its values when they're needed.
public sealed class WeatherTimeStep
- Inheritance
-
WeatherTimeStep
- Inherited Members
Constructors
WeatherTimeStep(DateTime, WeatherStepDecoder)
Creates a time step whose values are decoded on demand.
public WeatherTimeStep(DateTime validTime, WeatherStepDecoder decoder)
Parameters
validTimeDateTimeThe time the values are valid for, in UTC.
decoderWeatherStepDecoderDecodes the step's values in the file's order.
Properties
ValidTime
The time the values are valid for, in UTC.
public DateTime ValidTime { get; }
Property Value
Methods
Decode(CancellationToken)
Decodes the step's values in the file's order. Prefer ReadStep(WeatherParameter, int, CancellationToken), which also normalises them.
public float[] Decode(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenSignals that the caller no longer needs the step.
Returns
- float[]
The values in the file's row-major order.
FromValues(DateTime, float[])
Creates a time step over values already in memory, for example a grid built in a test.
public static WeatherTimeStep FromValues(DateTime validTime, float[] nativeValues)
Parameters
validTimeDateTimeThe time the values are valid for, in UTC.
nativeValuesfloat[]The values in the file's row-major order. The array isn't copied.