Table of Contents

Class WaterLevelStation

Namespace
EncDotNet.S100.Datasets.S104
Assembly
EncDotNet.S100.Datasets.S104.dll

A single water-level time series at a fixed station, as encoded by an S-104 data-coding-format-1 or data-coding-format-8 instance (S-100 Part 10c §10.2.1).

public sealed class WaterLevelStation
Inheritance
WaterLevelStation
Inherited Members

Remarks

DCF1 encodes time records as groups and is transposed by the reader; DCF8 encodes each station's complete time series as one group. Both use Positioning/geometryValues for station coordinates.

Properties

EndTime

UTC timestamp of the last sample.

public required DateTime EndTime { get; init; }

Property Value

DateTime

Heights

Water-level heights in metres, one per time step, in ascending chronological order starting at StartTime.

public required float[] Heights { get; init; }

Property Value

float[]

Identifier

Identifier of the station (S-104 stationIdentification).

public required string Identifier { get; init; }

Property Value

string

Latitude

Station latitude in decimal degrees (WGS-84).

public required double Latitude { get; init; }

Property Value

double

Longitude

Station longitude in decimal degrees (WGS-84).

public required double Longitude { get; init; }

Property Value

double

NumberOfTimes

Number of samples in this station's time series — equal to Heights and Trends length.

public required int NumberOfTimes { get; init; }

Property Value

int

SampleTimes

Explicit UTC timestamps for each sample, in the same order as Heights and Trends. DCF1 readers populate this sequence from each Group_NNN/timePoint attribute (S-100 Part 10c §10.2.1); regular station encodings may leave it empty and use StartTime plus TimeRecordInterval.

public IReadOnlyList<DateTime> SampleTimes { get; init; }

Property Value

IReadOnlyList<DateTime>

StartTime

UTC timestamp of the first sample.

public required DateTime StartTime { get; init; }

Property Value

DateTime

TimeRecordInterval

Interval between consecutive samples when uniform. DCF1 readers derive it from SampleTimes and use Zero for non-uniform samples; DCF8 readers parse timeRecordInterval.

public required TimeSpan TimeRecordInterval { get; init; }

Property Value

TimeSpan

Decoded S-104 waterLevelTrend enumeration per time step (0=unknown, 1=decreasing, 2=increasing, 3=steady — see S-104 Edition 2.0.0 §10.2.2 Table 10-3).

public required byte[] Trends { get; init; }

Property Value

byte[]

Uncertainties

The uncertainty of each height in metres (a ± value), in the same order as Heights, or null when the dataset carries none. Resolved as for Uncertainties: the values record's uncertainty, else the instance's uncertainty dataset (S-104 Ed 2.0.0 §10.2.2.4). UncertaintyFillValue marks a step with neither.

public float[]? Uncertainties { get; init; }

Property Value

float[]

Methods

NearestTimeIndex(DateTime)

Returns the index of the sample whose timestamp is closest to time, clamped to [0, NumberOfTimes - 1]. Nearest-neighbour rounding; no interpolation.

public int NearestTimeIndex(DateTime time)

Parameters

time DateTime

Returns

int

TimeAt(int)

Returns the timestamp of the i-th sample, computed from StartTime and TimeRecordInterval.

public DateTime TimeAt(int index)

Parameters

index int

Returns

DateTime

UncertaintyAt(int)

The uncertainty at a time step in metres, or null when none is given.

public double? UncertaintyAt(int index)

Parameters

index int

The time step index.

Returns

double?

The uncertainty, or null.