77 """Add two snap exposures together, returning a new exposure.
81 snap0 : `lsst.afw.image.Exposure`
83 snap1 : `lsst.afw.image.Exposure`
88 combined : `lsst.afw.image.Exposure`
91 combined = snap0.Factory(snap0,
True)
92 combined.maskedImage.set(0)
94 weights = combined.maskedImage.image.Factory(combined.maskedImage.getBBox())
96 bad_mask = afwImage.Mask.getPlaneBitMask(self.config.bad_mask_planes)
97 addToCoadd(combined.maskedImage, weights, snap0.maskedImage, bad_mask, weight)
98 addToCoadd(combined.maskedImage, weights, snap1.maskedImage, bad_mask, weight)
103 combined.maskedImage /= weights
104 setCoaddEdgeBits(combined.maskedImage.getMask(), weights)
106 combined.info.setVisitInfo(self.
_merge_visit_info(snap0.visitInfo, snap1.visitInfo))
111 """Merge the visitInfo values from the two exposures.
114 * id will be the id of snap 0.
115 * date will be the average of the dates.
116 * exposure time will be the sum of the times.
120 info0, info1 : `lsst.afw.image.VisitInfo`
125 info : `lsst.afw.image.VisitInfo`
129 time = info0.exposureTime + info1.exposureTime
130 date = (info0.date.get() + info1.date.get()) / 2.0
131 result = info0.copyWith(exposureTime=time,
132 date=dafBase.DateTime(date)