pysteps.nowcasts.sseps.forecast(precip, metadata, velocity, timesteps, n_ens_members=24, n_cascade_levels=6, win_size=256, overlap=0.1, war_thr=0.1, extrap_method='semilagrangian', decomp_method='fft', bandpass_filter_method='gaussian', noise_method='ssft', ar_order=2, vel_pert_method=None, probmatching_method='cdf', mask_method='incremental', callback=None, fft_method='numpy', return_output=True, seed=None, num_workers=1, extrap_kwargs=None, filter_kwargs=None, noise_kwargs=None, vel_pert_kwargs=None, mask_kwargs=None, measure_time=False)#

Generate a nowcast ensemble by using the Short-space ensemble prediction system (SSEPS) method. This is an experimental version of STEPS which allows for localization by means of a window function.

  • precip (array-like) – Array of shape (ar_order+1,m,n) containing the input precipitation fields ordered by timestamp from oldest to newest. The time steps between the inputs are assumed to be regular, and the inputs are required to have finite values.

  • metadata (dict) – Metadata dictionary containing the accutime, xpixelsize, threshold and zerovalue attributes as described in the documentation of xpixelsize is assumed to be in meters.

  • velocity (array-like) – Array of shape (2,m,n) containing the x- and y-components of the advection field. The velocities are assumed to represent one time step between the inputs. All values are required to be finite.

  • win_size (int or two-element sequence of ints) – Size-length of the localization window.

  • overlap (float [0,1[) – A float between 0 and 1 prescribing the level of overlap between successive windows. If set to 0, no overlap is used.

  • war_thr (float) – Threshold for the minimum fraction of rain in a given window.

  • timesteps (int or list of floats) – Number of time steps to forecast or a list of time steps for which the forecasts are computed (relative to the input time step). The elements of the list are required to be in ascending order.

  • n_ens_members (int) – The number of ensemble members to generate.

  • n_cascade_levels (int) – The number of cascade levels to use.

  • extrap_method ({'semilagrangian'}) – Name of the extrapolation method to use. See the documentation of pysteps.extrapolation.interface.

  • decomp_method ({'fft'}) – Name of the cascade decomposition method to use. See the documentation of pysteps.cascade.interface.

  • bandpass_filter_method ({'gaussian', 'uniform'}) – Name of the bandpass filter method to use with the cascade decomposition.

  • noise_method ({'parametric','nonparametric','ssft','nested',None}) – Name of the noise generator to use for perturbating the precipitation field. See the documentation of pysteps.noise.interface. If set to None, no noise is generated.

  • ar_order (int) – The order of the autoregressive model to use. Must be >= 1.

  • vel_pert_method ({'bps',None}) – Name of the noise generator to use for perturbing the advection field. See the documentation of pysteps.noise.interface. If set to None, the advection field is not perturbed.

  • mask_method ({'incremental', None}) – The method to use for masking no precipitation areas in the forecast field. The masked pixels are set to the minimum value of the observations. ‘incremental’ = iteratively buffer the mask with a certain rate (currently it is 1 km/min), None=no masking.

  • probmatching_method ({'cdf', None}) – Method for matching the statistics of the forecast field with those of the most recently observed one. ‘cdf’=map the forecast CDF to the observed one, None=no matching applied. Using ‘mean’ requires that mask_method is not None.

  • callback (function) – Optional function that is called after computation of each time step of the nowcast. The function takes one argument: a three-dimensional array of shape (n_ens_members,h,w), where h and w are the height and width of the input field precip, respectively. This can be used, for instance, writing the outputs into files.

  • return_output (bool) – Set to False to disable returning the outputs as numpy arrays. This can save memory if the intermediate results are written to output files using the callback function.

  • seed (int) – Optional seed number for the random generators.

  • num_workers (int) – The number of workers to use for parallel computation. Applicable if dask is enabled or pyFFTW is used for computing the FFT. When num_workers>1, it is advisable to disable OpenMP by setting the environment variable OMP_NUM_THREADS to 1. This avoids slowdown caused by too many simultaneous threads.

  • fft_method (str) – A string defining the FFT method to use (see utils.fft.get_method). Defaults to ‘numpy’ for compatibility reasons. If pyFFTW is installed, the recommended method is ‘pyfftw’.

  • extrap_kwargs (dict) – Optional dictionary containing keyword arguments for the extrapolation method. See the documentation of pysteps.extrapolation.

  • filter_kwargs (dict) – Optional dictionary containing keyword arguments for the filter method. See the documentation of

  • noise_kwargs (dict) – Optional dictionary containing keyword arguments for the initializer of the noise generator. See the documentation of pysteps.noise.fftgenerators.

  • vel_pert_kwargs (dict) – Optional dictionary containing keyword arguments “p_pert_par” and “p_pert_perp” for the initializer of the velocity perturbator. See the documentation of pysteps.noise.motion.

  • mask_kwargs (dict) – Optional dictionary containing mask keyword arguments ‘mask_f’ and ‘mask_rim’, the factor defining the the mask increment and the rim size, respectively. The mask increment is defined as mask_f*timestep/kmperpixel.

  • measure_time (bool) – If set to True, measure, print and return the computation time.


out – If return_output is True, a four-dimensional array of shape (n_ens_members,num_timesteps,m,n) containing a time series of forecast precipitation fields for each ensemble member. Otherwise, a None value is returned. The time series starts from t0+timestep, where timestep is taken from the input precipitation fields.

Return type:



Please be aware that this represents a (very) experimental implementation.


[See03], [BPS06], [SPN13], [NBS+17]