Skip to content

docs: ADR-0019 — the bandpower shape function lives in the binning operator#52

Merged
ggalloni merged 3 commits into
masterfrom
docs/adr-0019-bandpower-shape
Jul 14, 2026
Merged

docs: ADR-0019 — the bandpower shape function lives in the binning operator#52
ggalloni merged 3 commits into
masterfrom
docs/adr-0019-bandpower-shape

Conversation

@ggalloni

Copy link
Copy Markdown
Owner

What changed

Records ADR-0019 — the bandpower shape function lives in the binning operator
and adds the three domain terms it separates to CONTEXT.md. Decision only; no code.
The implementation is tracked in three issues (below).

The binning weights w_ℓ in dC^b = Σ_ℓ w_{b,ℓ} b²_ℓ dC^ℓ declare what the spectrum
is assumed to do inside a bin, and the estimator returns the amplitude of that declared
shape. Unit weight is not a neutral choice — it declares C_ℓ flat in the bin. The Dl
path then ignored that declaration: it estimated C_b under the flat-C model and
rescaled by a single ℓ(ℓ+1)/2π evaluated at the bin midpoint. No scalar can do
that job. Once a bin is collapsed to one number the in-bin variation of ℓ(ℓ+1) is
gone, and convexity gives Σ_ℓ w_ℓ·ℓ(ℓ+1) = ℓ_eff(ℓ_eff+1) + Var_w(ℓ) — so any
single-ℓ scalar undershoots the true D-space factor by the weighted variance of ℓ
across the bin (≈5% at delta_ell=5, low ℓ).

The decision is to declare the shape once and delete the conversion rather than
correct it: Dl selects w_ℓ = 2π/(ℓ(ℓ+1)), the estimator returns D_b natively, and
F_b is already the Fisher for D_b. Separately, the effective multipole is the
centroid of the estimator's realised window — QML applies inverse-variance weighting
automatically, so it depends on noise and mask coupling and is knowable only from the
per-ℓ Fisher. It moves to Fisher, where the window lives. Bins keeps bin geometry
and no notion of an effective multipole: bin edges cannot know where a bandpower sits,
and by answering anyway they answered with the midpoint.

Public surface

None in this PR — it adds an ADR (status Proposed) and glossary terms. The public
surface it decides on is breaking and lands in the implementation PRs:
output_convention becomes an estimator setting (Dl will estimate a different
observable, so D_ℓ values, covariance and Fisher all change, and not by a uniform
factor); Bins.lbinBins.lmid; get_effective_ells() moves onto Fisher and will
require a completed Fisher run. Each carries its own changelog entry.

Implementation

Sequenced, and the first is a hard prerequisite — effective ells differ per spectrum,
so TEB cannot be served until the window supports it:

  1. Lift the single-spectrum guard on the bandpower window function
  2. Strip the unused xQML P/Q machinery from Bins; add shape weights; rename lbin to lmid
  3. output_convention: Dl must select a bandpower shape, not a post-hoc scalar

Follow-up, deliberately unspecified: Fiducial-shaped binning operator.

Checklist

  • docs/source/changelog.rst — not applicable; no package source touched, so the
    changelog job does not gate this. The behaviour changes it decides carry their
    entries in the implementation PRs.
  • ADR added — docs/adr/0019-bandpower-shape-function.md, indexed in INDEX.md.
  • CONTEXT.md updated — bandpower shape function, effective multipole and bin
    midpoint
    are now three distinct terms. Collapsing them into one lbin is the
    bug.
  • Doc-drift sweep — no public surface moved in this PR. ADR-0007's rationale cites
    bin_spectra / bin_covariance / Dl weighting as our extensions on top of xQML;
    the Bins cleanup PR deletes those and must amend it (attribution to Vanneste+
    2018 and the GPLv3 obligation stay regardless).
  • Tests — no code changed.

…erator

The binning weights w_l declare what the spectrum is assumed to do inside a
bin; the estimator returns the amplitude of that declared shape. Unit weight
is not neutral — it declares flat C_l — and the Dl path ignored that
declaration, estimating C_b under the flat-C model and then rescaling by a
single l(l+1)/2pi evaluated at the bin midpoint.

No scalar can do that job: once a bin is collapsed the in-bin variation of
l(l+1) is gone, and convexity gives sum_l w_l l(l+1) = l_eff(l_eff+1) +
Var_w(l), so any single-l scalar undershoots by the weighted variance of l.
The decision is to declare the shape once, in the binning operator, and
delete the conversion rather than correct it: Dl selects w_l = 2pi/(l(l+1))
and the estimator returns D_b natively, with F_b already the Fisher for D_b.
output_convention therefore becomes an estimator setting, not a presentation
one.

The effective multipole is the centroid of the estimator's realised window,
which depends on noise and mask coupling and is knowable only from the per-l
Fisher. It moves to Fisher, where the window lives. Bins keeps bin geometry
and no notion of an effective multipole — bin edges cannot know where a
bandpower sits, and by answering anyway they answered with the midpoint.

CONTEXT.md gains the three terms the old lbin collapsed into one.

Status: Proposed. Implementation tracked in issues 49, 50 and 20.
Copilot AI review requested due to automatic review settings July 14, 2026 14:24
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✔️ No coverage data to report, because files changed do not require tests or are set to ignore

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Architecture Decision Record (ADR-0019) documenting that the bandpower “shape function” (in-bin spectral assumption) must be expressed in the binning operator (via weights (w_\ell)), and that effective multipoles should be derived from the realised window (via Fisher), not from bin midpoints. Also updates project glossary/context to explicitly separate the terms bandpower shape function, effective multipole, and bin midpoint.

Changes:

  • Add ADR-0019 documenting the decision to eliminate post-hoc (C_\ell \to D_\ell) scalar conversion and instead declare the in-bin shape via (w_\ell).
  • Index ADR-0019 in the ADR catalog and mark it as Proposed / deferred.
  • Extend CONTEXT.md with clearer binning terminology aligned with ADR-0019.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
docs/adr/INDEX.md Adds ADR-0019 to the bandpower/binning section and to the Proposed/deferred status list.
docs/adr/0019-bandpower-shape-function.md New ADR specifying the bandpower shape-function decision, effective-multipole definition, and consequences.
CONTEXT.md Adds and clarifies glossary terms: bandpower shape function, effective multipole, and bin midpoint (Bins.lmid).

ggalloni added 2 commits July 14, 2026 16:42
CONTEXT.md is a glossary, not a second copy of the ADR: drop the rationale,
the implementation location and the rename history from the three new terms
and leave the definitions.

In the ADR, cut the Bins-cleanup consequence down to the decision-level fact
(the P/Q machinery goes, ADR-0007 needs amending) rather than restating the
issue that owns it, and stop naming source files a Proposed ADR has not
touched.
@ggalloni
ggalloni merged commit 16b19b0 into master Jul 14, 2026
17 checks passed
@ggalloni
ggalloni deleted the docs/adr-0019-bandpower-shape branch July 14, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants