22 import lsst.pex.config
as pexConfig
23 import lsst.pipe.base
as pipeBase
26 __all__ = (
"EvaluateLocalCalibrationConfig",
27 "EvaluateLocalCalibrationTask")
35 """Compute local calibrations from an input calexp and store the values per 36 row in a source catalog. 40 schema : `lsst.afw.table.Schema` 41 Input SourceTable schema. 43 ConfigClass = EvaluateLocalCalibrationConfig
44 _DefaultName =
"evaluateLocalCalibration" 47 pipeBase.Task.__init__(self, **kwargs)
51 "base_localPhotoCalib",
53 doc=
"Local approximation of the PhotoCalib calibration factor at " 54 "the location of the src.")
56 "base_localPhotoCalibErr",
58 doc=
"Error on the local approximation of the PhotoCalib " 59 "calibration factor at the location of the src.")
64 doc=
"(1, 1) element of the CDMatrix for the linear approximation " 65 "of the WCS at the src location.")
69 doc=
"(1, 2) element of the CDMatrix for the linear approximation " 70 "of the WCS at the src location.")
74 doc=
"(2, 1) element of the CDMatrix for the linear approximation " 75 "of the WCS at the src location.")
79 doc=
"(2, 2) element of the CDMatrix for the linear approximation " 80 "of the WCS at the src location.")
82 def run(self, sources, exposure):
83 """Add calibration products to the source catalog given the calibrated 88 sources : `lsst.afw.table.SourceTable` 89 Catalog of sources to add local calibrations to. 90 exposure : `lsst.afw.image.Exposure` 91 Calibrated exposure to strip local calibrations from. 93 wcs = exposure.getWcs()
94 photoCalib = exposure.getPhotoCalib()
95 for srcRec
in sources:
99 def _storePhotoCalib(self, srcRec, photoCalib):
100 """Compute local calibration (counts -> Nanojansky) for the input 105 srcRec : `lsst.afw.table.SourceRecord` 106 Record with centroid to store local calibrations in. 107 photoCalib : `lsst.afw.image.PhotoCalib` 108 Photometric calibration object to compute local calibration from. 110 calib = photoCalib.getLocalCalibration(srcRec.getCentroid())
113 calibErr = photoCalib.getCalibrationErr()
116 def _storeWcs(self, srcRec, wcs):
117 """Compute and store the CDMatrix at the location of the source record. 121 srcRec : `lsst.afw.table.SourceRecord` 122 Source record with centroid slot set. 123 wcs : `lsst.afw.geom.SkyWcs` 124 Wcs to compute a linear approximation of. 126 localCDMatrix = wcs.getCdMatrix(srcRec.getCentroid())
def __init__(self, schema, kwargs)
def _storePhotoCalib(self, srcRec, photoCalib)
def run(self, sources, exposure)
def _storeWcs(self, srcRec, wcs)