alsdb.processing.change.compute_change#
- alsdb.processing.change.compute_change(store: ALSZarrStore, variable: str, year_from: int, year_to: int, resolution: float, *, min_delta: float = 0.0, pct_min_abs: float = 0.0, overwrite: bool = False) None[source]#
Compute per-pixel change between two survey years for variable.
Reads both time slices from store and writes three derived variables:
{variable}_delta: absolute changeyear_to − year_from, same units as the source variable. NaN where either year has no data.{variable}_delta_pct: relative change in %. NaN where|year_from| < pct_min_abs(avoids division by near-zero and suppresses meaningless percentages for very small base values).{variable}_change_flag: +1 gain, −1 loss, 0 no significant change. Pixels are flagged only when|delta| > min_delta.
- Parameters:
store –
ALSZarrStorecontaining the source variable.variable – Variable name, e.g.
"chm","lai","biomass".year_from – Survey years to compare. Both must already be present in store.
year_to – Survey years to compare. Both must already be present in store.
resolution – Resolution group in metres (e.g.
1.0or10.0).min_delta – Minimum absolute change flagged as significant (default 0). Set to e.g.
0.5m for CHM to suppress sub-pixel noise.pct_min_abs –
Minimum absolute value of
year_fromrequired for a valid relative- change estimate. Pixels where|year_from| < pct_min_absreceive NaN indelta_pct. Choose a value appropriate for the variable:CHM (m):
pct_min_abs=0.5suppresses extremes in open areas.LAI / gap fraction (0–1):
pct_min_abs=0.05avoids blow-up near bare-ground cells.AGB (Mg ha⁻¹):
pct_min_abs=1.0avoids extreme % in sparse scrub.
Default
0.0reproduces the legacy behaviour (threshold = 1e-6).overwrite – Re-compute even if the output variables already exist for year_to.