climpred.classes.PerfectModelEnsemble.smooth

PerfectModelEnsemble.smooth(smooth_kws=None, how='mean', **xesmf_kwargs)

Smooth all entries of PredictionEnsemble in the same manner to be able to still calculate prediction skill afterwards.

Parameters

Examples

>>> PerfectModelEnsemble.get_initialized().lead.size
20
>>> PerfectModelEnsemble.smooth({'lead':4}, how='sum').get_initialized().lead.size
17
>>> HindcastEnsemble_3D.smooth({'lon':1, 'lat':1})
<climpred.HindcastEnsemble>
Initialized Ensemble:
    SST      (init, lead, lat, lon) float64 -0.3236 -0.3161 -0.3083 ... 0.0 0.0
Observations:
    SST      (time, lat, lon) float64 0.002937 0.001561 0.002587 ... 0.0 0.0 0.0
Uninitialized:
    None

smooth simultaneously aggregates spatially listening to lon and lat and temporally listening to lead or time.

>>> HindcastEnsemble_3D.smooth({'lead': 2, 'lat': 5, 'lon': 4}).get_initialized().coords
Coordinates:
  * init     (init) object 1954-01-01 00:00:00 ... 2017-01-01 00:00:00
  * lead     (lead) int32 1 2 3 4 5 6 7 8 9
  * lon      (lon) float64 250.8 254.8 258.8 262.8
  * lat      (lat) float64 -9.75 -4.75
>>> HindcastEnsemble_3D.smooth('goddard2013').get_initialized().coords
Coordinates:
  * init     (init) object 1954-01-01 00:00:00 ... 2017-01-01 00:00:00
  * lead     (lead) int32 1 2 3 4 5 6 7
  * lon      (lon) float64 250.8 255.8 260.8 265.8
  * lat      (lat) float64 -9.75 -4.75