Skip to content

ngmix: restore (or justify dropping) the PSF noise-injection / PSF-observation weight #774

Description

@cailmdaley

A small PSF noise-injection present in the previous (pre-v2.0) code is absent in the v2.0 module (Fabian's observation). The production PSF observation is built weightless and noiseless — psf_obs = Observation(psf, jacobian=psf_jacob) (src/shapepipe/modules/ngmix_package/ngmix.py:1100) — in contrast to the galaxy observation, which carries both weight and noise (ngmix.py:1143–1148). The older esheldon/aguinot pattern instead gave the PSF stamp a small injected noise and a matching finite weight (psf_noise = 1.0e-6, psf_wt = 1.0/psf_noise**2).

It survived only in dead example scripts, removed in bd60dc8e; the v2.0 module was a from-scratch rewrite that built the PSF observation weightless from the start (since 2b755516), so there's no single "removal" commit — the exact prior version Fabian recalls is most likely the pre-v2.0 aguinot/ngmix 1.3.6 fork. First step: pin which version + diff he saw, with Fabian.

Why it matters (and is pre-merge relevant): a weightless PSF observation leaves ngmix assuming a default (effectively uniform) weight for the PSF stamp, so the noise the PSF fit assumes differs from the old 1/psf_noise² budget. That feeds the metacal error bookkeeping and could change the star response R and the shape-measurement error model.

Checkable on the twin: re-introduce the PSF noise/weight as an additive knob, sweep it, and watch (a) the star response R and (b) χ²_red — does restoring it move either toward sanity, or was it correctly dropped?

Coupled to the reduced-χ² anomaly (#769, longer-term under #773): a weightless PSF observation is a leading candidate for the brightness-dependent error-model mis-specification that anomaly measures. Part of the ngmix v2.0 epic (#762).

— Claude on behalf of Cail

Activity

  1. cailmdaley commented on Jun 30, 2026

    @cailmdaley
    ContributorAuthor

    Retiring as redundant. #774 and #749 are the same bug from two angles — one weightless line in make_ngmix_observation. #749 saw the galaxy prior dominating the PSF fit; #774 saw the dropped noise budget. Both dissolve into give psf_obs a weight, and that finite 1/psf_noise² weight is the substance of the old noise-injection — there's no separate deliverable. Validated that explicit PSF-stamp noise on top of the weight moves nothing (Δ ≲ 1e-6), as Axel predicted. The fix lands in #779 (Closes #749); the noise-budget history is recorded there. The faint-χ² / star-R coupling this issue speculated about lives in the #769 χ²-anomaly investigation.

    — Claude on behalf of Cail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions