pysteps.noise

Implementation of deterministic and ensemble nowcasting methods.

pysteps.noise.interface

Interface for the noise module.

get_method(name) Return two callable functions to initialize and generate 2d perturbations of precipitation or velocity fields.

pysteps.noise.fftgenerators

Methods for noise generators based on FFT filtering of white noise.

The methods in this module implement the following interface for filter initialization depending on their parametric or nonparametric nature:

initialize_param_2d_xxx_filter(X, **kwargs)

or:

initialize_nonparam_2d_xxx_filter(X, **kwargs)

where X is an array of shape (m, n) or (t, m, n) that defines the target field and optional parameters are supplied as keyword arguments.

The output of each initialization method is a dictionary containing the keys F and input_shape. The first is a two-dimensional array of shape (m, int(n/2)+1) that defines the filter. The second one is the shape of the input field for the filter.

The methods in this module implement the following interface for the generation of correlated noise:

generate_noise_2d_xxx_filter(F, randstate=np.random, seed=None, **kwargs)

where F (m, n) is a filter returned from the corresponding initialization method, and randstate and seed can be used to set the random generator and its seed. Additional keyword arguments can be included as a dictionary.

The output of each generator method is a two-dimensional array containing the field of correlated noise cN of shape (m, n).

initialize_param_2d_fft_filter(X, **kwargs) Takes one ore more 2d input fields, fits two spectral slopes, beta1 and beta2, to produce one parametric, global and isotropic fourier filter.
initialize_nonparam_2d_fft_filter(X, **kwargs) Takes one ore more 2d input fields and produces one non-paramtric, global and anasotropic fourier filter.
initialize_nonparam_2d_nested_filter(X[, …]) Function to compute the local Fourier filters using a nested approach.
initialize_nonparam_2d_ssft_filter(X, **kwargs) Function to compute the local Fourier filters using the Short-Space Fourier filtering approach.
generate_noise_2d_fft_filter(F[, randstate, …]) Produces a field of correlated noise using global Fourier filtering.
generate_noise_2d_ssft_filter(F[, …]) Function to compute the locally correlated noise using a nested approach.

pysteps.noise.motion

Methods for generating perturbations of two-dimensional motion fields.

The methods in this module implement the following interface for initialization:

inizialize_xxx(V, pixelsperkm, timestep, optional arguments)

where V (2,m,n) is the motion field and pixelsperkm and timestep describe the spatial and temporal resolution of the motion vectors. The output of each initialization method is a dictionary containing the perturbator that can be supplied to generate_xxx.

The methods in this module implement the following interface for the generation of a motion perturbation field:

generate_xxx(perturbator, t, randstate=np.random, seed=None)

where perturbator is a dictionary returned by an initialize_xxx method. Optional random generator can be specified with the randstate and seed arguments, respectively. The output of each generator method is an array of shape (2,m,n) containing the x- and y-components of the motion vector perturbations, where m and n are determined from the perturbator.

get_default_params_bps_par() Return a tuple containing the default velocity perturbation parameters given in [BPS06] for the parallel component.
get_default_params_bps_perp() Return a tuple containing the default velocity perturbation parameters given in [BPS06] for the perpendicular component.
initialize_bps(V, pixelsperkm, timestep[, …]) Initialize the motion field perturbator described in [BPS06].
generate_bps(perturbator, t) Generate a motion perturbation field by using the method described in [BPS06].

pysteps.noise.utils

Miscellaneous utility functions related to generation of stochastic perturbations.

compute_noise_stddev_adjs(R, R_thr_1, …[, …]) Apply a scale-dependent adjustment factor to the noise fields used in STEPS.