Skip to content
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-47344: Update plotting in cameraGeom to add integer detector ID label #751

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions python/lsst/afw/cameraGeom/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ def showCcd(ccd, imageSource=FakeImageDataSource(), display=None, overlay=True,
if inCameraCoords:
nQuarter = ccd.getOrientation().getNQuarter()
ccdImage = afwMath.rotateImageBy90(ccdImage, nQuarter)
title = ccd.getName()
title = "{} [{}]".format(ccd.getName(), ccd.getId())
if isTrimmed:
title += "(trimmed)"

Expand Down Expand Up @@ -1022,7 +1022,8 @@ def showCamera(camera, imageSource=FakeImageDataSource(), imageFactory=afwImage.
displayUtils.drawBBox(
bbox, borderWidth=0.5, ctype=ctype, display=display)
dims = bbox.getDimensions()
display.dot(ccd.getName(), bbox.getMinX() + dims.getX()/2, bbox.getMinY() + dims.getY()/2,
ccdLabel = "{}\n[{}]".format(ccd.getName(), ccd.getId())
Copy link

Choose a reason for hiding this comment

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

I guess it doesn't matter much, but was it on purpose that showCcd has {} [{}] and showCamera has {}\n[{}] ( the detId below rather than next to detName )?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, it was. The one above is a plot "title", so just keeping it in one line seems preferable. For the focal plane labels, we don't have a lot of horizontal real estate, hence the newline.

display.dot(ccdLabel, bbox.getMinX() + dims.getX()/2, bbox.getMinY() + dims.getY()/2,
ctype=ctype, size=textSize, textAngle=nQuarter*90)

return cameraImage
Expand Down
Loading