80 def __exit__(self, type_, value, tb):
81
82
83
84 if type_ is not None:
85
86 return
87
88
89 self.parentRecord.
set(self.owner.keys[
"nChild"], len(self.children))
90
91 instFlux = 0.0
92 for record, image in self.children:
93 instFlux += record.get(self.owner.keys["instFlux"])
94 self.parentRecord.
set(self.owner.keys[
"instFlux"], instFlux)
95
96 x = 0.0
97 y = 0.0
98 for record, image in self.children:
99 w = record.get(self.owner.keys["instFlux"])/instFlux
100 x += record.get(self.owner.keys["centroid"].getX())*w
101 y += record.get(self.owner.keys["centroid"].getY())*w
103
104 xx = 0.0
105 yy = 0.0
106 xy = 0.0
107 for record, image in self.children:
108 w = record.get(self.owner.keys["instFlux"])/instFlux
109 dx = record.get(self.owner.keys["centroid"].getX()) - x
110 dy = record.get(self.owner.keys["centroid"].getY()) - y
111 xx += (record.get(self.owner.keys["shape"].getIxx()) + dx**2)*w
112 yy += (record.get(self.owner.keys["shape"].getIyy()) + dy**2)*w
113 xy += (record.get(self.owner.keys["shape"].getIxy()) + dx*dy)*w
115
116 self.owner._installFootprint(self.parentRecord, self.parentImage)
117
118
119 deblend = lsst.afw.image.MaskedImageF(self.owner.exposure.maskedImage, True)
120 for record, image in self.children:
121 deblend.image.array[:, :] = image.array
122 heavyFootprint = lsst.afw.detection.HeavyFootprintF(self.parentRecord.getFootprint(), deblend)
123 record.setFootprint(heavyFootprint)
124
125
An ellipse core with quadrupole moments as parameters.
daf::base::PropertySet * set