Skip to content

Remove vestigial FHP/MK NOSHEAR←1P Tpsf substitution (guaranteed no-op)#267

Open
cailmdaley wants to merge 1 commit into
developfrom
remove-noshear-1p-hack
Open

Remove vestigial FHP/MK NOSHEAR←1P Tpsf substitution (guaranteed no-op)#267
cailmdaley wants to merge 1 commit into
developfrom
remove-noshear-1p-hack

Conversation

@cailmdaley

@cailmdaley cailmdaley commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Closes #257.

Removes the vestigial FHP/MK NOSHEAR←1P Tpsf substitution from the two sites that carried it. This was a real workaround when written (b076413, Jan 2026) — for an older ShapePipe catalogue whose metacal no-shear reconvolution-PSF size was wrong, the code overwrote it with the 1P value in the galaxy size cut and mirrored the substitution onto the output column (keeping the original as _NOSHEAR_orig).

It is now a no-op under the current stack:

  • ngmix builds one magnitude-dilated reconvolution PSF and reuses it for all metacal types (noshear literally reuses the 1p object) — the reconv-PSF size is identical across noshear/1p/1m/2p/2m by construction.
  • ShapePipe's ngmix module fits that reconv PSF once per object and broadcasts the same scalar into all five per-type columns — so _NOSHEAR and _1P are bit-identical for every object.
  • Confirmed empirically on the fiducial sim tile: the preserved _orig column is bit-identical to the hacked column.

Changes

  • calibration.py (metacal._read_data): drop the overwrite; the no-shear branch simply uses the NGMIX_T_PSF_RECONV_NOSHEAR column it already reads.
  • scripts/calibration/calibrate_comprehensive_cat.py: drop the override and the now-redundant NGMIX_T_PSF_RECONV_NOSHEAR_orig column.
  • test_calibration.py: update the estimator-stdout note (no FHP/MK hack line now).

#257 proposed replacing the overwrite with an assert_array_equal(NOSHEAR, 1P) regression guard. On reflection we dropped that too: a consumer reading the no-shear PSF for the no-shear branch shouldn't police the producer's cross-column consistency (we don't for any other column), and the assert would wrongly crash if a future producer ever made the no-shear kernel genuinely distinct. From scratch, this code just reads the column it needs.

Verification

No output changes under the current stack. test_calibration.py runs green in the container (8 passed).

Note for downstream readers (independent of this removal): the per-type NGMIX_T_PSF_RECONV_<TYPE> columns all carry the same object-level NOSHEAR-kernel value by design — the _1P/_2P labels are not physically distinct reconv-PSF measurements.

— Opus, on behalf of Cail

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xthu9uZC17TsaeXh899fhc

@cailmdaley cailmdaley force-pushed the remove-noshear-1p-hack branch from 8a3d67b to 2f78932 Compare July 12, 2026 19:36
The metacal estimator and calibrate_comprehensive_cat.py carried a
workaround that overwrote the metacal no-shear reconvolution-PSF size
with the 1P value — a real fix for an older ShapePipe catalogue whose
no-shear PSF was wrong, now a no-op under the current stack: ngmix builds
one magnitude-dilated reconv PSF and reuses it across all metacal types,
so NOSHEAR and 1P are bit-identical per object.

- calibration.py: drop the overwrite; the no-shear branch simply uses the
  no-shear reconv-PSF column it already reads.
- calibrate_comprehensive_cat.py: drop the override and the now-redundant
  NGMIX_T_PSF_RECONV_NOSHEAR_orig column.
- test_calibration.py: update the estimator-stdout note (no hack line now).

No output changes under the current stack. test_calibration.py: 8 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xthu9uZC17TsaeXh899fhc
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.

Remove vestigial FHP/MK NOSHEAR←1P Tpsf substitution (guaranteed no-op under the current stack)

1 participant