StatMoments

class turbustat.statistics.StatMoments(img, weights=None, radius=5, periodic=True, nbins=None)[source] [edit on github]

Bases: turbustat.statistics.base_statistic.BaseStatisticMixIn

Statistical Moments of a given image are returned. See Burkhart et al. (2010) for methods used.

Parameters:

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

2D Image.

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

2D array of weights. Uniform weights are used if none are given.

radius : int, optional

Radius of circle to use when computing moments.

periodic : bool, optional

If the data is periodic (ie. from asimulation), wrap the data.

nbins : array or int, optional

Number of bins to use in the histogram.

Attributes Summary

kurtosis_extrema
mean_extrema
skewness_extrema
variance_extrema

Methods Summary

array_moments() Moments over the entire image.
compute_spatial_distrib() Compute the moments over circular region with the specified radius.
make_spatial_histograms([mean_bins, ...]) Create histograms of the moments.
run([verbose, save_name]) Compute the entire method.

Attributes Documentation

kurtosis_extrema
mean_extrema
skewness_extrema
variance_extrema

Methods Documentation

array_moments()[source] [edit on github]

Moments over the entire image.

compute_spatial_distrib()[source] [edit on github]

Compute the moments over circular region with the specified radius.

make_spatial_histograms(mean_bins=None, variance_bins=None, skewness_bins=None, kurtosis_bins=None)[source] [edit on github]

Create histograms of the moments.

Parameters:

mean_bins : array, optional

Bins to use for the histogram of the mean array

variance_bins : array, optional

Bins to use for the histogram of the variance array

skewness_bins : array, optional

Bins to use for the histogram of the skewness array

kurtosis_bins : array, optional

Bins to use for the histogram of the kurtosis array

run(verbose=False, save_name=None, **kwargs)[source] [edit on github]

Compute the entire method.

Parameters:

verbose : bool, optional

Enables plotting.

save_name : str,optional

Save the figure when a file name is given.

kwargs : Passed to make_spatial_histograms.