23 __all__ = [
"makeCoaddApCorrMap", ]
26 from .coaddBoundedField
import CoaddBoundedField, CoaddBoundedFieldElement
30 """Construct an ApCorrMap for a coadd
32 @param catalog: Table of coadd inputs (lsst.afw.table.ExposureCatalog)
33 @param coaddBox: Bounding box for coadd (lsst.geom.Box2I)
34 @param coaddWcs: Wcs for coadd
35 @param weightFieldName: name of weight field in catalog
36 @return aperture corrections
41 weightKey = catalog.schema[weightFieldName].asKey()
43 apCorrMap = row.getApCorrMap()
46 weight = row.get(weightKey)
48 validPolygon = row.getValidPolygon()
49 for name, bf
in apCorrMap.items():
50 if name
not in everything:
52 everything[name].append(CoaddBoundedFieldElement(bf, wcs, validPolygon, weight))
56 for name, elements
in everything.items():
57 apCorrMap.set(name, CoaddBoundedField(coaddBox, coaddWcs, elements))