Skip to content

Commit

Permalink
Add integer detector ID label to cameraGeom plots
Browse files Browse the repository at this point in the history
Currently, the plots are only labeled with the detector's name
as returned by detector.getName().  Many users prefer identifying
detectors by their integer values as returned by detector.getId()
Let's have both!
  • Loading branch information
laurenam committed Nov 2, 2024
1 parent 9e67688 commit b561832
Showing 1 changed file with 3 additions and 2 deletions.
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())
display.dot(ccdLabel, bbox.getMinX() + dims.getX()/2, bbox.getMinY() + dims.getY()/2,
ctype=ctype, size=textSize, textAngle=nQuarter*90)

return cameraImage
Expand Down

0 comments on commit b561832

Please sign in to comment.