Skip to content

Conversation

@isullivan
Copy link
Contributor

No description provided.

Copy link
Contributor

@laurenam laurenam left a comment

Choose a reason for hiding this comment

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

Just a few comments/questions. Also, please have a relook at test_diffractionSpikeMask.py to make sure you think this is effectively/adequately getting probed there.

Also, I think this assumes the diffraction is always aligned with the detector. Is that a save assumption in general?

distance : `float`
The distance by which the point is outside the box, or 0 if it is
inside.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worth mentioning units (bbox pixels) in the docstrings?

x1, y1 = bbox.getEnd()
dx = 0 if x0 <= x <= x1 else min(abs(x0 - x), abs(x - x1))
dy = 0 if y0 <= y <= y1 else min(abs(y0 - y), abs(y - y1))
return max(dx, dy)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure you want max here?

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, if the source is too far away in either x or y, the diffraction spike will miss the image.

return refCat[bright][spikeCandidates].copy(deep=True)

def selectSources(self, xvals, yvals, mask):
def selectSources(self, xvals, yvals, mask, radii):
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to add radii to the Parameters list (especially as the name is really not an unambiguous descriptor for what it represents...is it really something like brightStarMaskRadii?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I'll change the name.

else:
candidates[i] = True
# If the candidate bright source is off the image, only make a
# model for it if the diffraction spikes are long enough
Copy link
Contributor

Choose a reason for hiding this comment

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

Period at end of sentence.

@isullivan
Copy link
Contributor Author

Also, I think this assumes the diffraction is always aligned with the detector. Is that a save assumption in general?

The alignment is controlled by the diffractAngle config parameter, which is then assumed to be fixed. The value of the config happens to be correct for LSSTCam, ComCam, HSC, and DECam, but in principle it could be a different value for a different camera - in that case the user would need to set the config. A telescope with a rotating focal plane would break the assumption.

@isullivan
Copy link
Contributor Author

Good call on the unit tests! I spent the afternoon writing a new unit test, and it uncovered a subtle bug.

@isullivan isullivan merged commit 8d12508 into main Nov 8, 2025
4 checks passed
@isullivan isullivan deleted the tickets/DM-53170 branch November 8, 2025 04:14
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.

3 participants