Remove vestigial FHP/MK NOSHEAR←1P Tpsf substitution (guaranteed no-op)#267
Open
cailmdaley wants to merge 1 commit into
Open
Remove vestigial FHP/MK NOSHEAR←1P Tpsf substitution (guaranteed no-op)#267cailmdaley wants to merge 1 commit into
cailmdaley wants to merge 1 commit into
Conversation
The metacal estimator and calibrate_comprehensive_cat.py carried a workaround that overwrote the metacal no-shear reconvolution-PSF size with the 1P value. It was a real fix for an older ShapePipe catalogue whose no-shear PSF was wrong, but is a guaranteed no-op under the current stack: ngmix builds one magnitude-dilated reconv PSF and reuses it across all metacal types, and ShapePipe fits it once per object and broadcasts the same scalar into every per-type column, so NOSHEAR and 1P are bit-identical for every object. - calibration.py: replace the silent overwrite with an np.testing.assert_array_equal(NOSHEAR, 1P) regression guard, so any future producer-side divergence fails loudly instead of being patched. - 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 guaranteed no-op under the current stack:
_NOSHEARand_1Pare bit-identical for every object._origcolumn is bit-identical to the hacked column.Changes
calibration.py(metacal._read_data): replace the silent overwrite ofns["Tpsf"]with a one-linenp.testing.assert_array_equal(NOSHEAR, 1P)regression guard, so any future producer-side divergence fails loudly instead of being silently patched.scripts/calibration/calibrate_comprehensive_cat.py: drop the override and the now-redundantNGMIX_T_PSF_RECONV_NOSHEAR_origcolumn.test_calibration.py: update the estimator-stdout note (the estimator no longer prints anFHP/MK hackline).Verification
No output changes under the current stack.
test_calibration.pyruns green in the container (8 passed) — the two metacal-estimator tests now exercise the new guard (the synthetic catalogue hasNOSHEAR == 1P, so it holds).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/_2Plabels are not physically distinct reconv-PSF measurements.— Opus, on behalf of Cail
🤖 Generated with Claude Code
https://claude.ai/code/session_01Xthu9uZC17TsaeXh899fhc