New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-25894: Extract stars on, or slightly beyond, exposure edge #454
Conversation
19782b1
to
f1be38c
Compare
@@ -127,6 +128,12 @@ class ProcessBrightStarsConfig(pipeBase.PipelineTaskConfig, | |||
" annular flux.", | |||
default=('BAD', 'CR', 'CROSSTALK', 'EDGE', 'NO_DATA', 'SAT', 'SUSPECT', 'UNMASKEDNAN') | |||
) | |||
minPixelsWithinFrame = pexConfig.Field( | |||
dtype=int, | |||
doc="When a bright star is beyond exposure boundary, what is the minimal number of pixels that still " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest rewording to something like: The minimum number of pixels that must fall within the stamp boundary for the bright star to be saved when it is beyond the exposure boundary.
@@ -207,8 +214,12 @@ def extractStamps(self, inputExposure, refObjLoader=None): | |||
GMags = [] | |||
ids = [] | |||
wcs = inputExposure.getWcs() | |||
# select stars within input exposure from refcat | |||
withinCalexp = refObjLoader.loadPixelBox(inputExposure.getBBox(), wcs, filterName="phot_g_mean") | |||
bmp = inputExposure.mask.getMaskPlaneDict() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer a more descriptive name than bmp.
inputExpBBox = inputExposure.getBBox() | ||
dilatationExtent = geom.Extent2I(np.array(self.config.stampSize) - self.config.minPixelsWithinFrame) | ||
withinCalexp = refObjLoader.loadPixelBox(inputExpBBox.dilatedBy(dilatationExtent), wcs, | ||
filterName="phot_g_mean") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the filter always going to be phot_g_mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, yes. The refcat used will always be Gaia, and the band always (Gaia) G.
This will only change with DM-25175, and I was planning on adjusting this when we get there. I added a TODO comment referencing the tickets for now.
f1be38c
to
5893255
Compare
bboxCorner = np.array(cpix) - np.array(self.config.stampSize)/2 | ||
bboxCorner = geom.Point2I(bboxCorner) | ||
# compute bbox as it would be otherwise | ||
idealBBox = geom.Box2I(geom.Point2I(bboxCorner), geom.Extent2I(self.config.stampSize)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've already cast it as a Point2I
ids.append(allIds[j]) | ||
try: | ||
starIm = inputExposure.getCutout(sp, geom.Extent2I(self.config.stampSize)) | ||
except InvalidParameterError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have slacked you a suggestion for how to replace this section.
8a7cf7e
to
85a1bbe
Compare
Thanks a lot for your suggestion. I went with a mix between your version and mine, but it is a lot easier to read that way! |
85a1bbe
to
2b88453
Compare
if not fs.contains(geom.Point2I(cpix)): | ||
otherFootprints.append(fs) | ||
nbMatchingFootprints = len(allFootprints) - len(otherFootprints) | ||
if not nbMatchingFootprints == 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the only criteria that can trigger this condition?
Jira ticket
Jenkins run #33446