⚠️ Our 0.1 release refactored several early-development functions for long-term stability, to update your code see here. ⚠️
Future changes will come with deprecation warnings! 🙂

geoutils.Raster.set_mask

geoutils.Raster.set_mask#

Raster.set_mask(mask)[source]#

Set a mask on the raster array.

All pixels where mask is set to True or > 0 will be masked (in addition to previously masked pixels).

Masking is performed in place. The mask must have the same shape as loaded data, unless the first dimension is 1, then it is ignored.

Parameters:

mask (ndarray[Any, dtype[bool_]] | Mask) – The raster array mask.

Return type:

None