in3Utils.MoTUtils.rewriteDEMtoZeroValues

rewriteDEMtoZeroValues(demFile)[source]

Set all NaN values in a DEM raster to zero and update the nodata value.

This function reads a DEM raster file, replaces all NaN values with 0.0, updates the nodata value in the header to 0.0, and writes the modified raster back to a new file.

Parameters

demFile (pathlib.Path) – Path to the input DEM raster file

Returns

Writes a new raster file with zero values instead of NaN values. The output file is saved in the same directory as the input file, using the same stem name.

Return type

None

Notes

The function uses the rasterUtils module for reading and writing raster data. The output raster is flipped during writing.