| name | namaster |
| description | Guide to NaMaster (pymaster), the DESC pseudo-Cl angular power spectrum estimator. Use this skill whenever the user imports pymaster; works with NmtField, NmtBin, NmtWorkspace, or NmtCovarianceWorkspace; calls compute_full_master, compute_coupled_cell, decouple_cell, or mask_apodization; computes pseudo-Cl power spectra for spin-0 or spin-2 (shear) fields; handles masks, mode-coupling matrices, or workspace serialization; asks about bandpower binning, EE/BB/EB spectrum ordering, or apodization; writes TXPipe Fourier-space stages (TXTwoPointFourier, TXFourierNamasterCovariance); or needs Gaussian covariance estimates. |
NaMaster — pseudo-Cl power spectra for masked fields
You're helping a user write code with NaMaster (pymaster), DESC's pseudo-Cl angular power spectrum estimator (Alonso et al. 2019).
NaMaster is the Fourier-space workhorse of TXPipe: TXTwoPointFourier and its subclasses use it for all 3×2pt Cl measurements, and TXFourierNamasterCovariance uses it for Gaussian covariance estimation.
Overview
Four core objects (import as import pymaster as nmt):
| Object | Role |
|---|
NmtField | Wraps maps + mask + optional beam/templates |
NmtBin | Defines ell bandpower binning |
NmtWorkspace | Stores mode-coupling matrix; used to decouple pseudo-Cls |
NmtCovarianceWorkspace | Stores coupling coefficients for Gaussian covariance |
Minimal workflow:
import pymaster as nmt
import healpy as hp
nside = 512
mask = hp.read_map("mask.fits")
mask = nmt.mask_apodization(mask, aposize=1.0, apotype="Smooth")
f0 = nmt.NmtField(mask, [delta_map], n_iter=0)
f2 = nmt.NmtField(mask, [g1, g2], n_iter=0, lmax=lmax)
b = nmt.NmtBin.from_nside_linear(nside, nlb=40)
w = nmt.NmtWorkspace.from_fields(f0, f0, b)
w.write_to("workspace.fits")
cl = nmt.compute_full_master(f0, f0, b)
pcl = nmt.compute_coupled_cell(f0, f0)
cl = w.decouple_cell(pcl)
Spin-2 output ordering — cross-correlating two spin-2 fields returns 4 spectra: [EE, EB, BE, BB] at indices 0–3.
Shear×density returns [E, B].
See references/api.md for detailed parameter tables and gotchas.
TXPipe usage
NaMaster is TXPipe's Fourier-space workhorse: TXTwoPointFourier, TXTwoPointFourierCatalog, TXFourierNamasterCovariance, and the CMB lensing cross-spectrum stage all use it.
See references/txpipe.md for stage details, workspace management, noise estimation, the choose_ell_bins helper, and the flip_g2 sign convention.
Reference