Repository navigation
Tile-level defect flags: exposure IMAFLAGS_ISO and interpolated-defect epochs on each object's footprint - #973
Open
cailmdaley wants to merge 8 commits into
Open
cailmdaley wants to merge 8 commits into
cailmdaley wants to merge 8 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ct footprints Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ey check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ery handling Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eration plan Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cailmdaley
force-pushed
the
feat/defect-flags-tile
branch
from
October 24, 2026 13:32
c45de2f to
3ea9bc1
Compare
cailmdaley
changed the base branch from
feat/masked-pixels
to
feat/uberseg-seg-vignet
October 24, 2026 13:32
Measure real epoch preparation without fitting, record denominators and bit counts, and add a spatial overlay and conditional Poisson interpretation. Cache read-only stores and exposure WCS decoding for bounded validation runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cailmdaley
marked this pull request as ready for review
October 24, 2026 15:53
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.
We add exposure-defect flags on each tile object's segmentation footprint, leaving fits and existing stamp-wide diagnostics unchanged.
On real tile 188.307, 0.49% of objects with known footprints have an interpolated defect on their footprint, compared with 36.28% with interpolation somewhere in a kept stamp.
These are detection-level, no-fitting checks on one tile, not shear-sample rates.
Stacks on #925, which supplies int32
SEG_VIGNETthrough the committed detection andTile_catloader.Stacking only on #922 would leave fitted objects without that input and produce
-1.Columns
NGMIX_IMAFLAGS_ISOpreserves the bitwise OR of exposure instrument flags ontile_seg == obj_id, across epochs passing the masked-fraction cut and central veto.NGMIX_N_EPOCH_INTERP_ISOcounts those kept epochs with an interpolated defect on the same footprint.An unflagged zero-weight pixel can contribute to the count without adding an instrument bit.
We MegaCam-flip the coadd segmentation into each epoch orientation without reprojection, matching the existing overlay.
Both columns are
-1for missing, empty or edge-clipped footprints; never-fit final rows use0and still require fit-status checks.Clean quarter-turn weight copies don't count as defects.
We record the choice in ASTRA's
shape_measurement.defect_flaggingdecision and pin it inuniverses/committed.yaml.Real-tile validation
We regenerated seven locally available exposures and tile inputs under
/scratch/cdaley/defectflag-check/, with production mounts read-only and retrieval set to symlinks.No download, production write, galaxy fit or back-fill was needed.
The read-only diagnostic script calls the real
prepare_postage_stampspath with committedSEG_VIGNET, uberseg and interpolation.-1sentinelThere are 36,051 detections, 374 without a kept epoch, and no empty footprints.
The edge-sentinel share is below the proposed few-percent threshold for reconsidering that policy on this tile.
The positive instrument bits are 1: 82, 2: 24, and 8: 96 objects; overlapping bits preserve their original identities.
All 112,734 kept flag stamps read from the regenerated SQLite stores are
int16.A literal final-column
!= 0also includes the unknowns: 795/36,051 (2.2052%), versus 174 objects with positive bits.Orange points are interpolation-positive objects; blue is flagged CCD pixels per sky pixel, not flagged exposures.
All 173 affected centroids are within 8 arcsec of a positive map cell, versus 82.2% of 2,000 deterministic controls.
Only 23/173 centroids occupy a positive cell themselves; the defective pixel can lie elsewhere on the footprint.
The campaign map's coarse rasterization makes this a spatial consistency check, not an independent false-positive measurement.
How the numbers fit together. Before the epoch cuts, 6.05% of objects have instrument flags on their footprint in at least one epoch. That matches the 6.97% of the tile area where the defect map is positive. The masked-fraction cut and the central veto then remove most of those epochs. 78% of footprints lie wholly inside the 7-px interpolated-defect veto radius, so for them any interpolated defect on the footprint drops the epoch instead of reaching the fit. What remains, 0.5%, are objects whose outer isophote crosses a defect that was interpolated and kept. The flag therefore marks the residual exposure to interpolation, not every object a defect ever touched. Epochs lost to defects show up in the epoch-cut counts, not here.
An independent-pixel estimate,
1-exp(-0.0028*A*N)per object, overshoots: 31.75% over the whole footprint, 6.81% outside the veto radius. The reason is that defects cluster. Kept footprints have a flagged-pixel fraction of 0.0149% (the kept stamps as a whole: 0.145%). Over a mean footprint of 66.8 px and 3.16 kept epochs, that is 0.031 flagged pixels per object. With 0.5% of objects flagged, each hit carries about 6 flagged pixels, as expected from column segments and clusters rather than isolated pixels. The rates come from 7 of the tile's 9 exposures (the two others were not on disk), so production objects have slightly more epochs.The validation note and JSON summary give the denominators, bit combinations, local pixel rates, limitations and reproduction paths.
Tests and execution scope
The rebased ngmix, make_cat, unit and PSF property suite passes 830 tests, one skipped; workflow/DAG/params-pin checks pass 31 tests, one skipped.
ASTRA validation passes and the params pin is unchanged.
Completeness checks count files, not columns; this change creates no additional pipeline product file.
Fixtures cover clean and rejected epochs, flipped CCDs, missing/empty/clipped segmentation, zero-weight flag-zero defects, unsafe casts, integer FITS round trips and never-fit rows.
The committed-workflow guard resolves data and image-simulation configurations under default, noisefill and uberseg handling, then verifies segmentation delivery and clean-object zeros.
The private run used one
def-mjhudsonallocation, 24921492, with 16 CPUs and 40 GiB.The initial 29-job plan completed exposure products, detection, headers and PSF interpolation; we stopped its slow, unrelated CLASSIC coadd-weight FITS copy.
A separately audited private one-rule Snakemake target ran only the committed MULTI-EPOCH vignetmaker section and completed all five stores with 36,051 rows each.
We did not mark the original full tile-vignet stage complete.
The real measurement, PNG and cached/uncached synthetic-equivalence check completed before the allocation ended.
A final targeted pytest rerun hit the allocation time limit and supplies no additional completed-suite result.
The allocation has ended and we also issued
scancel; no work is left running.Scratch quota checks showed ample headroom before and after.
Open question: should we back-fill batches already run?
The columns don't require shear refits, but the inspected batches no longer retain usable shared vignet stores, so we would need to locate or regenerate those inputs first.
We haven't back-filled anything.
— Sol and Claude Opus on behalf of Cail.
🤖 Generated with Claude Code