preprocessing.apply_band_norm
preprocessing.apply_band_norm(arr, recipe, *, mean=None, std=None)Apply a normalisation recipe to a 2-D band array.
Recipes
("passthrough",) Return arr unchanged. Used for categorical / QA bands.
("linear", in_min, in_max) clip((x - in_min) / (in_max - in_min), 0, 1). The default for spectral DN bands (S2 / Landsat / HLS / NAIP / MODIS_SR).
("log_db", eps) 10 * log10(x + eps) then linear-map a typical SAR dB range [-25, 0] to [0, 1]. The default for Sentinel-1 backscatter.
("mean_subtract", scale) Per-tile mean subtraction then divide by scale. The default for DEM / elevation. Caller can pass mean= to use an externally-computed (e.g. per-AOI) mean instead of the per-tile mean.
("kelvin_to_celsius_norm", lo_c, hi_c) MODIS LST scale + offset (x * 0.02 - 273.15) then linear-map [lo_c, hi_c] to [0, 1].
("divide", divisor) Trivial division. Used for already-percentile-scaled bands like JRC-GSW occurrence (0-100 -> 0-1).
("zscore", mean, std) Pass mean / std explicitly to override per-tile defaults. Useful for callers that fit statistics across many tiles.
("one_hot", classes) Convert categorical class IDs to a stack of one-hot channels – returns shape (len(classes), H, W) of float32. classes is a tuple of integer class IDs to include in the output (other classes become all-zero columns).