35 im = exposure.getMaskedImage().getImage()
36 width, height = im.getWidth(), im.getHeight()
38 w, h = width//nx, height//ny
60 csrc = afwDetection.Source()
62 csrc.setXAstrom(src.getXAstrom())
63 csrc.setYAstrom(src.getYAstrom())
66 cellSet.insertCandidate(measAlg.PsfCandidateF(csrc, exposure.getMaskedImage()))
68 log.log(log.WARN, str(e))
70 ncell = len(cellSet.getCellList())
71 nobj = numpy.ndarray(ncell, dtype=
'i')
73 for i
in range(ncell):
74 cell = cellSet.getCellList()[i]
78 dx = numpy.ndarray(cell.size())
79 dy = numpy.ndarray(cell.size())
87 cand = measAlg.cast_PsfCandidateF(cand)
89 mid = cand.getSource().getId()
90 dx[j] = srcMatchSet[mid].first.getXAstrom() - srcMatchSet[mid].second.getXAstrom()
91 dy[j] = srcMatchSet[mid].first.getYAstrom() - srcMatchSet[mid].second.getYAstrom()
96 log.log(log.DEBUG,
"%s %-30s %8s dx,dy = %5.2f,%5.2f rms_x,y = %5.2f,%5.2f" % \
97 (cell.getLabel(), cell.getBBox(), (
"nobj=%d" % cell.size()),
98 dx.mean(), dy.mean(), dx.std(), dy.std()))
104 values[
"minObjectsPerCell"] = int(nobj[0])
105 values[
"maxObjectsPerCell"] = int(nobj[-1])
106 values[
"meanObjectsPerCell"] = nobj.mean()
107 values[
"stdObjectsPerCell"] = nobj.std()
An integer coordinate rectangle.
A collection of SpatialCells covering an entire image.