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