BiSpectrum

class turbustat.statistics.BiSpectrum(img)[source] [edit on github]

Bases: turbustat.statistics.base_statistic.BaseStatisticMixIn

Computes the bispectrum (three-point correlation function) of the given image (Burkhart et al., 2010). The bispectrum and the bicoherence are returned. The bicoherence is a normalized version (real and to unity) of the bispectrum.

Parameters:

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

2D image.

Attributes Summary

bicoherence Bicoherence array.
bispectrum Bispectrum array.
bispectrum_amp log amplitudes of the bispectrum.
tracker Array showing the number of samples in each k_1 k_2 bin.

Methods Summary

compute_bispectrum([nsamples, seed, ...]) Do the computation.
run([nsamples, seed, mean_subtract, ...]) Compute the bispectrum.

Attributes Documentation

bicoherence

Bicoherence array.

bispectrum

Bispectrum array.

bispectrum_amp

log amplitudes of the bispectrum.

tracker

Array showing the number of samples in each k_1 k_2 bin.

Methods Documentation

compute_bispectrum(nsamples=100, seed=1000, mean_subtract=False)[source] [edit on github]

Do the computation.

Parameters:

nsamples : int, optional

Sets the number of samples to take at each vector magnitude.

seed : int, optional

Sets the seed for the distribution draws.

mean_subtract : bool, optional

Subtract the mean from the data before computing. This removes the “zero frequency” (i.e., constant) portion of the power, resulting in a loss of phase coherence along the k_1=k_2 line.

run(nsamples=100, seed=1000, mean_subtract=False, verbose=False, save_name=None)[source] [edit on github]

Compute the bispectrum. Necessary to maintain package standards.

Parameters:

nsamples : int, optional

seed : int, optional

mean_subtract : bool, optional

verbose : bool, optional

Enables plotting.

save_name : str,optional

Save the figure when a file name is given.