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 forcube1
orcube2
, if the channel widths are not equal tochannel_width
given toVCA_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
inrun
.- pspec2_kwargs : dict or None, optional
Passed to
radial_pspec_kwargs
inrun
forcube2
. WhenNone
is given, setting frompspec_kwargs
are used forcube2
.- 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
fordata1
.- plot_kwargs2 : dict, optional
Pass kwargs to
plot_fit
fordata2
.- use_wavenumber : bool, optional
Plot the x-axis as the wavenumber rather than spatial frequency.
- cube1 : numpy.ndarray or astropy.io.fits.PrimaryHDU or astropy.io.fits.ImageHDU or SpectralCube or