pysteps.noise.fftgenerators.initialize_param_2d_fft_filter

pysteps.noise.fftgenerators.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.

Parameters:
X : array-like

Two- or three-dimensional array containing one or more input fields. All values are required to be finite. If more than one field are passed, the average fourier filter is returned. It assumes that fields are stacked by the first axis: [nr_fields, y, x].

Returns:
out : dict

A a dictionary containing the keys F, input_shape, model and pars. 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 last two are the model and fitted parameters, respectively.

This dictionary can be passed to pysteps.noise.fftgenerators.generate_noise_2d_fft_filter() to generate noise fields.

Other Parameters:
 
win_type : {‘hanning’, ‘flat-hanning’ or None}

Optional tapering function to be applied to X, generated with pysteps.noise.fftgenerators.build_2D_tapering_function() (default None).

model : {‘power-law’}

The name of the parametric model to be used to fit the power spectrum of X (default ‘power-law’).

weighted : bool

Whether or not to apply 1/sqrt(power) as weight in the numpy.polyfit() function (default False).

rm_rdisc : bool

Whether or not to remove the rain/no-rain disconituity (default False). It assumes no-rain pixels are assigned with lowest value.

fft_method : str or tuple

A string or a (function,kwargs) tuple defining the FFT method to use (see pysteps.utils.fft.get_method()). Defaults to “numpy”.