Skip to content
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-28600: Add option to apply skyCorr to ProcessBrightStarsTask #465

Merged
merged 2 commits into from Mar 3, 2021

Conversation

MorganSchmitz
Copy link
Contributor

Jira ticket

Jenkins run #33511

code extends over the entire focal plane, this can produce
better sky subtraction.
The calexp is updated in-place.
Parameters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix spacing (i.e. lack thereof) in docstrings.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need a space after title description.

"""
if isinstance(calexp, afwImage.Exposure):
calexp = calexp.getMaskedImage()
calexp -= skyCorr.getImage()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth a log message (at whatever level you feel appropriate)?

@@ -348,6 +382,8 @@ def run(self, inputExposure, refObjLoader=None, dataId=None):
dataId : `dict` or `lsst.daf.butler.DataCoordinate`
The dataId of the exposure (and detector) bright stars should be
extracted from.
skyCorr : `lsst.afw.math.backgroundList.BackgroundList`
Sky correction.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be slightly more descriptive?

@@ -348,6 +382,8 @@ def run(self, inputExposure, refObjLoader=None, dataId=None):
dataId : `dict` or `lsst.daf.butler.DataCoordinate`
The dataId of the exposure (and detector) bright stars should be
extracted from.
skyCorr : `lsst.afw.math.backgroundList.BackgroundList`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,187 @@
# This file is part of pipe_tasks.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused about the addition of this file in the context of this ticket?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, I guess that's just me failing hard at git somehow. Removed it. Sorry!

@@ -134,6 +145,11 @@ class ProcessBrightStarsConfig(pipeBase.PipelineTaskConfig,
" annular flux.",
default=('BAD', 'CR', 'CROSSTALK', 'EDGE', 'NO_DATA', 'SAT', 'SUSPECT', 'UNMASKEDNAN')
)
doApplySkyCorr = pexConfig.Field(
dtype=bool,
doc="Apply sky correction before extracting stars?",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you be a bit more specific about which "sky correction" you are referring to here (even just adding "full focal plane" would help...there...are...just...so...many...!!!)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your update snuck into the bug fix commit 😉

@@ -134,6 +145,11 @@ class ProcessBrightStarsConfig(pipeBase.PipelineTaskConfig,
" annular flux.",
default=('BAD', 'CR', 'CROSSTALK', 'EDGE', 'NO_DATA', 'SAT', 'SUSPECT', 'UNMASKEDNAN')
)
doApplySkyCorr = pexConfig.Field(
dtype=bool,
doc="Apply sky correction before extracting stars?",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your update snuck into the bug fix commit 😉

code extends over the entire focal plane, this can produce
better sky subtraction.
The calexp is updated in-place.
Parameters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need a space after title description.

self.modelStampSize = (int(self.config.stampSize[0]*self.config.modelStampBuffer),
int(self.config.stampSize[1]*self.config.modelStampBuffer))
self.modelStampSize = [int(self.config.stampSize[0]*self.config.modelStampBuffer),
int(self.config.stampSize[1]*self.config.modelStampBuffer)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m fine with this bug fix here and would keep it as it’s own commit, but could you split out the unrelated doc update and add a note in the commit message describing the bug that needed fixing?

The modelStampSize attribute of ProcessBrightStarsTask was created as a
tuple. This led to an error when the stamp size was even on a side,
as a check is immediately made and the entries are changed to ensure
an odd stamp size. This commit makes modelStampSize a list instead.
@MorganSchmitz MorganSchmitz merged commit f54a833 into master Mar 3, 2021
@MorganSchmitz MorganSchmitz deleted the tickets/DM-28600 branch March 3, 2021 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants