environmentaltools.spatiotemporal.indicators.environmental_convergence
- environmentaltools.spatiotemporal.indicators.environmental_convergence(data_cube, size=3)[source]
Calculate environmental convergence as reduction of neighborhood differences over time.
Measures how the difference between each cell and its neighborhood changes over time. Negative values indicate convergence (becoming more similar to neighbors), while positive values indicate divergence.
- Parameters:
data_cube (np.ndarray) – 3D array with shape (time, lat, lon) containing spatiotemporal data.
size (int, optional) – Neighborhood size. Default is 3.
- Returns:
convergence_map – 2D map of convergence trends (negative = convergence, positive = divergence).
- Return type:
np.ndarray
Notes
The function computes the temporal trend of absolute differences between each cell and its neighborhood mean. Areas with negative trends are becoming more spatially homogeneous over time.
Examples
>>> import numpy as np >>> data_cube = np.random.random((50, 20, 20)) >>> convergence_map = environmental_convergence(data_cube, size=3)