environmentaltools.spatiotemporal.indicators.mean_exceedance_over_total_area
- environmentaltools.spatiotemporal.indicators.mean_exceedance_over_total_area(data, thresholds=None)[source]
Compute mean value of exceedances normalized by total area.
Calculates the sum of values exceeding each threshold, normalized by the total number of spatial points. This indicator (MEW - Mean Exceedance over Whole domain) provides a measure of exceedance intensity averaged over the entire spatial domain.
- Parameters:
data (array_like) – 1D array of spatial data values to analyze.
thresholds (array_like, optional) – Array of threshold values to evaluate. If None, generates 100 equally spaced thresholds from 0 to the maximum data value.
- Returns:
thresholds (np.ndarray) – Array of threshold values used in the analysis.
mean_exceedances (np.ndarray) – Mean exceedance values normalized by total area.
Notes
The mean exceedance over total area is computed as:
\[MEW(t) = \frac{1}{N} \sum_{i=1}^{N} x_i \cdot \mathbb{1}(x_i \geq t)\]This indicator represents the spatial average of values that exceed the threshold, with non-exceedance points contributing zero.
Examples
>>> import numpy as np >>> data = np.random.exponential(5, 1000) >>> thresholds, mean_exc = mean_exceedance_over_total_area(data)