pysteps.nowcasts.anvil.forecast

Contents

pysteps.nowcasts.anvil.forecast#

pysteps.nowcasts.anvil.forecast(dataset: Dataset, timesteps, n_cascade_levels=6, extrap_method='semilagrangian', ar_order=2, ar_window_radius=50, r_vil_window_radius=3, fft_method='numpy', apply_rainrate_mask=True, num_workers=1, extrap_kwargs=None, filter_kwargs=None, measure_time=False)#

Generate a nowcast by using the autoregressive nowcasting using VIL (ANVIL) method. ANVIL is built on top of an extrapolation-based nowcast. The key features are:

  1. Growth and decay: implemented by using a cascade decomposition and a multiscale autoregressive integrated ARI(p,1) model. Instead of the original time series, the ARI model is applied to the differenced one corresponding to time derivatives.

  2. Originally designed for using integrated liquid (VIL) as the input data. In this case, the rain rate (R) is obtained from VIL via an empirical relation. This implementation is more general so that the input can be any two-dimensional precipitation field.

  3. The parameters of the ARI model and the R(VIL) relation are allowed to be spatially variable. The estimation is done using a moving window.

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 either VIL values in the precip_accum data variable or rainrate in the precip_intensity data variable. The time dimension of the dataset has to be size ar_order + 2 and the precipitation variable has to have this dimension. When VIL values are supplied, optionally precip_accum can be supplied as well without a time dimension, containing the most recently observed rain rate field. If not supplied, no R(VIL) conversion is done and the outputs are in the same units as the inputs.

  • 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_cascade_levels (int, optional) – The number of cascade levels to use. Defaults to 6, see issue #385 on GitHub.

  • extrap_method (str, optional) – Name of the extrapolation method to use. See the documentation of pysteps.extrapolation.interface.

  • ar_order (int, optional) – The order of the autoregressive model to use. The recommended values are 1 or 2. Using a higher-order model is strongly discouraged because the stationarity of the AR process cannot be guaranteed.

  • ar_window_radius (int, optional) – The radius of the window to use for determining the parameters of the autoregressive model. Set to None to disable localization.

  • r_vil_window_radius (int, optional) – The radius of the window to use for determining the R(VIL) relation. Applicable if rainrate is not None.

  • fft_method (str, optional) – 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’.

  • apply_rainrate_mask (bool) – Apply mask to prevent producing precipitation to areas where it was not originally observed. Defaults to True. Disabling this may improve some verification metrics but increases the number of false alarms. Applicable if rainrate is None.

  • num_workers (int, optional) – The number of workers to use for parallel computation. Applicable if dask is installed 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.

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

  • filter_kwargs (dict, optional) – Optional dictionary containing keyword arguments for the filter method. See the documentation of pysteps.cascade.bandpass_filters.py.

  • measure_time (bool, optional) – If 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. 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

References

[PCvLH20]