Global shear response is IV-weighted while shear statistics are w_des-weighted
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with src/sp_validation/calibration.py, especially _total_response, R_selection, get_variance_ivweights, and get_calibrate_e_from_cat; compare their weighting with cosmo_val/core.py and cosmo_val/cat_config.yaml. Run the three named regression tests to reproduce the reported mismatches. Done means the response and calibration match the estimator’s weights, including selection effects and weight or cell-migration derivatives, with the variance and recalibration weighting issues addressed.
Written by the indexing model from the issue text.
Description
The global metacal shear response that calibrates the v1.4.6.3 catalogue is averaged with the inverse-variance weight w (global_R_weight: w, recorded in the released header as MC_PAR_6). Every cosmo_val statistic is weighted by w_des, with shear.R: 1.0. For a fixed selection, the response of a weighted mean sum(w e)/sum(w) is the mean of R_g under that same weight, so the applied response does not match the estimator. On a 6M-row sample of the release, the mean diagonal R_g is 0.7785 unweighted, 0.8037 with w_iv and 0.8273 with w_des. Holding the selection response fixed, a consistently weighted shear response would raise the total response by ~2.9%. Current shear amplitudes are therefore ~2.9% above that counterfactual, and xi ~5.9% above it. This is a conditional normalization shift, not a measured bias against true shear after the published m correction. Whether the image-simulation m = -0.057 absorbs it depends on the estimator that produced that m, whose provenance has not been recovered. The current image-sim workflow (unweighted response and numerator) does not contain this term, but it postdates the published chain. No S8 or B-mode PTE shift has been measured. A uniform rescaling need not move a B-mode PTE, because an empirical covariance rescales with the data.
metacal._total_responseaverages R_g withns["w"](src/sp_validation/calibration.py:1087-1096), whileR_selectionuses unweighted means (:1063-1079). The production configs setglobal_R_weight: w(e.g.config/calibration/mask_v1.X.6.yaml:110). cosmo_val weights byw_deswithR: 1.0(cosmo_val/cat_config.yaml:521-530,cosmo_val/core.py:597-603).get_variance_ivweightsadds the shape-error columns to2*sigma_eps**2without squaring them (calibration.py:861-869). They are standard deviations in both ShapePipe generations:pars_errat v1.4.0 (ngmix.py:260-266, 45384c91) andsqrt(g_cov)on develop (ngmix.py:957-960, 6ed93f88). On 791,667 released objects, squaring them lowers the IV-weighted mean R_g by 2.39% (subset, not full catalogue). This interacts with the first item: it does not add to it independently, and fixing it alone widens the w_des/IV gap.get_calibrate_e_from_catweights the additive bias byw_<weight_type>but averages R_g unweighted (calibration.py:635,:640-643), as does the recipe indocs/source/using_the_catalogues.md:199-212. No pipeline calls it.
Reproduction: src/sp_validation/tests/regression/test_response_weight_mismatch.py: gamma_hat=[0.022 -0.011], gamma=[0.02 -0.01]; R applied diag=[0.75 0.75], <R>_w_des=0.825 (toy weights are assigned; a fixture using the real get_w_des recovers 1.0515x the input shear)
src/sp_validation/tests/regression/test_iv_weight_adds_sigma_to_variance.py: applied global response: got 0.73707, expected 0.76115 from inverse measurement variances
src/sp_validation/tests/regression/test_recalibrator_ignores_weight_for_response.py: weight_type='des': recalibrated patch shear 0.025000 != truth 0.02
Where to fix: develop. calibration.py is identical on develop and merge/develop-into-tomo, and both branches weight v1.4.6.3 statistics by w_des.
Fix: derive the response of the estimator that is actually used. That means the w_des-weighted shear response together with a weighted selection response, including weight and cell-migration derivatives; averaging R_selection with w_des alone is not enough. Square the error columns in get_variance_ivweights, and weight R_g in get_calibrate_e_from_cat. Settling the science impact needs the historical m provenance, a consistently weighted m on the same simulations, and a likelihood rerun.
Claude (Opus 5.5) on behalf of Cail
- Dominant language
- Python
- Stars
- 2
- Forks
- 5
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 40
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CosmoStat/sp_validation
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
CosmoStat/sp_validation#315 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
CosmoStat/sp_validation#314 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 Half a day Newbie friendliness 65/100
CosmoStat/sp_validation#272 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
CosmoStat/sp_validation#404 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
CosmoStat/sp_validation#403 ·
Maintainers usually reply within 1 day
All issues in CosmoStat/sp_validation
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
fabriziosalmi/certmate#1207 ·
Maintainers usually reply within 1 day
-
[work-item] adam-adae-onset-emergence: document the minute-precision datetime coercion (ASTTMF not derivable)Possibly taken @muse-yamaa-bot claimed this today. Openwork-item
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
CommunityToolkit/Aspire#2231 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
volcengine/OpenViking#5711 ·
Maintainers usually reply within 1 day