Skip to main content
Glama

measure_cmb_power_spectrum

Compute binned CMB TT, EE, TE, or BB power spectra from a HEALPix map and mask for custom Planck-map analysis, with optional cross-spectrum handling to reduce noise bias.

Instructions

Measure the CMB TT (optionally EE/TE/BB) power spectrum FROM A MAP (from map to power spectrum).

Use this for your own spectrum from Planck maps (instead of the released bandpowers).
Pseudo-C_ell via healpy anafast of the (apodised) masked map, divided by fsky = <w^2>,
the Gaussian beam^2 and the HEALPix pixel window^2; monopole/dipole removed. Binned in
Delta-ell = 30 bins like the PLA TT file; errors are Knox cosmic-variance only (no noise
term). Auto-spectra carry noise bias (SMICA: noticeable above ell ~ 1000), so pass the
hm1/hm2 pair for a cross-spectrum. Heavy, dispatchable (set_dispatch). Sanity: first
peak at ell ~ 220 with D_ell ~ 5700-5800 muK^2; within a few % of Planck TT at 30<ell<1500.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "output_dir": "<output_dir>",
      "map_file": "<map_file>",
      "mask_file": "<mask_file>"
    },
    "name": "measure_cmb_power_spectrum"
  }
}

Input Schema

NameRequiredDescriptionDefault
lmaxNoMax multipole (<= 2*nside is safe).
methodNoanafast pseudo-C_ell / fsky (default) or pymaster MASTER if installed.anafast
apod_degNoMask apodisation FWHM [deg] (0 = binary).
map_fileYesHEALPix map FITS from fetch_cmb_map (muK).
bin_widthNoBin width (30 = PLA TT binning).
map_file2NoOptional second map with independent noise (hm2 when map_file is hm1) -> cross-spectrum without noise bias. Recommended for ell > 1000.
mask_fileYesMask FITS from fetch_cmb_map.
output_dirYesDirectory for the binned CSV / npz / JSON.
polarizationNoAlso EE/BB/TE (needs an I/Q/U map).
beam_fwhm_arcminNoGaussian beam FWHM of the map (Planck PR3 SMICA/Commander: 5).

Output Schema

NameRequiredDescriptionDefault
filesYes
statusYes
messageYes
metadataYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations present, the description carries the full burden and does so thoroughly: it spells out the anafast/MASTER pipeline, fsky, beam and pixel-window corrections, monopole/dipole removal, binning, and the Knox-only error model with no noise term. It also flags the noise-bias caveat above ell~1000, the "Heavy, dispatchable (set_dispatch)" cost, and sanity-check values the agent can validate against.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded in the first sentence, followed by usage routing, then mechanics, caveats, and sanity checks in a logical order. It is dense with notation, and the repeated "FROM A MAP (from map to power spectrum)" phrasing is wasted, but nearly every other clause carries real information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists, so return format need not be described, and the description instead covers what the schema cannot: algorithmic behavior, error model, cost, and validation thresholds. For a 10-parameter, compute-heavy measurement tool this leaves nothing an agent needs missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds cross-parameter meaning the schema does not: how map_file/map_file2/mask_file combine into an apodised masked pseudo-C_ell, why the file pair removes noise bias, and what Delta-ell=30 corresponds to. The remaining parameters (lmax, method, polarization) are left to their schema text.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Measure the CMB TT (optionally EE/TE/BB) power spectrum FROM A MAP" names a specific verb, a specific resource, and the required input class, which distinguishes it from the released-bandpower sibling. The parenthetical is redundant but the scope statement is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

"Use this for your own spectrum from Planck maps (instead of the released bandpowers)" gives a clear condition and points at the alternative conceptually, and the hm1/hm2 guidance tells the agent when to supply a second map. It stops short of naming the specific released-bandpower tool, so routing is slightly inferential.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.