Skip to content

Commit

Permalink
Remove unneeded iteration.
Browse files Browse the repository at this point in the history
  • Loading branch information
czwa committed Aug 18, 2023
1 parent d5a8ca0 commit 04d6015
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions python/lsst/analysis/tools/actions/plot/focalPlanePlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,25 +336,25 @@ def makePlot(

for detectorId in detectorIds:
detector = camera[detectorId]

# We can go stright to fp coordinates.
corners = [(c.getX(), c.getY()) for c in detector.getCorners(FOCAL_PLANE)]
corners = np.array(corners)

# See if the plot bounding box needs to be extended:
for corner in corners:
if corner[0] < plotLimit_x[0]:
plotLimit_x[0] = corner[0]
if corner[0] > plotLimit_x[1]:
plotLimit_x[1] = corner[0]
if corner[1] < plotLimit_y[0]:
plotLimit_y[0] = corner[1]
if corner[1] > plotLimit_y[1]:
plotLimit_y[1] = corner[1]

# U/V coordinates represent focal plane locations.
minU, minV = corners.min(axis=0)
maxU, maxV = corners.max(axis=0)

# See if the plot bounding box needs to be extended:
if minU < plotLimit_x[0]:
plotLimit_x[0] = minU
if minV < plotLimit_y[0]:
plotLimit_y[0] = minV
if maxU > plotLimit_x[1]:
plotLimit_x[1] = maxU
if maxV > plotLimit_y[1]:
plotLimit_y[1] = maxV

# X/Y coordinates represent detector internal coordinates.
# Detector extent in detector coordinates
minX, minY = detector.getBBox().getMin()
Expand Down

0 comments on commit 04d6015

Please sign in to comment.