Modal Decomposition

mrpod.modal_decomposition.mrpod_detail_bundle(data_array, *args, num_of_modes=50, seg=10, subtract_avg=False, reflect=False, normalize_mode=True, full_path_write=None, **kwargs)

Computes MRPOD modes, eigvals and proj coeffs from a dataset arranged in an ndarray of the shape of NxM0xM1x…, with N being the dimension that will be wavelet transformed.

Parameters:
data_array : ndarray

data array arranged in a dimension of NxM0xM1x…, such as a time series (N) of multi- dimensional scalar/vector fields.

num_of_modes : 50, int, optional

Number of modes to be computed (from the most energetic Mode 1). By default, all the valid modes are computed.

seg : 10, int, optional

In case of insufficient computer RAM, the data_array can be segmented along the M dimension of the reshaped NxM and pieced together after the filtering.

subtract_avg : False, bool, optional

If True, the ensemble average of the data_array along N is subtracted from the dataset.

reflect : False, bool, optional

If True, the cross-correlation matrix as well as the dataset is padded symmetrically along the sample axis.

normalize_mode : True, bool, optional

If True, the magnitudes of the modes will be normalized by their corresponding eingenvalues and the sample size.

full_path_write : None, path obj, optional

If provided, the output is saved locally in the specified directory.

Returns:
dict

A dictionary containing the eigenvalues, projection coefficients, POD modes, and the cross- correlation matrix.

Other Parameters:
 
**kwargs :

Keyword arguments from mrpod_eigendecomp() necessary to perform a wavelet transform.

mrpod.modal_decomposition.mrpod_eigendecomp(corr_mat, js, scales, pod_fcn=None, reflect=False, **kwargs)

Apply eigenvalue decomposition to cross-correlation matrices reconstructed in specific bandpasses using WaveletTranform.

Parameters:
corr_mat : ndarray

Cross-correlation matrix with a dimension of NxN

js : 1d arrray of int

The correponding decomposition levels. Different j levels are admissible for “max-overlap”.

scales : 1d array of int

All the scales included in the reconstruction. Discrete scales are admissible.

pod_fcn : function object

Function to solve the eigenvalue problem by taking in a pre-computed cross-correlation matrix. The output must conform to [eigvals, proj_coeffs]. If None, the built-in solver pod_eigendecomp is used.

reflect : False, bool, optional

If true, the corr_mat is padded symmetrically along both axes and is truncated after reconstruction and before eigenvalue decomposition. Such measure helps reducing the effect of uneven boundaries in the wavelet transform process.

reflected : False, bool, optional

If true, the supplied corr_mat has already been padded and is truncated before fed into the eigenvalue solver.

Returns:
eigvals : 1d array

Eigenvalues from the decomposition

proj_coeffs : ndarray

Projection coefficients (temporal modes) of the shape of NxN

K : ndarray

Reconstructed cross-correlation matrix within the designed bandpasses.

Other Parameters:
 
**kwargs :

Keyword arguments from WaveletTransform necessary to perform a wavelet transform.

mrpod.modal_decomposition.ortho_check(v1, v2)

Check the orthogonality of two vectors.

mrpod.modal_decomposition.pod_eigendecomp(corr_mat, tol=1e-14)

Solving the eigenvalue problem of AX=Lambda.

Parameters:
corr_mat : ndarray

Cross-correlation matrix with a dimension of NxN.

Returns:
eigvals : 1d array

Eigenvalues from the decomposition.

proj_coeffs: ndarray

Projection coefficients (temporal modes) of the shape of NxN.

mrpod.modal_decomposition.pod_modes(data_array, pod_fcn=None, eigvals=None, proj_coeffs=None, num_of_modes=None, normalize_mode=True)

Calculate the POD modes based on the eigenvalue decomposition.

Parameters:
data_array : ndarray

Data array arranged in a dimension of NxM0xM1x…, such as a time series (N) of multi- dimensional scalar/vector fields.

pod_fcn : function object

Function to solve the eigenvalue problem by taking in a pre-computed cross-correlation matrix. The output must conform to [eigvals, proj_coeffs]. If None, the built-in solver pod_eigendecomp is used.

eigvals : 1d array

Eigenvalues from the decomposition.

proj_coeffs: ndarray

Projection coefficients (temporal modes) of the shape of NxN.

num_of_modes : None, int, optional

Number of modes to be computed (from the most energetic Mode 1). By default, all the valid modes are computed.

normalize_mode : True, bool, optional

If True, the magnitudes of the modes will be normalized by their corresponding eingenvalues and the sample size.

Returns:
dict

A dictionary containing the eigenvalues, projection coefficients, POD modes, and the cross- correlation matrix.