Coverage for python/lsst/afw/cameraGeom/pupil.py : 81%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
# # LSST Data Management System # Copyright 2017 LSST Corporation. # # This product includes software developed by the # LSST Project (http://www.lsst.org/). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the LSST License Statement and # the GNU General Public License along with this program. If not, # see <http://www.lsstcorp.org/LegalNotices/>. #
"""!Pupil obscuration function. """
"""!Construct a Pupil
@param[in] illuminated 2D numpy array indicating which parts of the pupil plane are illuminated. @param[in] size Size of pupil plane array in meters. Note that this may be larger than the actual diameter of the illuminated pupil to accommodate zero-padding. @param[in] scale Sampling interval of pupil plane array in meters. """
"""!Pupil obscuration function factory for use with Fourier optics. """
"""!Construct a PupilFactory.
@param[in] visitInfo VisitInfo object for a particular exposure. @param[in] pupilSize Size in meters of constructed Pupil array. Note that this may be larger than the actual diameter of the illuminated pupil to accommodate zero-padding. @param[in] npix Constructed Pupils will be npix x npix. """
"""!Calculate a Pupil at a given point in the focal plane.
@param point Point2D indicating focal plane coordinates. @returns Pupil """ "PupilFactory not implemented for this camera")
def _pointLineDistance(p0, p1, p2): """Compute the right-angle distance between the points given by `p0` and the line that passes through `p1` and `p2`.
@param[in] p0 2-tuple of numpy arrays (x,y coords) @param[in] p1 2-tuple of scalars (x,y coords) @param[in] p2 2-tuple of scalars (x,y coords) @returns numpy array of distances; shape congruent to p0[0] """
"""Make a fully-illuminated Pupil.
@returns Pupil """
"""Cut out the interior of a circular region from a Pupil.
@param[in,out] pupil Pupil to modify in place @param[in] p0 2-tuple indicating region center @param[in] r Circular region radius """
"""Cut out the exterior of a circular region from a Pupil.
@param[in,out] pupil Pupil to modify in place @param[in] p0 2-tuple indicating region center @param[in] r Circular region radius """
"""Cut out a ray from a Pupil.
@param[in,out] pupil Pupil to modify in place @param[in] p0 2-tuple indicating ray starting point @param[in] angle Ray angle measured CCW from +x. @param[in] thickness Thickness of cutout """ # the 1 is arbitrary, just need something to define another point on # the line ((self.u - p0[0])*np.cos(angleRad) + (self.v - p0[1])*np.sin(angleRad) >= 0)] = False
"""Center the illuminated portion of the pupil in array.
@param[in,out] pupil Pupil to modify in place """ def center(arr, axis): smash = np.sum(arr, axis=axis) w = np.where(smash)[0] return int(0.5*(np.min(w)+np.max(w))) ycenter = center(pupil.illuminated, 0) xcenter = center(pupil.illuminated, 1) ytarget = pupil.illuminated.shape[0]//2 xtarget = pupil.illuminated.shape[1]//2 pupil.illuminated = np.roll(np.roll(pupil.illuminated, xtarget-xcenter, axis=0), ytarget-ycenter, axis=1) |