Skip to content

Commit

Permalink
Merge pull request #579 from lsst/tickets/DM-23694
Browse files Browse the repository at this point in the history
DM-23694: Create script for producing distortion model from Jointcal output
  • Loading branch information
parejkoj committed Apr 21, 2021
2 parents 56632e8 + c0ea534 commit f21da11
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion python/lsst/afw/cameraGeom/_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@

__all__ = ['Camera']

import numpy as np
from lsst.utils import continueClass, doImport
from ._cameraGeom import Camera
from ._cameraGeom import Camera, FOCAL_PLANE


@continueClass # noqa: F811 (FIXME: remove for py 3.8+)
Expand Down Expand Up @@ -52,3 +53,18 @@ def getPupilFactory(self, visitInfo, pupilSize, npix, **kwargs):
def telescopeDiameter(self):
cls = doImport(self.getPupilFactoryName())
return cls.telescopeDiameter

def computeMaxFocalPlaneRadius(self):
"""Compute the maximum radius on the focal plane of the corners of all
detectors in this camera.
Returns
-------
focalRadius : `float`
Maximum focal plane radius in FOCAL_PLANE units (mm).
"""
radii = []
for detector in self:
for corner in detector.getCorners(FOCAL_PLANE):
radii.append(np.hypot(*corner))
return np.max(radii)

0 comments on commit f21da11

Please sign in to comment.