pysteps.noise.fftgenerators.initialize_param_2d_fft_filter

pysteps.noise.fftgenerators.initialize_param_2d_fft_filter#

pysteps.noise.fftgenerators.initialize_param_2d_fft_filter(field, **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:
  • field (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].

  • win_fun ({'hann', 'tukey' or None}) – Optional tapering function to be applied to the input field, generated with pysteps.utils.tapering.compute_window_function(). (default None).

  • model ({'power-law'}) – The name of the parametric model to be used to fit the power spectrum of the input field (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 “FFT methods” in pysteps.utils.interface.get_method()). Defaults to “numpy”.

Returns:

out – A dictionary containing the keys field, 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.

Return type:

dict