xrspatial.mcda.standardize.standardize#

xrspatial.mcda.standardize.standardize(agg: DataArray, method: str = 'linear', *, direction: str = 'higher_is_better', bounds: tuple[float, float] | None = None, midpoint: float = 0.0, spread: float = 1.0, mean: float = 0.0, std: float = 1.0, low: float = 0.0, peak: float = 0.5, high: float = 1.0, breakpoints: list[float] | None = None, values: list[float] | None = None, mapping: dict | None = None, name: str | None = None) DataArray[source]#

Standardize a criterion raster to 0-1 suitability scale.

Parameters:
  • agg (xr.DataArray) – Input criterion raster (numpy, cupy, dask+numpy, or dask+cupy).

  • method (str) – Value function type. One of "linear", "sigmoidal", "gaussian", "triangular", "piecewise", or "categorical".

  • direction (str) – For monotonic methods ("linear"): "higher_is_better" or "lower_is_better".

  • bounds (tuple of float, optional) – (low, high) for linear scaling. Values outside bounds are clipped. If None, uses data min/max.

  • midpoint (float) – Inflection point for sigmoidal method.

  • spread (float) – Steepness for sigmoidal method. Negative values produce a decreasing sigmoid.

  • mean (float) – Center of the bell curve for gaussian method.

  • std (float) – Width of the bell curve for gaussian method. Must be > 0.

  • low (float) – Vertices of the triangle for triangular method.

  • peak (float) – Vertices of the triangle for triangular method.

  • high (float) – Vertices of the triangle for triangular method.

  • breakpoints (list of float, optional) – X-coordinates for piecewise linear interpolation.

  • values (list of float, optional) – Corresponding suitability values for each breakpoint.

  • mapping (dict, optional) – {class_value: suitability} lookup for categorical method.

  • name (str, optional) – Name of the output DataArray. Defaults to the input name.

Returns:

Standardized raster with values in [0, 1]. NaN values pass through.

Return type:

xr.DataArray