foscat.alm_loc#

Classes#

alm_loc

Local/partial-sky variant of foscat.alm.alm.

Module Contents#

class foscat.alm_loc.alm_loc(backend=None, lmax=24, limit_range=10000000000.0)[source]#

Bases: foscat.alm.alm

Local/partial-sky variant of foscat.alm.alm.

Key design choice (to match alm.py exactly when full-sky is provided): - Reuse all Legendre/normalization machinery from the parent class (alm),

i.e. shift_ph(), compute_legendre_m(), ratio_mm, A/B recurrences, etc. This is critical for matching alm.map2alm() numerically.

Differences vs alm.map2alm(): - Input map is […, n] with explicit (nside, cell_ids) - Only rings touched by cell_ids are processed. - For rings with full coverage, we run the exact same FFT+tiling logic as alm.comp_tf()

(but only for those rings) -> bitwise comparable up to backend FFT differences.

  • For rings with partial coverage, we compute a partial DFT for m=0..mmax, using the same phase convention as alm.comp_tf():

    FFT kernel uses exp(-i 2pi (m mod Nring) j / Nring) then apply the per-ring shift exp(-i m phi0) via self.matrix_shift_ph

comp_tf_loc(im, nside: int, cell_ids, nest: bool = False, realfft: bool = True, mmax=None)[source]#
Returns:

rings_used: 1D np.ndarray of ring indices present ft: backend tensor of shape […, nrings_used, mmax+1] (complex)

where last axis is m, ring axis matches rings_used order.

map2alm_loc(im, nside: int, cell_ids, nest: bool = False, lmax=None)[source]#
anafast_loc(im, nside: int, cell_ids, nest: bool = False, lmax=None)[source]#