Skip to content

Support oversampled PSFEx native rendering and add named 0.7-pixel Run-2 config - #1012

Open
cailmdaley wants to merge 3 commits into
developfrom
feat/psfex-oversampled-0p7
Open

cailmdaley wants to merge 3 commits into
developfrom
feat/psfex-oversampled-0p7

Conversation

@cailmdaley

@cailmdaley cailmdaley commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Closes #989.

Summary

  1. Native-pixel rendering for oversampled PSFEx models (psfex_interp): resamples any PSF_SAMPLING != 1 PSFEx basis onto the native 51×51 pixel grid with PSFEx's separable Lanczos-3 kernel (unit-sum weights), with an explicit STAMP_PHASE toggle (centred vs star/galaxy VIGNET phase). At PSF_SAMPLING = 1.0 with STAMP_PHASE = False, the model grid passes through unchanged.
  2. Named Run-2 config without breaking Run 1:
    • workflow/config/cfis/default.psfex remains at Run 1 (PSF_SAMPLING 1., PSF_SIZE 51,51) and config_exp_psfex.ini keeps STAMP_PHASE = False so Run 1 is bit-for-bit reproducible.
    • workflow/config/cfis/default_0p7.psfex adds 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 via psfex_config: default_0p7.psfex (wired through workflow/Snakefile, workflow/rules/exposure.smk, and config_exp_psfex.ini).
  3. Validation rendering convention (STAMP_PHASE = False by default): keeping validation centred matches the exact PSF stamp handed to ngmix on the galaxy path, so full_starcat ρ/τ and ξ_sys measure the PSF error galaxies actually see. Setting STAMP_PHASE = True in validation while galaxies remain centred masked Run 1's -0.77% centred size bias and dropped Run 1's fiducial ξ_sys+ from 7.09× to 0.41× without changing a single galaxy pixel. STAMP_PHASE = True remains available as an opt-in PSFEx diagnostic (and can be evaluated post-hoc from persisted *.psf models without rerunning exp_psf).

48-tile DR6 patch testbed: separating STAMP_PHASE from PSF_SAMPLING = 0.7

All 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) keeps PSF_SAMPLING = 1.0 and changes only validation STAMP_PHASE = True, so its galaxy catalogue is bit-identical to Run 1. 0.7 centred evaluates the 0.7 models with STAMP_PHASE = False — the exact PSF stamps galaxies receive.

Metric Run 1 (1.0 centred) Phase-only (1.0 phased) 0.7 centred (galaxy path) 0.7 phased (diagnostic) 0.5 phased
dT/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
Fiducial ξ_sys+(12–83′) / const 7.09× 0.41× 1.73× 0.48× 0.46×
β²ρ1(12–83′) / const 12.09× 0.89× 3.76× 0.11× 0.33×
Galaxy Δα2 vs Run 1 (north all) 0 0 (bit-identical) +0.008 ± 0.004 — -0.246 ± 0.015
Galaxy Δα2 vs Run 1 (north clean) 0 0 -0.002 ± 0.003 — -0.134 ± 0.006
exp_psf CPU time (66 exps) 1.00× 1.00× 1.28× (+28%) 1.28× 2.36×

What 0.7 adds on the galaxy path (comparing 0.7 centred to Run 1 centred):

  • Eliminates Run 1's -0.77% size bias at 0.55–0.65″ (-0.03 ± 0.08%) and cuts 0.75–1.05″ size bias 2.7× (-0.64% → -0.24%).
  • Cuts sharp-seeing (<0.50″) centred de1 by 43% (-3.94e-3 → -2.26e-3).
  • Drops centred fiducial ξ_sys+(12–83′) 4.1× (7.09× → 1.73× const) and β²ρ1 3.2× (12.09× → 3.76×) with zero STAMP_PHASE change.
  • Avoids 0.5's -0.13 to -0.25 galaxy PSF leakage regression on sparse north CCDs.

Multiplicative shear shift (Δm) and synthetic ngmix known-answer test

  • 48-tile patch: galaxy PSF size T_PSF is 0.45% smaller at 0.7 than Run 1, shifting the paired slope of calibrated galaxy shear against Run 1 to 0.9969 (e1) and 0.9975 (e2), i.e. Δm ≈ -3×10⁻³. A 0.7 rung in the image-simulation calibration (MultiBand_ImSim) is required for Run 2 (image-sims thread notified).
  • End-to-end synthetic do_ngmix_metacal known-answer test (3-epoch Exponential galaxies at random sub-pixel positions, paired +g/-g shear cancellation, 120 pairs per regime, centred interpolating PSF render):
    • 0.48″, N=116: oracle m1=+0.5±0.2e-3, m2=+1.5±0.2e-3; 1.0 is biased high by +8.1 / +6.6e-3 vs oracle (α2=+0.059); 0.7 recovers truth to -0.8 / +1.4e-3 vs oracle (Δm(0.7-1.0) = -9.0 / -5.2e-3, α2=+0.044); 0.5 injects α1=-0.069, α2=-0.090.
    • 0.70″, N=116: 1.0 is biased high by +5.7 / +4.1e-3 vs oracle; 0.7 recovers truth to -1.2 / +0.2e-3 vs oracle (Δm(0.7-1.0) = -6.9 / -4.0e-3); 0.5 injects α2=-0.067.
    • 0.70″, N=36 (sparse CCD): 0.7 matches or improves on 1.0 (α1=-0.139, α2=+0.087 vs -0.139, +0.129), while 0.5 doubles |α1| to -0.277.
    • Thus the Δm ≈ -3×10⁻³ shift on data is consistent with 0.7 removing Run 1's positive PSF-size m bias rather than introducing a new bias.

Why 0.7 is 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 — at 0.45″, N=116: +0.59% (1.0), -0.92% (0.8), -0.04% (0.7), +0.78% (0.65), +0.43% (0.5). Thus 0.7 is 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 keeping RMSE(g2) on the flat plateau above 0.6. Survey-wide on v2.0.0 (665,040 CCDs across 16,872 exposures), 27.6% of CCDs have <=40 training 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-star RMS(de) = 65–91e-3 — 8× normal, only 5–17/40 CCDs surviving). Across all 16,872 v2.0.0 exposures, an exposure-level gate of n_valid_ccd < 20 OR rms_de > 30e-3 catches all 5/5 while dropping 124 / 16,872 exposures (0.73%, 0.22% of stars) (rms_de > 30e-3 alone drops 102 = 0.60%; n_valid_ccd < 20 alone drops 90 = 0.53%). Tracked separately from this PR.

Figures

Centred-render sweet spot across 9 samplings, seeings, and star counts

4-way reserve-star residuals vs seeing with exposure-clustered SE

Galaxy PSF leakage by block and 4-way reserve-star rho1

North block divergence and phase instability at 0.5

Tests

  • pytest -q tests/module/test_psfex_interp.py tests/unit/test_committed_configs_run.py: 18 passed (native rendering at 0.5 / 0.7 / 1.0, STAMP_PHASE, default.psfex Run-1 default, SP_PSFEX_CONFIG=default_0p7.psfex switch).

— Gemini 4 Neon on behalf of Cail

cailmdaley and others added 3 commits November 23, 2026 20:21
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>
@cailmdaley cailmdaley changed the title feat(psfex): native-pixel rendering and 0.7-pixel PSFEx sampling (#989) Support oversampled PSFEx native rendering and add named 0.7-pixel Run-2 config Nov 24, 2026

This branch has not been deployed

No deployments
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.

PSFEx native sampling leaves a g1 residual on sub-0.5″ exposures; PSF consumers assume PSF_SAMP = 1

1 participant