Genus Distance¶
See the tutorial for a description of Genus statistics.
The distance metric for Genus is Genus_Distance
. The distance between the Genus curves is defined as:
where \(G_{j}\left(I_{0, i}\right)\) are the Genus curves, and \(A_{j}\) is the total area each Genus curve is measured over to normalize comparisons of images of different sizes.
More information on the distance metric definitions can be found in Koch et al. 2017
Using¶
The data in this tutorial are available here.
We need to import the Genus_Distance
class, along with a few other common packages:
>>> from turbustat.statistics import Genus_Distance
>>> from astropy.io import fits
>>> import astropy.units as u
>>> import numpy as np
And we load in the two data sets; in this case, two integrated intensity (zeroth moment) maps:
>>> moment0 = fits.open("Design4_flatrho_0021_00_radmc_moment0.fits")[0]
>>> moment0_fid = fits.open("Fiducial0_flatrho_0021_00_radmc_moment0.fits")[0]
The two images are passed to the Genus_Distance
class:
>>> genus = Genus_Distance(moment0_fid, moment0,
... lowdens_percent=15, highdens_percent=85, numpts=100,
... genus_kwargs=dict(min_size=4 * u.pix**2))
Genus_Distance
accepts similar keyword arguments to Genus
. Keywords to run
can be specified in a dictionary to genus_kwargs
. Separate keywords for the second image (moment0
) can be specified in a second dictionary to genus2_kwargs
.
To find the distance between the images:
>>> genus.distance_metric(verbose=True)

This returns a figure that plots the Genus curves of the two images, where the image values are standardized (zero mean and standard deviation of one). Colours, labels, and symbols in the plot can be changed. See distance_metric
.
When comparing many images to a fiducial image, a pre-computed Genus
can be passed instead of a dataset. See the distance metric introduction.