Skip to content

fss

Import path: earth2studio.statistics.fss

View source on GitHub

Documentation

Statistic for calculating the fractions skill score (FSS) of one array with respect to another over a set of given dimensions.

If ensemble_dimension is provided, computes the probabilistic FSS as defined by Necker et al. (2024): doi.org/10.1002/qj.4824.

Parameters:

  • reduction_dimensions (list[str]) –

    A list of names corresponding to dimensions to perform the statistical reduction over. Example: ['lat', 'lon']

  • window_sizes (ArrayLike) –

    A list of the window sizes (in pixels) applied when calculating FSS.

  • thresholds (ArrayLike) –

    A list of the thresholds applied when calculating FSS.

  • spatial_dimensions (tuple[str, str] | None, default: None ) –

    Indicates the spatial dimensions. If None, it is assumed that these are the last two dimensions.

  • ensemble_dimension (str | None, default: None ) –

    Ensemble dimension for computation of probabilistic FSS. If None (default), forecast is interpreted as deterministic.

  • batch_update (bool, default: False ) –

    Whether to apply batch updates to the FSS with each invocation of call. This is particularly useful when data is recieved in a stream of batches. Each invocation of call will return the running FSS.

__call__

__call__(x: DataArray, y: DataArray) -> DataArray

Apply metric to data x and y, reducing over reduction_dims. y must have every dimension of x except the ensemble dimension, if the metric has one, with matching coordinate values; it is transposed to x's order, not broadcast.

Parameters:

  • x (DataArray) –

    Input array, typically the forecast or prediction array. reduction_dimensions must be in x, as must ensemble_dimension and spatial_dimensions if provided in constructor.

  • y (DataArray) –

    Input array #2 intended to be used as validation data. Must not contain the ensemble dimension.

Returns:

  • DataArray –

    Returns fractions skill score array with appropriate reduced coordinates and trailing threshold and window_size dimensions.