xrspatial.mcda.constrain.constrain#
- xrspatial.mcda.constrain.constrain(suitability: DataArray, exclude: list[DataArray], fill: float = nan, name: str | None = None) DataArray[source]#
Mask out areas that are categorically unsuitable.
Pixels where any exclusion mask is True (nonzero) are set to fill.
- Parameters:
suitability (xr.DataArray) – Input suitability surface.
exclude (list of xr.DataArray) – Boolean or binary masks. True/nonzero marks excluded areas.
fill (float) – Value to assign to excluded pixels. Default
np.nan.name (str, optional) – Name of the output DataArray.
- Returns:
Constrained suitability surface.
- Return type:
xr.DataArray