def createDetector(nAmpX, nAmpY, nPixX, nPixY, pre, hOscan, vOscan, ext, isPerAmp): '''!Fill ampInfo tables \param[in] nAmpX -- Number of amps in the x direction \param[in] nAmpY -- Number of amps in the y direction \param[in] nPixX -- Number of pixels in the amp in the x direction \param[in] nPixY -- Number of pixels in the amp in the y direction \param[in] pre -- Number of prescan rows \param[in] hOscan -- Number of horizontal overscan columns \param[in] vOscan -- Number of vertical overscan rows \param[in] ext -- Number of pixels in the extended register \param[in] isPerAmp -- Are the raw amp data in separate images? \return an lsst.afw.cameraGeom.Detector object ''' schema = afwTable.AmpInfoTable.makeMinimalSchema() ampCatalog = afwTable.AmpInfoCatalog(schema) flipy = True for iy in range(nAmpY): flipy = not flipy flipx = True for ix in range(nAmpX): flipx = not flipx record = ampCatalog.addNew() populateAmpBoxes(nPixX, nPixY, pre, hOscan, vOscan, ext, flipx, flipy, ix, iy, isPerAmp, record) record.setGain(ix + iy * nAmpX + 1.) detConfig = DetectorConfig() detConfig.name = 'TestDetector' detConfig.id = 0 detConfig.bbox_x0 = 0 detConfig.bbox_y0 = 0 detConfig.bbox_x1 = nAmpX * nPixX - 1 detConfig.bbox_y1 = nAmpY * nPixY - 1 detConfig.detectorType = 0 #Science type detConfig.serial = 'THX1138' detConfig.offset_x = 0. detConfig.offset_y = 0. detConfig.refpos_x = nAmpX * nPixX * 0.5 - 0.5 detConfig.refpos_y = nAmpY * nPixY * 0.5 - 0.5 detConfig.yawDeg = 0. detConfig.pitchDeg = 0. detConfig.rollDeg = 0. detConfig.pixelSize_x = 10. / 1000. #in mm detConfig.pixelSize_y = 10. / 1000. #in mm detConfig.transposeDetector = False detConfig.transformDict.nativeSys = PIXELS.getSysName() fpTransform = afwGeom.xyTransformRegistry['identity']() plateScale = 1. return makeDetector(detConfig, ampCatalog, fpTransform, plateScale)
def createDetector(nAmpX, nAmpY, nPixX, nPixY, pre, hOscan, vOscan, ext, isPerAmp): '''!Fill ampInfo tables \param[in] nAmpX -- Number of amps in the x direction \param[in] nAmpY -- Number of amps in the y direction \param[in] nPixX -- Number of pixels in the amp in the x direction \param[in] nPixY -- Number of pixels in the amp in the y direction \param[in] pre -- Number of prescan rows \param[in] hOscan -- Number of horizontal overscan columns \param[in] vOscan -- Number of vertical overscan rows \param[in] ext -- Number of pixels in the extended register \param[in] isPerAmp -- Are the raw amp data in separate images? \return an lsst.afw.cameraGeom.Detector object ''' schema = afwTable.AmpInfoTable.makeMinimalSchema() ampCatalog = afwTable.AmpInfoCatalog(schema) flipy = True for iy in range(nAmpY): flipy = not flipy flipx = True for ix in range(nAmpX): flipx = not flipx record = ampCatalog.addNew() populateAmpBoxes(nPixX, nPixY, pre, hOscan, vOscan, ext, flipx, flipy, ix, iy, isPerAmp, record) record.setGain(ix+iy*nAmpX+1.) detConfig = DetectorConfig() detConfig.name = 'TestDetector' detConfig.id = 0 detConfig.bbox_x0 = 0 detConfig.bbox_y0 = 0 detConfig.bbox_x1 = nAmpX*nPixX - 1 detConfig.bbox_y1 = nAmpY*nPixY - 1 detConfig.detectorType = 0 #Science type detConfig.serial = 'THX1138' detConfig.offset_x = 0. detConfig.offset_y = 0. detConfig.refpos_x = nAmpX*nPixX*0.5 - 0.5 detConfig.refpos_y = nAmpY*nPixY*0.5 - 0.5 detConfig.yawDeg = 0. detConfig.pitchDeg = 0. detConfig.rollDeg = 0. detConfig.pixelSize_x = 10./1000. #in mm detConfig.pixelSize_y = 10./1000. #in mm detConfig.transposeDetector = False detConfig.transformDict.nativeSys = PIXELS.getSysName() fpTransform = afwGeom.xyTransformRegistry['identity']() plateScale = 1. return makeDetector(detConfig, ampCatalog, fpTransform, plateScale)
def _makeDetectorList(self, ccdParams, focalPlaneToPupil, plateScale): """!Make a list of detectors @param[in] ccdParams Dict of YAML descriptions of CCDs @param[in] focalPlaneToPupil lsst.afw.geom.XYTransform from FOCAL_PLANE to PUPIL coordinates @param[in] plateScale plate scale, in angle on sky/mm @return a list of detectors (lsst.afw.cameraGeom.Detector) """ detectorList = [] detectorConfigList = self._makeDetectorConfigList(ccdParams) for ccd, detectorConfig in zip(ccdParams.values(), detectorConfigList): ampInfoCatalog = self._makeAmpInfoCatalog(ccd) detector = makeDetector(detectorConfig, ampInfoCatalog, focalPlaneToPupil) detectorList.append(detector) return detectorList
def _makeDetectorList(self, focalPlaneToPupil, plateScale): """!Make a list of detectors @param[in] focalPlaneToPupil lsst.afw.geom.XYTransform from FOCAL_PLANE to PUPIL coordinates @param[in] plateScale plate scale, in angle on sky/mm @return a list of detectors (lsst.afw.cameraGeom.Detector) """ detectorList = [] detectorConfigList = self._makeDetectorConfigList() for detectorConfig in detectorConfigList: ampInfoCatalog = self._makeAmpInfoCatalog() detector = makeDetector(detectorConfig, ampInfoCatalog, focalPlaneToPupil) detectorList.append(detector) return detectorList
def _makeDetectorList(self, focalPlaneToPupil, plateScale): """Make a list of detectors @param[in] focalPlaneToPupil lsst.afw.geom.XYTransform from FOCAL_PLANE to PUPIL coordinates @param[in] plateScale plate scale, in angle on sky/mm @return a list of detectors (lsst.afw.cameraGeom.Detector) """ detectorList = [] detectorConfigList = self._makeDetectorConfigList() for detectorConfig in detectorConfigList: ampInfoCatalog = self._makeAmpInfoCatalog() detector = makeDetector(detectorConfig, ampInfoCatalog, focalPlaneToPupil, plateScale.asArcseconds()) detectorList.append(detector) return detectorList
def _makeDetectorList(self, 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) """ detectorList = [] detectorConfigList = self._makeDetectorConfigList() for detectorConfig in detectorConfigList: ampInfoCatalog = self._makeAmpInfoCatalog() detector = makeDetector(detectorConfig, ampInfoCatalog, focalPlaneToFieldAngle) detectorList.append(detector) return detectorList
def _makeDetectorList(self, focalPlaneToPupil, plateScale): """!Make a list of detectors @param[in] focalPlaneToPupil lsst.afw.geom.XYTransform from FOCAL_PLANE to PUPIL coordinates @param[in] plateScale plate scale, in angle on sky/mm @return a list of detectors (lsst.afw.cameraGeom.Detector) """ detectorList = [] detectorConfigList = self._makeDetectorConfigList() for detectorConfig in detectorConfigList: ampInfoCatalog = self._makeAmpInfoCatalog() # detector = makeDetector(detectorConfig, ampInfoCatalog, focalPlaneToPupil, # plateScale.asArcseconds()) # Only first 3 args -> /Users/augustinguyonnet/dm/obs_ctio0m9/python/lsst/obs/ctio0m9/ctio0m9.py detector = makeDetector(detectorConfig, ampInfoCatalog, focalPlaneToPupil) detectorList.append(detector) return detectorList
def _makeDetectorList(self, focalPlaneToFieldAngle): """Make a list of detectors Parameters ---------- focalPlaneToFieldAngle : `lsst.afw.geom.TransformPoint2ToPoint2` Transform from ``FOCAL_PLANE`` to ``FIELD_ANGLE`` coordinates in the forward direction. Returns ------- detectorList : `list` of `lsst.afw.cameraGeom.Detector` List of detectors. """ detectorList = [] detectorConfigList = self._makeDetectorConfigList() for detectorConfig in detectorConfigList: ampInfoCatalog = self._makeAmpInfoCatalog() detector = makeDetector(detectorConfig, ampInfoCatalog, focalPlaneToFieldAngle) detectorList.append(detector) return detectorList
def _makeDetectorList(self, focalPlaneToFieldAngle): """Make a list of detectors. Parameters ---------- focalPlaneToFieldAngle : `lsst.afw.geom.TransformPoint2ToPoint2` A transform from FOCAL_PLANE to FIELD_ANGLE coordinates in the forward direction. Returns ------- A list of detectors, each an `lsst.afw.cameraGeom.Detector`. """ detectorList = [] for i, fpPos in enumerate(self.detectorFracPosList): detectorConfig = self._makeDetectorConfig(id=i, fpPos=fpPos) ampInfoCatalog = self._makeAmpInfoCatalog() detector = makeDetector(detectorConfig, ampInfoCatalog, focalPlaneToFieldAngle) detectorList.append(detector) return detectorList
def _makeDetectorList(self, ccdParams, focalPlaneToFieldAngle): """Make a list of detectors Parameters ---------- ccdParams : `dict` Dict of YAML descriptions of CCDs. focalPlaneToFieldAngle : `lsst.afw.geom.TransformPoint2ToPoint2` Angle from FOCAL_PLANE to FIELD_ANGLE coordinates. Returns ------- `list` of `lsst.afw.cameraGeom.Detector` list of detectors in this camera. """ detectorList = [] detectorConfigList = self._makeDetectorConfigList(ccdParams) for ccd, detectorConfig in zip(ccdParams.values(), detectorConfigList): ampInfoCatalog = self._makeAmpInfoCatalog(ccd) detector = makeDetector(detectorConfig, ampInfoCatalog, focalPlaneToFieldAngle) detectorList.append(detector) return detectorList