Repository navigation
fix(mask): footprint-based NGC/Messier overlap test - #827
Merged
Merged
Conversation
mask_dso selected a deep-sky object only if an image CORNER lay within
the object's radius of its centre. Objects smaller than the image that
sit mid-CCD - i.e. most catalogued galaxies - never satisfy this and
were silently skipped ('Found 0 NGC objects overlapping with image').
Replace the corner-proximity criterion with a footprint-overlap test:
the object centre within (object radius + image half-diagonal) of the
image centre, using the existing _fieldcenter and _img_radius. This
catches objects anywhere on or overlapping the CCD, scales with the
per-object catalogue size, and strictly contains the old criterion
(corner within r implies centre within r + half-diagonal), so no
previously selected object is lost.
Evidence (CFIS P3, exposure 2586338 CCD 11): NGC 5949 sits mid-CCD and
was unmasked; with the fix it is selected (old criterion: 0 objects,
new: 1) and its region flagged (NGC-bit pixels 0 -> 930,704). Nearest
non-selected NGC object is 151 arcmin away. A DSO-free control CCD
(2254867-10) produces a bit-for-bit identical flag map to develop.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
7 tasks
Contributor
|
Wow, that's an insane bug that claude found! Can't believe this was not spotted before. Luckily we have been using the structural masks on top of the ShapePipe ones that do mask Deep Space Objects that are anywhere in the image, not just close to a corner. |
Contributor
Author
|
actually i found this one with mine own two eyes, in the sense i said "why isn't that bright, spatially extended galaxy masked?" but claude did all the hard work :) |
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.
Problem
mask_dsoselects an NGC/Messier object only if an image corner lies within the object's radius of its centre. Objects smaller than the CCD that sit mid-image — i.e. most catalogued galaxies — never satisfy this and are silently skipped. On CFIS P3 exposure 2586338 CCD 11, NGC 5949 sits 3′ from the CCD centre, is present inngc_cat.fits, and the log readsFound 0 NGC objects overlapping with image.Root cause
tests corner proximity, which is an overlap test only for objects larger than the image.
Fix
Footprint overlap using the existing
_fieldcenter/_img_radius: select when the object centre is within (object radius + image half-diagonal) of the image centre. Catches objects anywhere on or overlapping the CCD, scales with the per-object catalogue size, and strictly contains the old criterion (corner withinr⇒ centre withinr+ half-diagonal), so nothing previously selected is lost.Evidence
ngc_cat.fits, 11,454 objects): old criterion 0 → new 1; the selected object is NGC 5949 (sep 3.0′, inside footprint, size 2.2′×1.0′). Nearest non-selected object is 151′ away.mask_runnerrerun on 2586338-11:Found 1 NGC objects overlapping with image; NGC-bit pixels 0 → 930,704, mask centred on the galaxy. Before/after figure:Found during the Nibi test run in #808 — this completes that comment's NGC 5949 story (the bright glow there is the galaxy; its GSC counterpart 0.3′ away is likely its nucleus) and complements #824/#662.
— Claude (Fable) on behalf of Cail.
🤖 Generated with Claude Code