LSSTApplications  8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
LSSTDataManagementBasePackage
Functions | Variables
lsst.afw.cameraGeom.cameraFactory Namespace Reference

Functions

def makeDetector
 
def makeOrientation
 
def makeTransformDict
 
def makeCameraFromPath
 
def makeCameraFromCatalogs
 

Variables

list __all__ = ["makeCameraFromPath", "makeCameraFromCatalogs", "makeDetector"]
 
list cameraSysList = [PUPIL, FOCAL_PLANE, PIXELS, TAN_PIXELS, ACTUAL_PIXELS]
 
tuple cameraSysMap = dict((sys.getSysName(), sys) for sys in cameraSysList)
 

Function Documentation

def lsst.afw.cameraGeom.cameraFactory.makeCameraFromCatalogs (   cameraConfig,
  ampInfoCatDict 
)
Construct a camera (lsst.afw.cameraGeom Camera)

@param[in] cameraConfig: an instance of CameraConfig
@param[in] ampInfoCatDict: a dictionary keyed on the detector name of AmpInfoCatalog objects
@return camera (an lsst.afw.cameraGeom.Camera)

Definition at line 97 of file cameraFactory.py.

97 
98 def makeCameraFromCatalogs(cameraConfig, ampInfoCatDict):
99  """Construct a camera (lsst.afw.cameraGeom Camera)
100 
101  @param[in] cameraConfig: an instance of CameraConfig
102  @param[in] ampInfoCatDict: a dictionary keyed on the detector name of AmpInfoCatalog objects
103  @return camera (an lsst.afw.cameraGeom.Camera)
104  """
105  nativeSys = cameraSysMap[cameraConfig.transformDict.nativeSys]
106  transformDict = makeTransformDict(cameraConfig.transformDict.transforms)
107  focalPlaneToPupil = transformDict[PUPIL]
108  transformMap = CameraTransformMap(nativeSys, transformDict)
109 
110  detectorList = []
111  for detectorConfig in cameraConfig.detectorList.itervalues():
112  ampInfoCatalog = ampInfoCatDict[detectorConfig.name]
113 
114  detectorList.append(makeDetector(
115  detectorConfig = detectorConfig,
116  ampInfoCatalog = ampInfoCatalog,
117  focalPlaneToPupil = focalPlaneToPupil,
118  plateScale = cameraConfig.plateScale,
119  ))
120 
121  return Camera(cameraConfig.name, detectorList, transformMap)
def lsst.afw.cameraGeom.cameraFactory.makeCameraFromPath (   cameraConfig,
  ampInfoPath,
  shortNameFunc 
)
Construct a camera (lsst.afw.cameraGeom Camera)

@param[in] cameraConfig: an instance of CameraConfig
@param[in] ampInfoPath: path to ampInfo data files
@param[in] shortNameFunc: a function that converts a long detector name to a short one
@return camera (an lsst.afw.cameraGeom.Camera)

Definition at line 80 of file cameraFactory.py.

80 
81 def makeCameraFromPath(cameraConfig, ampInfoPath, shortNameFunc):
82  """Construct a camera (lsst.afw.cameraGeom Camera)
83 
84  @param[in] cameraConfig: an instance of CameraConfig
85  @param[in] ampInfoPath: path to ampInfo data files
86  @param[in] shortNameFunc: a function that converts a long detector name to a short one
87  @return camera (an lsst.afw.cameraGeom.Camera)
88  """
89  ampInfoCatDict = dict()
90  for detectorConfig in cameraConfig.detectorList.itervalues():
91  shortName = shortNameFunc(detectorConfig.name)
92  ampCatPath = os.path.join(ampInfoPath, shortName + ".fits")
93  ampInfoCatalog = AmpInfoCatalog.readFits(ampCatPath)
94  ampInfoCatDict[detectorConfig.name] = ampInfoCatalog
95 
96  return makeCameraFromCatalogs(cameraConfig, ampInfoCatDict)
def lsst.afw.cameraGeom.cameraFactory.makeDetector (   detectorConfig,
  ampInfoCatalog,
  focalPlaneToPupil,
  plateScale 
)
Make a detector object:

@param detectorConfig -- config for this detector (an lsst.pex.config.Config)
@param ampInfoCatalog -- amplifier information for this detector (an lsst.afw.table.AmpInfoCatalog)
@param focalPlaneToPupil -- FOCAL_PLANE to PUPIL XYTransform
@param plateScale -- nominal plate scale (arcsec/mm)
@return detector (an lsst.afw.cameraGeom.Detector)

Definition at line 14 of file cameraFactory.py.

14 
15 def makeDetector(detectorConfig, ampInfoCatalog, focalPlaneToPupil, plateScale):
16  """Make a detector object:
17 
18  @param detectorConfig -- config for this detector (an lsst.pex.config.Config)
19  @param ampInfoCatalog -- amplifier information for this detector (an lsst.afw.table.AmpInfoCatalog)
20  @param focalPlaneToPupil -- FOCAL_PLANE to PUPIL XYTransform
21  @param plateScale -- nominal plate scale (arcsec/mm)
22  @return detector (an lsst.afw.cameraGeom.Detector)
23  """
24  orientation = makeOrientation(detectorConfig)
25  pixelSizeMm = afwGeom.Extent2D(detectorConfig.pixelSize_x, detectorConfig.pixelSize_y)
26  transforms = makeTransformDict(detectorConfig.transformDict.transforms)
27  transforms[FOCAL_PLANE] = orientation.makePixelFpTransform(pixelSizeMm)
28 
29  llPoint = afwGeom.Point2I(detectorConfig.bbox_x0, detectorConfig.bbox_y0)
30  urPoint = afwGeom.Point2I(detectorConfig.bbox_x1, detectorConfig.bbox_y1)
31  bbox = afwGeom.Box2I(llPoint, urPoint)
32 
33  tanPixSys = CameraSys(TAN_PIXELS, detectorConfig.name)
34  transforms[tanPixSys] = makePixelToTanPixel(
35  bbox = bbox,
36  orientation = orientation,
37  focalPlaneToPupil = focalPlaneToPupil,
38  pixelSizeMm = pixelSizeMm,
39  plateScale = plateScale,
40  )
41 
42  return Detector(
43  detectorConfig.name,
44  detectorConfig.id,
45  detectorConfig.detectorType,
46  detectorConfig.serial,
47  bbox,
48  ampInfoCatalog,
49  orientation,
50  pixelSizeMm,
51  transforms,
52  )
An integer coordinate rectangle.
Definition: Box.h:53
def lsst.afw.cameraGeom.cameraFactory.makeOrientation (   detectorConfig)
Make an instance of an Orientation class

@param detectorConfig -- config for this detector (an lsst.pex.config.Config)
@return orientation (an lsst.afw.cameraGeom.Orientation)

Definition at line 53 of file cameraFactory.py.

53 
54 def makeOrientation(detectorConfig):
55  """Make an instance of an Orientation class
56 
57  @param detectorConfig -- config for this detector (an lsst.pex.config.Config)
58  @return orientation (an lsst.afw.cameraGeom.Orientation)
59  """
60  offset = afwGeom.Point2D(detectorConfig.offset_x, detectorConfig.offset_y)
61  refPos = afwGeom.Point2D(detectorConfig.refpos_x, detectorConfig.refpos_y)
62  yaw = afwGeom.Angle(detectorConfig.yawDeg, afwGeom.degrees)
63  pitch = afwGeom.Angle(detectorConfig.pitchDeg, afwGeom.degrees)
64  roll = afwGeom.Angle(detectorConfig.rollDeg, afwGeom.degrees)
65  return Orientation(offset, refPos, yaw, pitch, roll)
def lsst.afw.cameraGeom.cameraFactory.makeTransformDict (   transformConfigDict)
Make a dictionary of CameraSys: XYTransform.

@param transformConfigDict -- an lsst.pex.config.ConfigDictField from an XYTransform registry;
    keys are camera system names.
@return a dict of CameraSys or CameraSysPrefix: XYTransform

Definition at line 66 of file cameraFactory.py.

66 
67 def makeTransformDict(transformConfigDict):
68  """Make a dictionary of CameraSys: XYTransform.
69 
70  @param transformConfigDict -- an lsst.pex.config.ConfigDictField from an XYTransform registry;
71  keys are camera system names.
72  @return a dict of CameraSys or CameraSysPrefix: XYTransform
73  """
74  resMap = dict()
75  if transformConfigDict is not None:
76  for key in transformConfigDict:
77  transform = transformConfigDict[key].transform.apply()
78  resMap[CameraSys(key)] = transform
79  return resMap

Variable Documentation

list lsst.afw.cameraGeom.cameraFactory.__all__ = ["makeCameraFromPath", "makeCameraFromCatalogs", "makeDetector"]

Definition at line 9 of file cameraFactory.py.

list lsst.afw.cameraGeom.cameraFactory.cameraSysList = [PUPIL, FOCAL_PLANE, PIXELS, TAN_PIXELS, ACTUAL_PIXELS]

Definition at line 11 of file cameraFactory.py.

tuple lsst.afw.cameraGeom.cameraFactory.cameraSysMap = dict((sys.getSysName(), sys) for sys in cameraSysList)

Definition at line 12 of file cameraFactory.py.