glass.healpix — Array API compatible HEALPix functions¶
This module contains functions for working with HEALPix maps in an Array API compliant manner used with GLASS.
This module should be imported manually if used outside of GLASS:
import glass.healpix as hp
healpix Functions¶
- glass.healpix.ang2pix(nside, theta, phi, *, lonlat=False)[source]¶
Converts the angle to HEALPix pixel numbers.
- Parameters:
- Returns:
The HEALPix pixel numbers.
- Return type:
- glass.healpix.ang2vec(theta, phi, *, lonlat=False)[source]¶
Convert angles to 3D position vector.
- Parameters:
- Returns:
A normalised 3-vector pointing in the same direction as
ang.- Return type:
- glass.healpix.randang(nside, ipix, *, lonlat=False)[source]¶
Sample random spherical coordinates from the given HEALPix pixels.
rngis no longer a parameter as we must use the NumPy backend otherwise we run into aoperand array with iterator write flag set is read-onlyerror coming from_chp.ring2ang_uv(nside, ipix, u, v, u, v).
healpy Functions¶
- glass.healpix.alm2map(alms, nside, *, lmax=None, pixwin=False, pol=True)[source]¶
Computes a HEALPix map given the alm.
- Parameters:
- Returns:
A HEALPix map in RING scheme at nside, or a two-dimensional array containing the T, Q, and U maps for polarized input.
- Return type:
- glass.healpix.alm2map_spin(alms, nside, spin, lmax)[source]¶
Computes maps from a set of 2 spinned alm.
- glass.healpix.almxfl(alm, fl)[source]¶
Multiply alm by a function of l. The function is assumed to be zero where not defined.
- glass.healpix.map2alm(maps, *, lmax=None, pol=True, use_pixel_weights=False)[source]¶
Computes the alm of a HEALPix map. The input maps must all be in ring ordering.
If you are running in an offline environment, you must provide a datapath to local healpy datafiles. To download these files:
git clone –depth 1 https://github.com/healpy/healpy-data cd healpy-data bash download_weights_8192.sh
and set datapath to the root of the repository. If this method is used, the only supported values of nside are 2^n for n in the range 5-13.
- Parameters:
maps (
Union[Any,Sequence[Any]]) – The input map or a list of n input maps. Must be in ring ordering.pol (
bool) – If True, assumes input maps are TQU. If False, only the temperature map is considered.use_pixel_weights (
bool) – If True, use pixel by pixel weighting, healpy will automatically download the weights, if needed.
- Returns:
alm or a tuple of 3 alm (almT, almE, almB) if polarized input.
- Return type:
- glass.healpix.pixwin(nside, *, lmax=None, pol=False, xp=None)[source]¶
Return the pixel window function for the given nside.
If you are running in an offline environment, you must provide a datapath to local healpy datafiles. To download these files:
git clone –depth 1 https://github.com/healpy/healpy-data cd healpy-data bash download_weights_8192.sh
and set datapath to the root of the repository. If this method is used, the only supported values of nside are 2^n for n in the range 5-13.
- Parameters:
- Returns:
The temperature pixel window function.
- Return type: