Skip to content

Conversation

@isullivan
Copy link
Contributor

Moving a number of cleanups from DM-44936, which is not expected to merge soon.

@BrunoSanchez BrunoSanchez self-requested a review August 12, 2025 15:17
Copy link
Member

@BrunoSanchez BrunoSanchez left a comment

Choose a reason for hiding this comment

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

Some minor comments, but changes look good to me.
It improves the flow of the subtractImages.py file.

doSubtractBackground = lsst.pex.config.Field(
doc="Subtract the background fit when solving the kernel?",
doc="Subtract the background fit when solving the kernel?"
" It is generally better to instead subtract the background in detectAndMeasure.",
Copy link
Member

Choose a reason for hiding this comment

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

Space would go in line 176


def _sourceSelector(self, sources, mask):
def _sourceSelector(self, sources, bbox):
"""Select sources from a catalog that meet the selection criteria.
Copy link
Member

Choose a reason for hiding this comment

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

I think that the docstring doesn't reflect exactly what the method is doing.
What about:

"""Select catalog sources that fall inside the provided bounding box, 
with an edge proximity rejection as configured in `restrictKernelEdgeSources`.
"""

selected = self.sourceSelector.selectSources(sources).selected
if self.config.restrictKernelEdgeSources:
rejectRadius = 2*self.config.makeKernel.kernel.active.kernelSize
bbox.grow(-rejectRadius)
Copy link
Member

Choose a reason for hiding this comment

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

Cool, I didn't know about this.

Comment on lines 521 to 525
try:
try:
Copy link
Member

Choose a reason for hiding this comment

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

Explain better this double try block, and make explicit the logic of this flow control.

@isullivan isullivan merged commit ceab9eb into main Aug 12, 2025
2 checks passed
@isullivan isullivan deleted the tickets/DM-52106 branch August 12, 2025 21:15
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