Coverage for python/lsst/obs/test/testCamera.py : 100%

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
# This file is part of obs_test. # # Developed for the LSST Data Management System. # This product includes software developed by the LSST Project # (http://www.lsst.org). # See the COPYRIGHT file at the top-level directory of this distribution # for details of code ownership. # # 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 GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. #
"""A simple test Camera
There is one ccd with name "0" It has four amplifiers with names "00", "01", "10", and "11"
The camera is modeled after a small portion of the LSST sim Summer 2012 camera: a single detector with four amplifiers, consisting of raft 2,2 sensor 0,0, half of channels 0,0 0,1 1,0 and 1,1 (the half closest to the Y centerline)
Note that the Summer 2012 camera has one very weird feature: the bias region (rawHOverscanBbox) is actually a prescan (appears before the data pixels).
A raw image has the sky in the same orientation on all amplifier subregions, so no amplifier subregions need their pixels to be flipped.
Standard keys are: amp: amplifier number: one of 00, 01, 10, 11 ccd: ccd number: always 0 visit: exposure number; test data includes one exposure with visit=1 """
"""Construct a TestCamera """ # Radial distortion is modeled as a radial polynomial that converts from focal plane (in mm) # to field angle (in radians). Thus the coefficients are: # C0: always 0, for continuity at the center of the focal plane; units are rad # C1: 1/plateScale; units are rad/mm # C2: usually 0; units are rad/mm^2 # C3: radial distortion; units are rad/mm^3 {cameraGeom.FIELD_ANGLE: focalPlaneToFieldAngle})
"""Make a list of detectors
@param[in] focalPlaneToFieldAngle An lsst.afw.geom.TransformPoint2ToPoint2 that transforms from FOCAL_PLANE to FIELD_ANGLE coordinates in the forward direction @return a list of detectors (lsst.afw.cameraGeom.Detector) """
"""Make a list of detector configs
@return a list of detector configs (lsst.afw.cameraGeom.DetectorConfig) """ # this camera has one detector that corresponds to a subregion of lsstSim detector R:2,2 S:0,0 # with lower left corner 0, 1000 and dimensions 1018 x 2000 # i.e. half of each of the following channels: 0,0, 0,1, 1,0 and 1,1
"""Construct an amplifier info catalog
The LSSTSim S12 amplifiers are unusual in that they start with 4 pixels of usable bias region (which is used to set rawHOverscanBbox, despite the name), followed by the data. There is no other underscan or overscan. """
# amplifier gain (e-/ADU) and read noiuse (ADU/pixel) from lsstSim raw data # note that obs_test amp <ampX><ampY> = lsstSim amp C<ampY>,<ampX> (axes are swapped) (0, 0): 1.7741, # C0,0 (0, 1): 1.65881, # C1,0 (1, 0): 1.74151, # C0,1 (1, 1): 1.67073, # C1,1 }[(ampX, ampY)] (0, 0): 3.97531706217237, # C0,0 (0, 1): 4.08263755342685, # C1,0 (1, 0): 4.02753931932633, # C0,1 (1, 1): 4.1890610691135, # C1,1 }[(ampX, ampY)] afwGeom.Point2I(ampX * xDataExtent, ampY * yDataExtent), afwGeom.Extent2I(xDataExtent, yDataExtent), ))
# bias region (which is prescan, in this case) is before the data
afwGeom.Point2I(x0Raw, y0Raw), afwGeom.Extent2I(xRawExtent, yRawExtent), )) afwGeom.Point2I(x0Data, y0Raw), afwGeom.Extent2I(xDataExtent, yDataExtent), )) afwGeom.Point2I(x0Bias, y0Raw), afwGeom.Extent2I(xBiasExtent, yRawExtent), )) |