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-29326: Fix logic of the doVignette option in isrTask #203

Merged
merged 5 commits into from Dec 1, 2021
Merged

Conversation

czwa
Copy link
Contributor

@czwa czwa commented Nov 11, 2021

Logic changed, and masking function updated so it can be used generically.

"""
ConfigClass = VignetteConfig
_DefaultName = "isrVignette"

def run(self, exposure):
def run(self, exposure=None, doUpdateMask=True, maskPlane="NO_DATA", vignetteValue=None, log=None):
"""Generate circular vignette pattern.

Parameters
----------
exposure : `lsst.afw.image.Exposure`
Copy link
Contributor

Choose a reason for hiding this comment

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

This exposure parameter seems now optional, so it should be indicated as such in the doc string. In addition, the new parameters should also be documented in the docstring.

def setValidPolygonCcdIntersect(ccdExposure, fpPolygon, log=None):
"""Set valid polygon on ccdExposure associated with focal plane polygon.

Where the ccd exposure's valid polygon is considered the intersection of
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe rephrase a bit with something like: "The CCD exposure's valid polygon is defined as the intersection of ... "

@@ -859,9 +857,21 @@ class IsrTaskConfig(pipeBase.PipelineTaskConfig,
# Vignette correction configuration.
doVignette = pexConfig.Field(
dtype=bool,
doc="Apply vignetting parameters?",
doc="Compute and attach validPolygon to exposure according to vignetting parameters?",
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not that clear here if a "validPolygon" is some sort of formal type, or if it is defined as something else. I know we should try to be concise here, but if possible, perhaps you could add a few more phrases to explain what "validPolygon" is for someone who looks at this doc.

)
vignetteValue = pexConfig.Field(
dtype=float,
doc="Value to replance image array pixels with in the vingetted region? Ignored if None.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: "vingetted"

Copy link
Contributor

Choose a reason for hiding this comment

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

Totally inherited from me...sorry! And I'm also questioning my decision to add a question mark here!

@laurenam
Copy link
Contributor

Hey Chris, just in case you haven't noted this already, you may want to remove the WIP: from the summary of any commit messages that are indeed getting merged (i.e. no longer WIP!)

laurenam and others added 5 commits November 29, 2021 15:38
There's no point in continuing if the filter list is empty.
 - Fix docstrings.
 - Make a missing polygon do no masking instead of full masking.
 - Update logging method.
This is now ignored and deprecated, so it will warn.  This should help
track down any existing cases where it's used.
@czwa czwa merged commit 4a3d635 into main Dec 1, 2021
@czwa czwa deleted the tickets/DM-29326 branch December 1, 2021 19:10
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

3 participants