Repository navigation
Tentative: PSFEx models ~0.4% larger than stars on P3 tiles (worth exploring) #956
Description
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)
- PSFEx's own resampling or interpolation of the star vignets;
- the star selection used for the PSFEx fit (possibly related to PSFEx sample selection behavior #316 and Pin PSFEx's compiled-in SAMPLE_* candidate cuts explicitly in default.psfex #919);
- a smaller observation, unverified: PSFEx defines its position polynomial in 1-based pixel coordinates, and ShapePipe appears to pass 0-based positions (a 1-px offset in where the model is evaluated). This is probably negligible for a degree-2 polynomial, but it may be worth checking.
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
cailmdaley commentedon Oct 10, 2026
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.
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.interpsfexsums the polynomial-weighted nativePSF_MASKimages directly, with no shift and no resampling (and it ignoresPSF_SAMP). So it measures the broader native model.Evidence.
Caveats
Not fixed yet
PSF_SAMP.Related
About 10.5% of PSFEx training stamps are centred on round(
X_IMAGE) rather than round(XWIN_IMAGE), 1 px from theCENTER_KEYSposition. 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.
cailmdaley commentedon Oct 10, 2026
@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/(groupdef-mjhudson).These are the production batches from 10 Oct. They supersede smk-p3a, which ran on September code.
latest/final_cat_latest.hdf5: one structured dataset per tile underpatches/latest/<tile>, all rows, no cuts appliedfull_starcat_latest.hdf5: one dataset per exposurenexp_latest.hsp,nflagged_latest.hsp(HealSparse)psf/<exp>.tar)tiles/<shard>/<tile>/,exp/<shard>/<exp>/, as links into the source batchMANIFEST.md/MANIFEST.json: batches, code sha, counts, column conventionsCurrently: 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_EPOCHcounts 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.