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-26316: Allow bias generation to retain overscan signal #151

Merged
merged 2 commits into from Aug 18, 2020

Conversation

czwa
Copy link
Contributor

@czwa czwa commented Aug 14, 2020

Add option to reverse Bias and Overscan correction ordering.

Copy link
Member

@RobertLuptonTheGood RobertLuptonTheGood left a comment

Choose a reason for hiding this comment

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

Looks good. Please look at my comment re isr.doBiasBeforeOverscan

@@ -1325,6 +1330,12 @@ def run(self, ccdExposure, camera=None, bias=None, linearizer=None,
self.log.info("Converting exposure to floating point values.")
ccdExposure = self.convertIntToFloat(ccdExposure)

if self.config.doBias and self.config.doBiasBeforeOverscan:
self.log.info("Applying bias correction.")
isrFunctions.biasCorrection(ccdExposure.getMaskedImage(), bias.getMaskedImage(),

Choose a reason for hiding this comment

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

We decided not to add protocol numbers for now, so I thought we were relying on the sizes of the biases to detect whether the master biases were built with isr.doOverscan=False isr.doAssembleCcd=False isr.doBiasBeforeOverscan=True. If that's right, wouldn't config.doTrimToMatchCalib defeat the check? Maybe validate should check that it's not set with isr.doBiasBeforeOverscan

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are not relying on the sizes to detect the master bias construction. The configuration files for constructBias.py and runIsr.py/processCcd.py have to be consistent for now. I've added the check in validate, because although we don't do automatic detection, those two config options should be mutually exclusive.

Choose a reason for hiding this comment

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

Will it fail if the sizes don't match? If so, maybe we could have a more helpful error message

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The isrFunctions.biasCorrection raises with a message if the bounding boxes do not match:

raise RuntimeError("maskedImage bbox %s != biasMaskedImage bbox %s" %
                           (maskedImage.getBBox(afwImage.LOCAL), biasMaskedImage.getBBox(afwImage.LOCAL)))

@czwa czwa merged commit f3ab18e into master Aug 18, 2020
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