PSpec_Distance¶
- class turbustat.statistics.PSpec_Distance(data1, data2, weights1=None, weights2=None, breaks=None, low_cut=None, high_cut=<Quantity 0.5 1 / pix>, pspec_kwargs={}, pspec2_kwargs=None)[source]¶
Bases:
object
Distance metric for the spatial power spectrum. A linear model with an interaction term is fit to the powerlaws. The distance is the t-statistic of the interaction term.
- Parameters:
- data1numpy.ndarray or astropy.io.fits.PrimaryHDU or astropy.io.fits.ImageHDU or spectral_cube.Projection or spectral_cube.Slice or
PowerSpectrum
Data with an associated header. Or a
PowerSpectrum
class which may be pre-computed.- data2numpy.ndarray or astropy.io.fits.PrimaryHDU or astropy.io.fits.ImageHDU or spectral_cube.Projection or spectral_cube.Slice or
PowerSpectrum
See
data1
.- weights1numpy.ndarray or astropy.io.fits.PrimaryHDU or astropy.io.fits.ImageHDU or spectral_cube.Projection or spectral_cube.Slice, optional
Weights to apply to data1
- weights2numpy.ndarray or astropy.io.fits.PrimaryHDU or astropy.io.fits.ImageHDU or spectral_cube.Projection or spectral_cube.Slice, optional
Weights to apply to data2
- 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_kwargsdict, optional
Passed to
radial_pspec_kwargs
inrun
.- pspec2_kwargsdict or None, optional
Passed to
radial_pspec_kwargs
inrun
fordata2
. WhenNone
is given, setting frompspec_kwargs
are used fordata2
.
- data1numpy.ndarray or astropy.io.fits.PrimaryHDU or astropy.io.fits.ImageHDU or spectral_cube.Projection or spectral_cube.Slice or
Methods Summary
distance_metric
([verbose, xunit, save_name, ...])Implements the distance metric for 2 Power Spectrum transforms.
Methods Documentation
- distance_metric(verbose=False, xunit=Unit('1 / pix'), save_name=None, plot_kwargs1={}, plot_kwargs2={}, use_wavenumber=False)[source]¶
Implements the distance metric for 2 Power Spectrum transforms. We fit the linear portion of the transform to represent the powerlaw A linear model with an interaction term is fit to the two powerlaws. The distance is the t-statistic of the interaction.
- Parameters:
- verbosebool, optional
Enables plotting.
- xunit
Unit
, optional Unit of the x-axis in the plot in pixel, angular, or physical units.
- save_namestr, optional
Name of the save file. Enables saving the figure.
- plot_kwargs1dict, optional
Pass kwargs to
plot_fit
fordata1
.- plot_kwargs2dict, optional
Pass kwargs to
plot_fit
fordata2
.- use_wavenumberbool, optional
Plot the x-axis as the wavenumber rather than spatial frequency.