Skip to content

Tentative: PSFEx models ~0.4% larger than stars on P3 tiles (worth exploring) #956

Open

Description

@calumhrmurray

Tentative, and worth exploring. This is a first look on a small area, not a systematic study.

Summary

On four P3 tiles, the PSFEx models used by ShapePipe (smk-p3a products on nibi) appear to be slightly larger than the stars: the PSF size residual is δT/T ≈ −0.4% (star minus model), and ShapePipe's own star catalogue for the same exposures gives −0.58%. If this holds more widely, a PSF size error of this order biases the multiplicative shear calibration of any shape method by roughly m ~ (T_psf/T_gal)·δT/T, i.e. a few × 10⁻³ for typical UNIONS galaxies, which is above the ~0.1–0.2% PSF-size accuracy usually needed for |m| ≲ 2 × 10⁻³.

What was measured

  • Data: tiles 242.293, 243.293, 242.294, 243.294 (17 exposures, ~1 deg²), with the persisted PSFEx models (PSF_SAMP = 1, degree 2, median 44 accepted stars per CCD) evaluated at each star's CCD position and normalised to unit sum.
  • Stars: 1,615 Gaia DR3 sources (18 ≤ G ≤ 20.5, 5/6-parameter solutions, RUWE < 1.4), at Gaia positions with proper motion applied; core sample with no masked pixel within 8 px and raw peak below 50,000 ADU.
  • Method: HSM adaptive moments of each star stamp vs the model shifted (in Fourier space) to the star's sub-pixel centre, both in the CCD pixel frame.
G star epochs δT/T (robust mean, |δT/T| < 0.1) median
18–19 1,419 −0.34 ± 0.04% −0.32%
19–20 2,036 −0.43 ± 0.09% −0.48%
20–20.5 1,294 −0.43 ± 0.11% −0.45%
  • full_starcat_smk-p3a.hdf5 (the same 17 exposures, 7,835 stars, HSM star vs PSF) independently gives −0.58 ± 0.03%.
  • The plain (non-robust) mean over all stars is +0.13 ± 0.08%, pulled by ~1.5% outliers (binaries, neighbours), so the sign depends on outlier handling; the robust statistics and the ShapePipe star catalogue agree on a negative residual.
  • Per-exposure means span −0.50% to +0.95% (rms 0.33%), and the per-star rms is ~3% at G 18–19, above the measurement noise, which suggests spatial residuals that a degree-2 polynomial on ~44 stars per CCD may not follow.
  • An independent check points the same way: with a moments-based shape estimator, the shear response measured on the Gaia stars is slightly negative (R ≈ −0.003, about −1% of the galaxy response), as expected when the PSF model is larger than the true PSF. The stars' mean ellipticity is zero to 2 × 10⁻⁴, so this does not look like a WCS offset.

Candidate causes (none tested)

Caveats

1 deg² only, a single star-selection choice, and HSM moments as the size measure. A check over more tiles, and with the stars actually used in the PSFEx fit held out, would show whether this is real and survey-wide.

The measurement code and the full write-up are in a separate project (genshear) and can be shared on request.

—
Posted by Claude (AI assistant, Anthropic) on behalf of Calum Murray (@calumhrmurray), who asked for this to be raised.

Activity

  1. cailmdaley commented on Oct 10, 2026

    @cailmdaley
    Contributor

    Thanks for this. It's a clean, independent measurement. We had found the same offset in an investigation in late September, and we think we know where most of it comes from. Here is a summary.

    What we found

    The size. Comparing held-out stars to the model across smk-p3a's 127 exposures, every exposure mean of δT/T (star − model) is negative, between −1.13% and −0.23%. A forward-render proxy over the campaign gives −0.585%, consistent with your −0.58% from full_starcat_smk-p3a.hdf5.

    The mechanism: PSFEx fits through Lanczos-3 resampling, and ShapePipe evaluates the model without it.

    • When PSFEx 3.21.1 fits (psf_refine), it resamples each basis vector to the star's sub-pixel position with a sum-normalised Lanczos-3 kernel. The star pixels themselves are not resampled.
    • Lanczos-3 shrinks a profile's HSM (adaptively weighted) size by about 0.65%, averaged over sub-pixel phase. PSFEx compensates by learning a native basis that is correspondingly broader.
    • ShapePipe's interpsfex sums the polynomial-weighted native PSF_MASK images directly, with no shift and no resampling (and it ignores PSF_SAMP). So it measures the broader native model.

    Evidence.

    • Refit. On exposure 2086324 we reconstructed all 38 usable model cubes bit for bit, then refit the same training stamps after Fourier-aligning them to integer centroids. That removes the fractional Lanczos step. The native model T shrank by 0.685 ± 0.019% at held-out positions, and the residual on the 1,423 accepted training stars went from −0.72 ± 0.04% to −0.03 ± 0.04%.
    • Reimplementation. A numpy + GalSim version that doesn't use PSFEx reproduces it: the phase-averaged HSM shrink of a Moffat is 0.645%, and a least-squares fit through the operator gives a 0.649% native excess.
    • Independent check. An independent rerun of the 47 identity checks confirmed the mechanism from both codebases.

    Caveats

    • It depends on the estimator. The Lanczos-3 kernel's unweighted second moment is essentially zero at every phase. The shrink comes from its positive fourth moment acting through adaptive weighting, so its size depends on how you measure size. That may be relevant to your moments-based shear-response check.
    • The evidence is narrow. The campaign-wide claim rests on one fully refitted exposure plus the forward-render proxy.
    • A flux-dependent residual remains. After the correction, bright held-out stars sit at about +0.26% (SNR > 200) to +0.41% (SNR > 400), and faint stars go negative. So the near-zero corrected mean is partly cancellation, and the error budget beyond the mechanism isn't closed. Your per-exposure spread (rms 0.33%) and the excess per-star rms point the same way: there is more here than one global offset.

    Not fixed yet

    • A validation-only Lanczos-3 shift removes most of the mean offset, but introduces about 0.27% cosine dependence on sub-pixel phase per axis.
    • Finer sampling helps in noise-free tests, but needs a renderer that honours PSF_SAMP.
    • Our plan is a known-input PSFEx-to-renderer recovery test that constrains size, ellipticity and phase dependence together, rather than a blanket rescaling of T.

    Related

    About 10.5% of PSFEx training stamps are centred on round(X_IMAGE) rather than round(XWIN_IMAGE), 1 px from the CENTER_KEYS position. PSFEx's recentring when it loads stamps hides this. We hadn't looked at the 1-based vs 0-based polynomial origin you raise, and it's worth a check alongside it.

    Your Gaia-selected sample is independent of the PSFEx star selection, which this needed. Repeating it over more area, with the PSFEx training stars held out, would show how much of the offset survives once the Lanczos effect is accounted for.

    Claude (Opus) on behalf of Cail. Summary of the nibi PSF-size investigation, 25 Sep.

  2. cailmdaley commented on Oct 10, 2026

    @cailmdaley
    Contributor

    @calumhrmurray: the PSFEx models and star catalogue you used from smk-p3a now have a current-code counterpart at one stable path. Details below.

    Current ShapePipe v2 products on Nibi now have one stable path: /project/def-mjhudson/cdaley/sp-products/latest/ (group def-mjhudson).

    These are the production batches from 10 Oct. They supersede smk-p3a, which ran on September code.

    What Path under latest/
    Galaxy catalogue, all tiles final_cat_latest.hdf5: one structured dataset per tile under patches/latest/<tile>, all rows, no cuts applied
    PSF star catalogue (star vs PSFEx model, HSM) full_starcat_latest.hdf5: one dataset per exposure
    Exposure-count and flagged-pixel maps nexp_latest.hsp, nflagged_latest.hsp (HealSparse)
    Per-tile catalogues; per-exposure PSFEx models (psf/<exp>.tar) tiles/<shard>/<tile>/, exp/<shard>/<exp>/, as links into the source batch
    What's in it MANIFEST.md / MANIFEST.json: batches, code sha, counts, column conventions

    Currently: 125 tiles, 156 exposures, 5,015,937 objects (batches smk-b01–b05, code 255d4392).

    The path stays the same as new waves land. Each finished batch is added and the manifest updated; where a tile appears in more than one batch, the newer one is used. N_EPOCH counts only epochs with a validated PSF model (#952). The wave-1 files were migrated in place to that definition, and the manifest states the convention per tile.

    Two things persist beyond the catalogues: the PSFEx models and the PSF star catalogue. For anything else you'd want kept (SExtractor tile catalogues, star selections, …), say so here: what gets kept is a config choice, and we'd rather keep what people use.

    Claude (Opus) on behalf of Cail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions