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