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

Tickets/dm 15203 #63

Merged
merged 3 commits into from Oct 13, 2018
Merged

Tickets/dm 15203 #63

merged 3 commits into from Oct 13, 2018

Conversation

RobertLuptonTheGood
Copy link
Member

No description provided.

Copy link
Contributor

@PaulPrice PaulPrice left a comment

Choose a reason for hiding this comment

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

Some small comments.

@@ -172,7 +173,7 @@ class IsrTaskConfig(pexConfig.Config):
"or number of spline knots if overscan fit type is a spline."),
default=1,
)
overscanRej = pexConfig.Field(
overscanNumSigmaClip = pexConfig.Field(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this change and the addition of MEANCLIP should be in their own commits, not hidden in a "modernisation" commit.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll restructure the commits.

@@ -937,7 +939,7 @@ def overscanCorrection(self, exposure, amp):
overscanImage=overscanImage,
fitType=self.config.overscanFitType,
order=self.config.overscanOrder,
collapseRej=self.config.overscanRej,
statControl=sctrl,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this change belongs in the next commit.

@@ -934,6 +934,9 @@ def overscanCorrection(self, exposure, amp):
dataView = maskedImage.Factory(maskedImage, amp.getRawDataBBox())
overscanImage = maskedImage.Factory(maskedImage, amp.getRawHorizontalOverscanBBox())

sctrl = afwMath.StatisticsControl()
sctrl.setNumSigmaClip(self.config.overscanNumSigmaClip)
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 clear to me why passing a StatisticsControl object into overscanCorrection is better than passing in a rejection threshold: it doesn't add any information (or are you thinking to expand its use?), so the rejection threshold is more fundamental. It's like passing a Struct consisting of a single value.
Convince me?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that the API in isrFunctions should support the StatisticsControl as the user can set other options (e.g. masks to ignore); indeed, we could then add them to IsrTask without modifying the API

if fitType in ('MEDIAN',):
# we need an image with integer pixels to handle ties properly
if hasattr(overscanImage, "image"):
imageI = overscanImage.image.convertI()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth including a check that the data is indeed integer that has been converted to floating-point? Might someone want to run an overscan correction on an image that has floating-point values (maybe some other operation has been performed before the overscan correction)?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll add an argument (default True) to allow the conversion to int. But I don't think anyone would/should ever want to run overscan estimation on processed data.

N.b. renamed overscanRej config parameter to overscanNumSigmaClip;
a better name and used for MEANCLIP too
Even if the overscan image is floating, it's really ints with lots of
ties which must be handled carefully to get sub-integer precision.

You should never estimate overscan on "real" floating images, but
there's an option to prevent the conversion to int in case you do
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