Table of Contents

Interface IPyramidReducer

Namespace
EncDotNet.S100.Pipelines.Coverage.Pyramid
Assembly
EncDotNet.S100.Core.dll

Reduces a 2×2 (or partial) window of source-level cells to a single coarser-level cell value, respecting the coverage's NODATA sentinel (S-100 Part 10c §11 fill values; issue #486).

public interface IPyramidReducer

Remarks

Reducers are field-specific: S-102 depth uses a shoal-biased MinReducer so pyramid cells are never safer than any base cell they pool (never a shallower depth reported as deeper); S-102 uncertainty uses MaxReducer to report the worst-case pooled uncertainty; S-104 water-level heights use MeanReducer; S-111 speed/direction pairs use VectorMeanReducer which averages the (u, v) decomposition so the resultant is correct at the 0°/360° branch cut. The NODATA sentinel is passed as a value (not NaN) to match the S-102 1_000_000f fill convention.

Windows near the base grid's east/south edges may span fewer than four source cells when a dimension has an odd length; implementers must therefore accept a variable-length span rather than a fixed 4-tuple. See CoveragePyramidBuilder for how windows are enumerated.

Methods

Reduce(ReadOnlySpan<float>, float)

Reduces a window of up to four source cells to one coarser-level cell value.

float Reduce(ReadOnlySpan<float> window, float noDataValue)

Parameters

window ReadOnlySpan<float>

The source cells in the current 2×2 window, in row-major order. Length is 1..4 (edge windows may be short).

noDataValue float

The coverage's NODATA sentinel (e.g. S-102 1_000_000f). Source cells equal to this value are excluded from the reduction; if every cell in the window is NODATA the reducer returns the sentinel too.

Returns

float