glass.harmonics — Spherical harmonics utilities

This module contains utilities for working with spherical harmonics which are used by GLASS, but are otherwise unrelated to GLASS functionality.

This module should be imported manually if used outside of GLASS:

import glass.harmonics

General

glass.harmonics.multalm(alm, bl)[source]

Multiply alm by bl.

The alm should be ordered by increasing m within each m block:

[
    00, 10, 20, 30,
    11, 21, 31,
    22, 32,
    33
    ...
]
Parameters:
  • alm (Any) – The alm to multiply.

  • bl (Any) – The bl to multiply.

Returns:

The product of alm and bl.

Return type:

Any

glass.harmonics.inverse_transform(alm, *, lmax, nside, pixwin=False, pol=True, spin=0)[source]

Compute the inverse spherical harmonic transform of alm.

Convert HEALPix harmonic coefficients into a map without pixel-window smoothing. For non-zero spin, alm contains E modes and B modes are set to zero.

Parameters:
  • alm (Any) – The spherical harmonic coefficients to transform.

  • lmax (int) – The maximum multipole of the spherical harmonic transform.

  • nside (int) – The nside parameter of the output map.

  • pixwin (bool) – Whether to apply the pixel window function. Has no effect for non-zero spin.

  • pol (bool) – Whether to compute polarization. Has no effect for non-zero spin.

  • spin (int) – Spin of the output map. Zero produces a real scalar map; non-zero spin produces a complex map whose real and imaginary parts are the two spin components.

Returns:

The map resulting from the inverse spherical harmonic transform.

Return type:

Any

glass.harmonics.transform(maps, *, lmax, pol=True, use_pixel_weights=False)[source]

Compute the spherical harmonic transform of a map.

Parameters:
  • maps (Any) – The real-space map to transform.

  • lmax (int) – The maximum multipole of the spherical harmonic transform.

  • pol (bool) – Whether to compute polarization.

  • use_pixel_weights (bool) – Whether to use pixel weights in the transform.

Returns:

The spherical harmonic coefficients resulting from the transform.

Return type:

Any