xrspatial.emerging_hotspots.emerging_hotspots#

xrspatial.emerging_hotspots.emerging_hotspots(raster, kernel, boundary='nan')[source]#

Classify time-series hot spot and cold spot trends.

Combines the Getis-Ord Gi* statistic (per time step) with the Mann-Kendall non-parametric trend test to assign each pixel one of 17 categories describing how spatial clusters evolve over time.

Parameters:
  • raster (xarray.DataArray, 3-D (time, y, x)) – Input values. Can be NumPy-backed, CuPy-backed, or Dask+NumPy-backed.

  • kernel (numpy.ndarray, 2-D) – Spatial neighbourhood weights for the Gi* statistic.

  • boundary (str, default 'nan') – How to handle edges where the kernel extends beyond the raster. One of 'nan', 'nearest', 'reflect', 'wrap'.

Returns:

  • xarray.Datasetcategory : (y, x) int8 – trend code in [-8, 8]. gi_zscore : (time, y, x) float32 – Gi* z-score per step. gi_bin : (time, y, x) int8 – confidence bin per step. trend_zscore : (y, x) float32 – Mann-Kendall Z. trend_pvalue : (y, x) float32 – Mann-Kendall p-value.

  • Category codes

  • ————–

  • ====== ============ ======================================

  • Code Name Rule

  • ====== ============ ======================================

  • 1 New Hot only at the final time step

  • 2 Consecutive Hot for final N consecutive steps – (N>=2), never before

  • 3 Intensifying Hot >=90% incl. final, MK up

  • 4 Persistent Hot >=90% incl. final, MK flat

  • 5 Diminishing Hot >=90% incl. final, MK down

  • 6 Sporadic Hot at final, <90%, never cold

  • 7 Oscillating Hot at final, was cold at least once

  • 8 Historical Hot >=90% of steps, NOT at final

  • -1..-8 Cold spot mirrors of 1-8

  • 0 No Pattern None of the above

  • ====== ============ ======================================