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