earthkit.meteo.score.xarray.spread

earthkit.meteo.score.xarray.spread(fcst, over, reference=None)

Calculates the spread of a forecast compared to a reference.

Warning

Experimental API. This function may change or be removed without notice.

The spread is defined as:

\[s_i = \sqrt{ \frac{1}{N} \sum_{i=1}^N \left(f_i - r\right)^2}\]

where:

  • \(f_i\) is the forecast,

  • \(r\) is the reference,

  • \(s_i\) is the spread.

Parameters:
  • fcst (xarray object) – The forecast xarray.

  • over (str or list of str) – The dimension(s) over which to compute the spread.

  • reference (xarray object, optional) – The reference xarray to compare against. If not provided, the mean of the forecast over over is used.

Returns:

The spread of the forecast compared to the reference.

Return type:

xarray object