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-29310: GetMultiTractCoaddTemplateTask for multi-tract image difference task #194
Conversation
b997852
to
f026095
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks fine, and I like how this can be written using Gen 3. I will write up my broader concern on the Jira ticket.
python/lsst/ip/diffim/getTemplate.py
Outdated
|
||
__all__ = ["GetCoaddAsTemplateTask", "GetCoaddAsTemplateConfig", | ||
"GetCalexpAsTemplateTask", "GetCalexpAsTemplateConfig"] | ||
"GetCalexpAsTemplateTask", "GetCalexpAsTemplateConfig", | ||
"GetMultiTractCoaddTemplateTask", "GetMultiTractCoaddTemplateTask"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"GetMultiTractCoaddTemplateTask"
appears twice, no "GetMultiTractCoaddTemplateConfig"
self.warp.warpingKernelName = 'lanczos5' | ||
self.coaddPsf.warpingKernelName = 'lanczos5' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why lanczos5 and not lanczos3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DRP uses lanczos5 for CoaddPsfs during deep coaddition because DM-17429. Option is either to put this config here slowing down AP slightly or put it in the obs_package DPR.yaml. Either is fine with me. Both I and Tanaka-san found that warping with 5 only takes 5% longer: DM-18295
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to put this here. If needed in AP, we can downgrade it in the APpipe config.
python/lsst/ip/diffim/getTemplate.py
Outdated
|
||
Parameters | ||
---------- | ||
inputs : dict of task Inputs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put dict
in backticks
python/lsst/ip/diffim/getTemplate.py
Outdated
|
||
Returns | ||
------- | ||
coaddExposures : list of DeferredDatasetHandles to `lsst.afw.image.Exposure` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please expand this to lsst.daf.butler.DeferredDatasetHandle
, and put in backticks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a Raises section to document the case when pipeBase.NoWorkFound
is raised.
result : `struct` | ||
return a pipeBase.Struct: | ||
- ``outputExposure`` : a template coadd exposure assembled out of patches | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a Raises section to document the pipeBase.NoWorkFound
and RuntimeError
if nPatchesFound == 0: | ||
raise pipeBase.NoWorkFound("No patches found to overlap detector") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this case be caught by the check in getOverlappingExposures
above?
templateExposure.setFilterLabel(coaddPatch.getFilterLabel()) | ||
templateExposure.setPhotoCalib(coaddPatch.getPhotoCalib()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably unimportant, but note that this code grabs the filter label and photocalib from the last patch that was processed, while the single-tract version of getTemplate
gets it from the first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because "band" is in the dimensions of the 'coaddExposures' inputs, they are guaranteed to be the same. Will add inline comments explaining.
I forgot to add, please edit the message printed with the RuntimeError on line 177 to point users to the new Task, instead of just printing that multiple tracts are not yet supported. |
python/lsst/ip/diffim/getTemplate.py
Outdated
warped = self.warper.warpExposure(finalWcs, coaddPatch, maxBBox=finalBBox) | ||
|
||
# Check if warped image is viable | ||
if warped.getBBox().getArea() == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When working with what I believe is very similar code, this check didn't trigger when there wasn't overlap, but adding or not np.any(np.isfinite(warped.getImage().array))
worked to check that it wasn't a viable warped image and should be skipped.
d581380
to
b22ab35
Compare
warps coadds from multiple tracts onto detector geometry
b22ab35
to
a46130a
Compare
GetMultiTractCoaddTemplateTask warps coadds from multiple tracts onto detector geometry