Genus

class turbustat.statistics.Genus(img, lowdens_percent=0, highdens_percent=100, numpts=100, smoothing_radii=None)[source] [edit on github]

Bases: turbustat.statistics.base_statistic.BaseStatisticMixIn

Genus Statistics based off of Chepurnov et al. (2008).

Parameters:

img : numpy.ndarray or astropy.io.fits.PrimaryHDU or spectral_cube.LowerDimensionalObject

2D image.

lowdens_percent : float, optional

Lower percentile of the data to use.

highdens_percent : float, optional

Upper percentile of the data to use.

numpts : int, optional

Number of thresholds to calculate statistic at.

smoothing_radii : list, optional

Kernel radii to smooth data to.

Attributes Summary

genus_stats Array of genus statistic values for all smoothed images (0th axis) and all threshold values (1st axis).
smoothed_images List of smoothed versions of the image, using the radii in smoothing_radii.
smoothing_radii Pixel radii used to smooth the data.
thresholds Values of the data to compute the Genus statistics at.

Methods Summary

make_genus_curve([use_beam, beam_area, ...]) Create the genus curve from the smoothed_images at the specified thresholds.
make_smooth_arrays(**kwargs) Smooth data using a Gaussian kernel.
run([verbose, save_name, use_beam, ...]) Run the whole statistic.

Attributes Documentation

genus_stats

Array of genus statistic values for all smoothed images (0th axis) and all threshold values (1st axis).

smoothed_images

List of smoothed versions of the image, using the radii in smoothing_radii.

smoothing_radii

Pixel radii used to smooth the data.

thresholds

Values of the data to compute the Genus statistics at.

Methods Documentation

make_genus_curve(use_beam=False, beam_area=None, min_size=4, connectivity=1)[source] [edit on github]

Create the genus curve from the smoothed_images at the specified thresholds.

Parameters:

use_beam : bool, optional

When enabled, will use the given beam_fwhm or try to load it from the header. When disabled, the minimum size is set by min_size.

beam_area : Quantity, optional

The angular area of the beam size. Requires a header to be given.

min_size : int, optional

Directly specify the number of pixels to be used as the minimum area a region must have to be counted.

connectivity : {1, 2}, optional

Connectivity used when removing regions below min_size.

make_smooth_arrays(**kwargs)[source] [edit on github]

Smooth data using a Gaussian kernel. NaN interpolation during convolution is automatically used when the data contains any NaNs.

Parameters:kwargs: Passed to `~astropy.convolve.convolve_fft`.
run(verbose=False, save_name=None, use_beam=False, beam_area=None, min_size=4, **kwargs)[source] [edit on github]

Run the whole statistic.

Parameters:

verbose : bool, optional

Enables plotting.

save_name : str,optional

Save the figure when a file name is given.

use_beam : bool, optional

beam_area : Quantity, optional

min_size : int, optional

kwargs : See make_smooth_arrays.