87 def run(self, inputExp, camera):
88 """Bin input image, attach associated detector.
92 inputExp : `lsst.afw.image.Exposure`
93 Input exposure data to bin.
94 camera : `lsst.afw.cameraGeom.Camera`
95 Input camera to use for mosaic geometry.
99 output : `lsst.pipe.base.Struct`
100 Results struct with attribute:
103 Binned version of input image (`lsst.afw.image.Exposure`).
105 if inputExp.getDetector()
is None:
106 detectorId = inputExp.getMetadata().get(self.config.detectorKeyword)
107 if detectorId
is not None:
108 inputExp.setDetector(camera[detectorId])
110 binned = inputExp.getMaskedImage()
111 binned = afwMath.binImage(binned, self.config.binning)
112 outputExp = afwImage.makeExposure(binned)
114 outputExp.setInfo(inputExp.getInfo())
116 return pipeBase.Struct(outputExp=outputExp)