VCA_Distance

class turbustat.statistics.VCA_Distance(cube1, cube2, channel_width=None, breaks=None, low_cut=None, high_cut=None, radial_pspec_kwargs={}, radial_pspec_kwargs2=None)[source] [edit on github]

Bases: object

Calculate the distance between two cubes using VCA. The 1D power spectrum is modeled by a linear model. The distance is the t-statistic of the interaction between the two slopes.

Note

When a pre-computed VCA class is given for cube1 or cube2, if the channel widths are not equal to channel_width given to VCA_Distance, a ValueError will be raised.

Parameters:
cube1 : numpy.ndarray or astropy.io.fits.PrimaryHDU or astropy.io.fits.ImageHDU or SpectralCube or VCA

Data cube. Or a VCA class can be passed which may be pre-computed.

cube2 : numpy.ndarray or astropy.io.fits.PrimaryHDU or astropy.io.fits.ImageHDU or SpectralCube or VCA

See cube1.

channel_width : Quantity, optional

Spectral resolution to degrade the cube to.

breaks : Quantity, list or array, optional

Specify where the break point is with appropriate units. If none is given, no break point will be used in the fit.

low_cut : Quantity or np.ndarray, optional

The lower frequency fitting limit. An array with 2 elements can be passed to give separate lower limits for the datasets.

high_cut : Quantity or np.ndarray, optional

The upper frequency fitting limit. See low_cut above. Defaults to 0.5.

pspec_kwargs : dict, optional

Passed to radial_pspec_kwargs in run.

pspec2_kwargs : dict or None, optional

Passed to radial_pspec_kwargs in run for cube2. When None is given, setting from pspec_kwargs are used for cube2.

phys_distance : Quantity, optional

Physical distance to the region in the data.

Methods Summary

distance_metric(self[, verbose, xunit, …]) Implements the distance metric for 2 VCA transforms, each with the same channel width.

Methods Documentation

distance_metric(self, verbose=False, xunit=Unit("1 / pix"), save_name=None, plot_kwargs1={}, plot_kwargs2={}, use_wavenumber=False)[source] [edit on github]

Implements the distance metric for 2 VCA transforms, each with the same channel width. We fit the linear portion of the transform to represent the powerlaw.

Parameters:
verbose : bool, optional

Enables plotting.

xunit : Unit, optional

Unit of the x-axis in the plot in pixel, angular, or physical units.

save_name : str, optional

Name of the save file. Enables saving the figure.

plot_kwargs1 : dict, optional

Pass kwargs to plot_fit for data1.

plot_kwargs2 : dict, optional

Pass kwargs to plot_fit for data2.

use_wavenumber : bool, optional

Plot the x-axis as the wavenumber rather than spatial frequency.