-
Notifications
You must be signed in to change notification settings - Fork 9
DM-49378: Trim totalBox to destination warped bbox in getTemplate #388
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
Conversation
This should significantly cut memory usage, as it will only make unwarped exposures as large as necessary, not multiple patches in size.
This is necessary to use the dataId as a dict key.
f9abf59 to
5a96106
Compare
isullivan
left a comment
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.
The code looks good. I don't have any requested changes.
|
|
||
| catalogs.append(catalog) | ||
| warped[tract] = potentialInput | ||
| warped[tract].setWcs(wcs) |
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.
Was this line unnecessary, because it's set in _merge?
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.
Yes, the merged result has the wcs when it is created.
| maskedImages, catalog, totalBox = self._makeExposureCatalog(coaddExposureHandles[tract], | ||
| dataIds[tract]) | ||
| warpedBox = computeWarpedBBox(catalog[0].wcs, bbox, wcs) | ||
| warpedBox.grow(5) # to ensure we catch all relevant input pixels |
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.
My understanding of computeWarpedBBox is that that already errs on the side of a larger box, so growing it here is probably unnecessary. That said, an extra 5 pixels shouldn't make much of a difference, and it will still be fewer pixels than before.
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 found that without growing the box by a few pixels, the corners in the tests weren't correct, so I decided to be a bit generous here.
python/lsst/ip/diffim/getTemplate.py
Outdated
|
|
||
| catalogs.append(catalog) | ||
| # Trim the exposure catalog to just the patches that were used. | ||
| temp = afwTable.ExposureCatalog(self.schema) |
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 use something like tempCatalog instead of just temp for the variable name.
We can trim the exposure catalog to only include patches that were used, thus reducing the number of entries in the final CoaddPsf.
ad68e1c to
ff976f6
Compare
No description provided.