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-12985: Interpolate before applying B-F correction. #104

Merged
merged 3 commits into from Dec 19, 2017

Conversation

TallJimbo
Copy link
Member

Interpolation can only be done on flat-fielded images, so we apply
(and later remove) both that and the dark (for good measure) before
running B-F.

self.maskAndInterpNan(ccdExposure)
interpolationDone = True

# Undo flat and dark application
Copy link
Contributor

Choose a reason for hiding this comment

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

Doing and then undoing suggests using a context manager to simplify the main code path.


if self.config.doDefect:
if self.config.doDefect and not interpolationDone:
self.maskAndInterpDefect(ccdExposure, defects)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why leave this here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Where would I move it instead? I think it's the right place to do defect interpolation if you're not running brighter-fatter (or at least one of several right places, and it's the old one).

Copy link
Contributor

Choose a reason for hiding this comment

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

It took me a while to figure out that not interpolationDone effectively means not self.config.doBrighterFatter. In that case, I think you're right.

self.saturationInterpolation(ccdExposure)

if self.config.doFringe:
self.fringe.runDataRef(ccdExposure, sensorRef)
if self.config.doSetBadRegions:
self.setBadRegions(ccdExposure)

self.maskAndInterpNan(ccdExposure)
if not interpolationDone:
self.maskAndInterpNan(ccdExposure)
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 we want this to fire always --- there might be zeros in the flat.

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'm planning to go with @RobertLuptonTheGood's proposal to make this a config option but disable it by default.

@RobertLuptonTheGood
Copy link
Member

RobertLuptonTheGood commented Dec 18, 2017 via email

@PaulPrice
Copy link
Contributor

I don't want to test for it either, but I think it's important we can deal with any NaNs they cause.

@RobertLuptonTheGood
Copy link
Member

RobertLuptonTheGood commented Dec 18, 2017 via email

Interpolation can only be done on flat-fielded images, so we apply
(and later remove) both that and the dark (for good measure) before
running B-F.
@TallJimbo TallJimbo merged commit 23f34b2 into master Dec 19, 2017
PaulPrice pushed a commit to HyperSuprime-Cam/obs_subaru that referenced this pull request Dec 19, 2017
DM-12985: Interpolate before applying B-F correction.
@ktlim ktlim deleted the tickets/DM-12985 branch August 25, 2018 06:45
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