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-30738: Backport gen3 imSim BF-kernels for gen2 #187

Merged
merged 1 commit into from
Jun 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions python/lsst/ip/isr/isrTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,15 +1147,15 @@ def readIsrData(self, dataRef, rawExposure):
except NoResults:
try: # Fall back to the old-style numpy-ndarray style kernel if necessary.
brighterFatterKernel = dataRef.get("bfKernel")
self.log.info("Old style brighter-fatter kernel (np.array) loaded")
self.log.info("Old style brighter-fatter kernel (bfKernel) loaded")
except NoResults:
brighterFatterKernel = None
if brighterFatterKernel is not None and not isinstance(brighterFatterKernel, numpy.ndarray):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of the changes (except for the log message above) is protected by this if check. This means if we received a numpy array (which is the case for HSC), then this section is skipped. All of the other changes to support new brighter-fatter kernels has been done in gen3, which uses the runQuantum method to check and restructure calibrations. When we switch fully to gen3, this method will be removed, as it's only called in gen2.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, that's what I was missing...thanks for the explanation!

# If the kernel is not an ndarray, it's the cp_pipe version
# so extract the kernel for this detector, or raise an error
if self.config.brighterFatterLevel == 'DETECTOR':
if brighterFatterKernel.detectorKernel:
brighterFatterKernel = brighterFatterKernel.detectorKernel[ccd.getId()]
if brighterFatterKernel.detKernels:
brighterFatterKernel = brighterFatterKernel.detKernels[ccd.getName()]
else:
raise RuntimeError("Failed to extract kernel from new-style BF kernel.")
else:
Expand Down