easy_vic_build.tools.geo_func.fill_gap

Module easy_vic_build.tools.geo_func.fill_gap.

Functions

nearest_neighbor_fill(data)

Fill missing values using nearest-neighbor propagation.

easy_vic_build.tools.geo_func.fill_gap.nearest_neighbor_fill(data)[source]

Fill missing values using nearest-neighbor propagation.

Parameters:

data (numpy.ndarray or numpy.ma.MaskedArray) – Input array with missing values represented by a mask.

Returns:

Array where masked values are replaced by nearest valid neighbors.

Return type:

numpy.ndarray

Notes

For masked arrays, the mask is used directly. For plain arrays, this function follows the existing implementation behavior.