Skip to content

Conversation

@parejkoj
Copy link
Contributor

No description provided.

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.
Copy link
Contributor

@isullivan isullivan left a 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)
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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.

Copy link
Contributor Author

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.


catalogs.append(catalog)
# Trim the exposure catalog to just the patches that were used.
temp = afwTable.ExposureCatalog(self.schema)
Copy link
Contributor

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.
@parejkoj parejkoj merged commit 208c678 into main Mar 15, 2025
2 checks passed
@parejkoj parejkoj deleted the tickets/DM-49378 branch March 15, 2025 16:05
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.

2 participants