Repository navigation
Support oversampled PSFEx native rendering and add named 0.7-pixel Run-2 config - #1012
Open
cailmdaley wants to merge 3 commits into
Open
cailmdaley wants to merge 3 commits into
cailmdaley wants to merge 3 commits into
Conversation
interpsfex reads PSF_SAMP and resamples the basis-combined model onto the native pixel grid with PSFEx's own model-to-vignet mapping (separable Lanczos-3, unit-sum weights, model centre n//2 on stamp centre), so validation HSM, the galaxy_psf store and ngmix receive native-pixel effective-PSF stamps at any PSF_SAMPLING. At unit sampling with centred stamps the raw grid is returned unchanged. STAMP_PHASE (psfex_interp option, default False) renders each PSF at the sub-pixel phase of the stamp it is compared with: the star's SExtractor VIGNET in validation (centred on the rounded X_IMAGE pixel, measured on SExtractor 2.25), each epoch's vignetmaker stamp (OFFSET) on the multi-epoch path. New ASTRA decision star_selection_psf.psf_stamp_rendering, committed option centred. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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 #989.
Summary
psfex_interp): resamples anyPSF_SAMPLING != 1PSFEx basis onto the native 51×51 pixel grid with PSFEx's separable Lanczos-3 kernel (unit-sum weights), with an explicitSTAMP_PHASEtoggle (centred vs star/galaxy VIGNET phase). AtPSF_SAMPLING = 1.0withSTAMP_PHASE = False, the model grid passes through unchanged.workflow/config/cfis/default.psfexremains at Run 1 (PSF_SAMPLING 1.,PSF_SIZE 51,51) andconfig_exp_psfex.inikeepsSTAMP_PHASE = Falseso Run 1 is bit-for-bit reproducible.workflow/config/cfis/default_0p7.psfexadds the Run-2 configuration (PSF_SAMPLING 0.7,PSF_SIZE 73,73, spanning the same 51-pixel native stamp), selectable in a campaign run config viapsfex_config: default_0p7.psfex(wired throughworkflow/Snakefile,workflow/rules/exposure.smk, andconfig_exp_psfex.ini).STAMP_PHASE = Falseby default): keeping validation centred matches the exact PSF stamp handed tongmixon the galaxy path, sofull_starcatρ/τandξ_sysmeasure the PSF error galaxies actually see. SettingSTAMP_PHASE = Truein validation while galaxies remain centred masked Run 1's-0.77%centred size bias and dropped Run 1's fiducialξ_sys+from7.09×to0.41×without changing a single galaxy pixel.STAMP_PHASE = Trueremains available as an opt-in PSFEx diagnostic (and can be evaluated post-hoc from persisted*.psfmodels without rerunningexp_psf).48-tile DR6 patch testbed: separating
STAMP_PHASEfromPSF_SAMPLING = 0.7All reserve-star uncertainties below are exposure-clustered standard errors across the 66 patch exposures (59,700–59,707 reserve stars) on common baseline seeing bins.
Phase-only(runs/phase_validation_only) keepsPSF_SAMPLING = 1.0and changes only validationSTAMP_PHASE = True, so its galaxy catalogue is bit-identical to Run 1.0.7 centredevaluates the0.7models withSTAMP_PHASE = False— the exact PSF stamps galaxies receive.1.0centred)1.0phased)0.7centred (galaxy path)0.7phased (diagnostic)0.5phaseddT/T(<0.50″, 12 exps)+0.41 ± 0.10%-0.08 ± 0.06%+0.44 ± 0.11%-0.24 ± 0.08%-0.31%dT/T(0.55–0.65″, 15 exps)-0.77 ± 0.09%-0.02 ± 0.08%-0.03 ± 0.08%+0.02 ± 0.07%-0.14%dT/T(0.75–1.05″, 20 exps)-0.64 ± 0.02%-0.18 ± 0.03%-0.24 ± 0.03%-0.19 ± 0.03%-0.20%de1(<0.50″, 12 exps)-3.94 ± 0.27e-3-0.81 ± 0.10e-3-2.26 ± 0.19e-3-0.01 ± 0.09e-3+0.13e-3ξ_sys+(12–83′)/ const7.09×0.41×1.73×0.48×0.46×β²ρ1(12–83′)/ const12.09×0.89×3.76×0.11×0.33×Δα2vs Run 1 (north all)00(bit-identical)+0.008 ± 0.004-0.246 ± 0.015Δα2vs Run 1 (north clean)00-0.002 ± 0.003-0.134 ± 0.006exp_psfCPU time (66 exps)1.00×1.00×1.28×(+28%)1.28×2.36×What
0.7adds on the galaxy path (comparing0.7 centredtoRun 1 centred):-0.77%size bias at0.55–0.65″(-0.03 ± 0.08%) and cuts0.75–1.05″size bias 2.7× (-0.64% → -0.24%).<0.50″) centredde1by 43% (-3.94e-3 → -2.26e-3).ξ_sys+(12–83′)4.1× (7.09× → 1.73×const) andβ²ρ13.2× (12.09× → 3.76×) with zeroSTAMP_PHASEchange.0.5's-0.13to-0.25galaxy PSF leakage regression on sparse north CCDs.Multiplicative shear shift (
Δm) and syntheticngmixknown-answer testT_PSFis 0.45% smaller at0.7than Run 1, shifting the paired slope of calibrated galaxy shear against Run 1 to0.9969(e1) and0.9975(e2), i.e.Δm ≈ -3×10⁻³. A0.7rung in the image-simulation calibration (MultiBand_ImSim) is required for Run 2 (image-sims thread notified).do_ngmix_metacalknown-answer test (3-epoch Exponential galaxies at random sub-pixel positions, paired+g/-gshear cancellation, 120 pairs per regime, centred interpolating PSF render):0.48″, N=116: oraclem1=+0.5±0.2e-3, m2=+1.5±0.2e-3;1.0is biased high by+8.1 / +6.6e-3vs oracle (α2=+0.059);0.7recovers truth to-0.8 / +1.4e-3vs oracle (Δm(0.7-1.0) = -9.0 / -5.2e-3,α2=+0.044);0.5injectsα1=-0.069, α2=-0.090.0.70″, N=116:1.0is biased high by+5.7 / +4.1e-3vs oracle;0.7recovers truth to-1.2 / +0.2e-3vs oracle (Δm(0.7-1.0) = -6.9 / -4.0e-3);0.5injectsα2=-0.067.0.70″, N=36(sparse CCD):0.7matches or improves on1.0(α1=-0.139, α2=+0.087vs-0.139, +0.129), while0.5doubles|α1|to-0.277.Δm ≈ -3×10⁻³shift on data is consistent with0.7removing Run 1's positive PSF-sizembias rather than introducing a new bias.Why
0.7is an empirical sweet spot (and stable across seeings and star counts)A 9-sampling synthetic sweep (
0.50–1.00, 8 realisations each) shows that centred-render size bias oscillates with sampling — at0.45″, N=116:+0.59%(1.0),-0.92%(0.8),-0.04%(0.7),+0.78%(0.65),+0.43%(0.5). Thus0.7is an empirical zero-crossing of PSFEx + Lanczos-3 rather than a non-commensurability theorem, and it stays near zero across seeing (0.45″–0.70″) and star density (N=36–116) while keepingRMSE(g2)on the flat plateau above0.6. Survey-wide on v2.0.0 (665,040 CCDs across 16,872 exposures), 27.6% of CCDs have<=40training stars and 42.8% have<=50.Exposure-level PSF acceptance gate (follow-up)
The 5 degraded 2025-02-27 exposures (
3141442, 3141445–3141448) are broken under every sampling (galaxyα2 ≈ -2, reserve-starRMS(de) = 65–91e-3— 8× normal, only5–17/40CCDs surviving). Across all 16,872 v2.0.0 exposures, an exposure-level gate ofn_valid_ccd < 20 OR rms_de > 30e-3catches all 5/5 while dropping 124 / 16,872 exposures (0.73%, 0.22% of stars) (rms_de > 30e-3alone drops 102 = 0.60%;n_valid_ccd < 20alone drops 90 = 0.53%). Tracked separately from this PR.Figures
Tests
pytest -q tests/module/test_psfex_interp.py tests/unit/test_committed_configs_run.py: 18 passed (native rendering at0.5 / 0.7 / 1.0,STAMP_PHASE,default.psfexRun-1 default,SP_PSFEX_CONFIG=default_0p7.psfexswitch).— Gemini 4 Neon on behalf of Cail