- pysteps.nowcasts.anvil.forecast(vil, velocity, timesteps, rainrate=None, n_cascade_levels=8, 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:
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.
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.
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.
vil (array_like) – Array of shape (ar_order+2,m,n) containing the input fields ordered by timestamp from oldest to newest. The inputs are expected to contain VIL or rain rate. The time steps between the inputs are assumed to be regular.
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.
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.
rainrate (array_like) – Array of shape (m,n) containing the most recently observed rain rate field. If set to None, no R(VIL) conversion is done and the outputs are in the same units as the inputs.
n_cascade_levels (int, optional) – The number of cascade levels to use.
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.
out – A three-dimensional array of shape (num_timesteps,m,n) containing a time series of forecast precipitation fields. The time series starts from t0+timestep, where timestep is taken from the input VIL/rain rate fields. If measure_time is True, the return value is a three-element tuple containing the nowcast array, the initialization time of the nowcast generator and the time used in the main loop (seconds).
- Return type