Genus_Distance

class turbustat.statistics.Genus_Distance(img1, img2, smoothing_radii=None, numpts=100, min_value=None, max_value=None, lowdens_percent=0, highdens_percent=100, genus_kwargs={}, genus2_kwargs=None)[source] [edit on github]

Bases: object

Distance Metric for the Genus Statistic.

Note

Since the data need to be normalized for the distance metrics, there is no option to pass a pre-compute Genus statistic.

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

2D image.

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

2D image.

smoothing_radii : list, optional

Kernel radii to smooth data to. See Genus.

numpts : int, optional

Number of thresholds to calculate statistic at. See Genus.

min_value : Quantity or float or list, optional

Minimum value to use for Genus statistic. When a two-element list is given, the first item is used for img1 and the second for img2. See Genus.

max_value : Quantity or float, optional

Maximum value to use for Genus statistic. When a two-element list is given, the first item is used for img1 and the second for img2. See Genus.

lowdens_percent : float, optional

Lowest percentile of the data to use for Genus statistic. When a two-element list is given, the first item is used for img1 and the second for img2. See Genus.

highdens_percent : float, optional

Highest percentile of the data to use for Genus statistic. When a two-element list is given, the first item is used for img1 and the second for img2. See Genus.

genus_kwargs : dict, optional

Dictionary passed to run.

genus2_kwargs : None or dict, optional

Dictionary passed to run for img2. When None is given, settings from genus_kwargs are used for img2.

Methods Summary

distance_metric(self[, verbose, label1, …]) Data is centered and normalized (via normalize).

Methods Documentation

distance_metric(self, verbose=False, label1=None, label2=None, save_name=None, color1='b', color2='g', marker1='D', marker2='o')[source] [edit on github]

Data is centered and normalized (via normalize). The distance is the difference between cubic splines of the curves.

All values are normalized by the area of the image they were calculated from.

Parameters:
verbose : bool, optional

Enables plotting.

label1 : str, optional

Object or region name for img1

label2 : str, optional

Object or region name for img2

save_name : str,optional

Save the figure when a file name is given.