pysteps.nowcasts.sseps.forecast

Contents

pysteps.nowcasts.sseps.forecast#

pysteps.nowcasts.sseps.forecast(dataset: Dataset, 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.

Parameters:
  • dataset (xarray.Dataset) – Input dataset as described in the documentation of pysteps.io.importers. It has to contain the velocity_x and velocity_y data variables, as well as any precipitation data variable. The units and stepsize of y and x have to be the same and the only supported units are meters and kilometers. The time dimension of the dataset has to be size ar_order + 1 and the precipitation variable has to have this dimension. All velocity 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. Defaults to 6, see issue #385

    on GitHub.

  • 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 pysteps.cascade.bandpass_filters.py.

  • 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.

Returns:

out – If return_output is True, a dataset as described in the documentation of pysteps.io.importers is returned 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 metadata of the time coordinate. If measure_time is True, the return value is a three-element tuple containing the nowcast dataset, the initialization time of the nowcast generator and the time used in the main loop (seconds).

Return type:

xarray.Dataset

Notes

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

References

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