environmentaltools.spatiotemporal.indicators.maximum_influence_extent
- environmentaltools.spatiotemporal.indicators.maximum_influence_extent(data_cube, percentile=95)[source]
Calculate maximum spatial extent under extreme conditions.
Determines the spatial boundary encompassing areas that experience extreme values (defined by a percentile threshold) over the time period. This is useful for assessing maximum impact zones or worst-case scenarios.
- Parameters:
data_cube (np.ndarray) – 3D array with shape (time, lat, lon) containing spatiotemporal data.
percentile (float, optional) – Percentile to define extreme condition (e.g., 95 for 95th percentile). Default is 95.
- Returns:
contours (list) – List of contour coordinates defining the maximum influence extent.
extreme_map (np.ndarray) – 2D map of extreme values (specified percentile) for each spatial cell.
Notes
The function computes the specified percentile value for each spatial location across time, then identifies contours around areas where these extreme values exceed the mean extreme value.
Examples
>>> import numpy as np >>> data_cube = np.random.gamma(2, 1, (100, 30, 30)) # Gamma-distributed data >>> contours, extreme_map = maximum_influence_extent(data_cube, percentile=90)