Class MeanReducer
Arithmetic-mean reducer for scalar fields where averaging is the
natural downsample (S-104 waterLevelHeight, generic
non-safety scalars).
public sealed class MeanReducer : IPyramidReducer
- Inheritance
-
MeanReducer
- Implements
- Inherited Members
Remarks
NODATA cells are excluded from the average. An entirely-NODATA window returns NODATA.
Fields
Instance
Shared instance; the reducer holds no state.
public static readonly MeanReducer Instance
Field Value
Methods
Reduce(ReadOnlySpan<float>, float)
Reduces a window of up to four source cells to one coarser-level cell value.
public float Reduce(ReadOnlySpan<float> window, float noDataValue)
Parameters
windowReadOnlySpan<float>The source cells in the current 2×2 window, in row-major order. Length is 1..4 (edge windows may be short).
noDataValuefloatThe 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.