DeltaVariance_Distance

class turbustat.statistics.DeltaVariance_Distance(dataset1, dataset2, weights1=None, weights2=None, diam_ratio=1.5, lags=None, use_common_lags=True, delvar_kwargs={}, delvar2_kwargs=None)[source] [edit on github]

Bases: object

Compares 2 datasets using delta-variance. The distance between them is given by the Euclidean distance between the curves weighted by the bootstrapped errors.

Note

When passing a computed DeltaVariance class for dataset1 or dataset2, it may be necessary to recompute the delta-variance if use_common_lags=True and the existing lags do not match the common lags.

Parameters:
dataset1 : numpy.ndarray or astropy.io.fits.PrimaryHDU or astropy.io.fits.ImageHDU or spectral_cube.Projection or spectral_cube.Slice or DeltaVariance class

Contains the data and header for one dataset. Or pass a DeltaVariance class that may be pre-computed.

dataset2 : numpy.ndarray or astropy.io.fits.PrimaryHDU or astropy.io.fits.ImageHDU or spectral_cube.Projection or spectral_cube.Slice or DeltaVariance class

See dataset1 above.

weights1 : numpy.ndarray or astropy.io.fits.PrimaryHDU or astropy.io.fits.ImageHDU or spectral_cube.Projection or spectral_cube.Slice

Weights for dataset1.

weights2 : numpy.ndarray or astropy.io.fits.PrimaryHDU or astropy.io.fits.ImageHDU or spectral_cube.Projection or spectral_cube.Slice

See above.

diam_ratio : float, optional

The ratio between the kernel sizes.

lags : numpy.ndarray or list, optional

The pixel scales to compute the delta-variance at.

lags2 : numpy.ndarray or list, optional

The pixel scales for the delta-variance of dataset2. Ignored if use_common_lags=True.

use_common_lags : bool, optional

Use a set of common lags that have the same angular sizes for both datasets. This is required for DeltaVariance_Distance.curve_distance metric.

delvar_kwargs : dict, optional

Pass kwargs to run.

delvar2_kwargs : dict, optional

Pass kwargs to run for dataset2. When None is given, the kwargs in delvar_kwargs are used for both datasets.

Attributes Summary

curve_distance The L2 norm between the delta-variance curves.
slope_distance The t-statistic of the difference in the delta-variance slopes.

Methods Summary

distance_metric(self[, verbose, xunit, …]) Applies the Euclidean distance to the delta-variance curves.

Attributes Documentation

curve_distance

The L2 norm between the delta-variance curves.

slope_distance

The t-statistic of the difference in the delta-variance slopes.

Methods Documentation

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

Applies the Euclidean distance to the delta-variance curves.

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 dataset1.

plot_kwargs2 : dict, optional

Pass kwargs to plot_fit for dataset2.