pysteps.cascade

Methods for constructing bandpass filters and decomposing 2d precipitation fields into different spatial scales.

pysteps.cascade.interface

Interface for the cascade module.

get_method(name) Return a callable function for the bandpass filter or decomposition method corresponding to the given name.

pysteps.cascade.bandpass_filters

Bandpass filters for separating different spatial scales from two-dimensional images in the frequency domain.

The methods in this module implement the following interface:

filter_xxx(shape, n, optional arguments)

where shape is the shape of the input field, respectively, and n is the number of frequency bands to use.

The output of each filter function is a dictionary containing the following key-value pairs:

Key Value
weights_1d 2d array of shape (n, r) containing 1d filter weights for each frequency band k=1,2,…,n
weights_2d 3d array of shape (n, M, int(N/2)+1) containing the 2d filter weights for each frequency band k=1,2,…,n
central_freqs 1d array of shape n containing the central frequencies of the filters

where r = int(max(N, M)/2)+1

By default, the filter weights are normalized so that for any Fourier wavenumber they sum to one.

Available filters

filter_uniform(shape, n) A dummy filter with one frequency band covering the whole domain.
filter_gaussian(shape, n[, l_0, …]) Implements a set of Gaussian bandpass filters in logarithmic frequency scale.

pysteps.cascade.decomposition

Methods for decomposing two-dimensional images into multiple spatial scales.

The methods in this module implement the following interface:

decomposition_xxx(X, filter, **kwargs)

where X is the input field and filter is a dictionary returned by a filter method implemented in pysteps.cascade.bandpass_filters. Optional parameters can be passed in the keyword arguments. The output of each method is a dictionary with the following key-value pairs:

Key Value
cascade_levels three-dimensional array of shape (k,m,n), where k is the number of cascade levels and the input fields have shape (m,n)
means list of mean values for each cascade level
stds list of standard deviations for each cascade level

Available methods

decomposition_fft(X, filter, **kwargs) Decompose a 2d input field into multiple spatial scales by using the Fast Fourier Transform (FFT) and a bandpass filter.