PCA_Distance

class turbustat.statistics.PCA_Distance(cube1, cube2, n_eigs=50, fiducial_model=None, mean_sub=True)[source]

Bases: object

Compare two data cubes based on the eigenvalues of the PCA decomposition. The distance is the Euclidean distance between the eigenvalues.

Parameters
cube1numpy.ndarray or astropy.io.fits.PrimaryHDU or astropy.io.fits.ImageHDU or SpectralCube or PCA

Data cube. Or a PCA class can be given which may be pre-computed.

cube2numpy.ndarray or astropy.io.fits.PrimaryHDU or astropy.io.fits.ImageHDU or SpectralCube or PCA

Data cube. Or a PCA class can be given which may be pre-computed.

n_eigsint

Number of eigenvalues to compute.

fiducial_modelPCA

Computed PCA object. Use to avoid recomputing.

mean_subbool, optional

Subtracts the mean before computing the covariance matrix. Not subtracting the mean is done in the original Heyer & Brunt works.

Methods Summary

distance_metric([verbose, save_name, …])

Computes the distance between the cubes.

Methods Documentation

distance_metric(verbose=False, save_name=None, plot_kwargs1={}, plot_kwargs2={}, cmap='viridis')[source]

Computes the distance between the cubes.

Parameters
verbosebool, optional

Enables plotting.

save_namestr, optional

Save the figure when a file name is given.

plot_kwargs1dict, optional

Set the color, symbol, and label for dataset1 (e.g., plot_kwargs1={‘color’: ‘b’, ‘symbol’: ‘D’, ‘label’: ‘1’}).

plot_kwargs2dict, optional

Set the color, symbol, and label for dataset2.

cmapstr, optional

The colormap to use when plotting the covariance matrices.