Repository navigation
PSF star selection vetoes the UNIONS manual mask - #994
Open
cailmdaley wants to merge 2 commits into
Open
cailmdaley wants to merge 2 commits into
cailmdaley wants to merge 2 commits into
Conversation
mask_query queries the manual mask (bit 8) and star_selection.setools rejects candidates with MASK_EXT != 0 in its preselect, flag and star_selection blocks. Outlier rejection alone lets M33's HII regions and clusters into the PSF model (shapepipe#993); the manual mask covers them at a cost of 0.5% of PSF stars. masking.psf_star_mask_veto's default becomes manual_mask_veto, with its Values pinned in both exposure configs and setools. Sims that select PSF stars share these configs through symlinks, so inputs.masks is required whenever the exposure chain selects PSF stars (refuse_missing_masks), not only for data. A setools test reproduces the failure: extended sources that outnumber stars capture the locus without the mask and are rejected with it. Closes #993 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JK7o9FjcungfGYzSdkjy7z
…ueries The exposure configs the simulations share veto PSF-star candidates on the manual mask, so a sims run with psfex or mccd needs inputs.masks. The config.yaml field notes say when it is required. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JK7o9EvVyXSSb8s7hMDX1H
cailmdaley
added a commit
that referenced
this pull request
Nov 4, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JK7o9EnraydJLhkzaVpLsM
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.
PSF-star selection now rejects candidates on the UNIONS manual mask (bit 8) as well as instrument flags. Outlier rejection alone handles crowded star fields, but not M33. There, HII regions and clusters outnumber stars on the CCD, pass selection, and inflate the PSF model itself. Inside 0.15° of M33, normal-size stars (|dT/T| < 0.2, so not contaminants) come out 2.4% smaller than the model, against ≈0 in the field. Their ellipticity residual rms is 6.4× the field value, and 24% of selected "stars" are more than 1.2× the PSF size. M13, M92, M101 and the Draco and Ursa Minor dwarf spheroidals are crowding only: no oversized candidates, and residuals within ~1.2× of the field (figure; measurement in #993). The manual mask removes 1,024 of M33's 1,025 oversized candidates within 1° and every radius where the model is biased. It costs 0.5% of PSF stars survey-wide. Draco and Ursa Minor are not in the manual mask and don't need to be.
What changes.
config_exp_psfex.iniandconfig_exp_mccd.inisetMASK_PATHS = $SP_INPUT_MASKS/mask_ugriz_nside131072_n8.hsp, a 55 MB map.star_selection.setoolsaddsMASK_EXT == 0besideIMAFLAGS_ISO == 0inpreselect,flagandstar_selection. The preselect cut matters most, because it keeps the contaminants from setting the stellar-locus mode.fwhm_mag_cutonly feeds the size–magnitude plot and is unchanged.astra.yaml,masking.psf_star_mask_vetodefaults to the newmanual_mask_vetooption.instrument_flags_only(how run 1 ran) andstar_body_vetoremain as alternatives, with their measured costs. The Values pin both configs'MASK_PATHSand all three setools cuts.MASK_<band>columns are still never cut on.Simulations.
config/cfis_image_sims/symlinks the exposure configs andstar_selection.setools, so any sims run that selects PSF stars (psf_modelpsfex or mccd) now runs this veto too and needsinputs.masks. The new parse-time guardrefuse_missing_maskssays so instead of failing in setools.psf_model: fake, the sims default, queries no masks and is unaffected. candide'simage_simsprofile inworkflow/config.yamlpointsinputs.masksat the same DR6 masks as its data profile; the field notes there say when the key is required.Tests.
MASK_EXTset, exactly the stars are selected.star_selectioncut and commenting out MCCD'sMASK_PATHSeach break the record check.shapepipe-develop-240b37e4.sif), 181 tests across the decision, setools, mask_query, mode and mask-column files pass, as do 89 in the guard, decision and setools files. The Snakemake DAG tests run in CI.Run 2 only. Run-1 products keep their PSF models; the downstream bit-8 star veto for run 1 is sp_validation's. M33's biased model sits inside bit 8, where galaxies are already cut, so run 1 needs no rerun. A small residual remains in the 0.5–0.7° ring outside M33's manual ellipse (1.15× δe rms, no size bias), noted in #993.
Closes #993.
Claude on behalf of Cail
🤖 Generated with Claude Code
https://claude.ai/code/session_01JK7o9FjcungfGYzSdkjy7z