healpy.sphtfunc.anafast¶
- healpy.sphtfunc.anafast(map1, map2=None, nspec=None, lmax=None, mmax=None, iter=3, alm=False, pol=True, use_weights=False, datapath=None, gal_cut=0, use_pixel_weights=False)¶
Computes the power spectrum of a Healpix map, or the cross-spectrum between two maps if map2 is given. No removal of monopole or dipole is performed. The input maps must be in ring-ordering. Spherical harmonics transforms in HEALPix are always on the full sky, if the map is masked, those pixels are set to 0. It is recommended to remove monopole from the map before running anafast to reduce boundary effects.
For recommendations about how to set lmax, iter, and weights, see the Anafast documentation
- Parameters:
- map1float, array-like shape (Npix,) or (3, Npix)
Either an array representing a map, or a sequence of 3 arrays representing I, Q, U maps. Must be in ring ordering.
- map2float, array-like shape (Npix,) or (3, Npix)
Either an array representing a map, or a sequence of 3 arrays representing I, Q, U maps. Must be in ring ordering.
- nspecNone or int, optional
The number of spectra to return. If None, returns all, otherwise returns cls[:nspec]
- lmaxint, scalar, optional
Maximum l of the power spectrum (default: 3*nside-1)
- mmaxint, scalar, optional
Maximum m of the alm (default: lmax)
- iterint, scalar, optional
Number of iteration (default: 3)
- almbool, scalar, optional
If True, returns both cl and alm, otherwise only cl is returned
- polbool, optional
If True, assumes input maps are TQU. Output will be TEB cl’s and correlations (input must be 1 or 3 maps). If False, maps are assumed to be described by spin 0 spherical harmonics. (input can be any number of maps) If there is only one input map, it has no effect. Default: True.
- datapathNone or str, optional
If given, the directory where to find the weights data. See the docstring of map2alm for details on how to set it up
- gal_cutfloat [degrees]
pixels at latitude in [-gal_cut;+gal_cut] are not taken into account
- use_pixel_weights: bool, optional
If True, use pixel by pixel weighting, healpy will automatically download the weights, if needed See the map2alm docs for details about weighting
- Returns:
- resarray or sequence of arrays
If alm is False, returns cl or a list of cl’s (TT, EE, BB, TE, EB, TB for polarized input map) Otherwise, returns a tuple (cl, alm), where cl is as above and alm is the spherical harmonic transform or a list of almT, almE, almB for polarized input