23 __all__ = [
"checkMatches"]
31 import lsst.meas.algorithms
as measAlg
40 log = Log.getLogger(
"meas.astrom.verifyWcs.checkMatches")
42 im = exposure.getMaskedImage().getImage()
43 width, height = im.getWidth(), im.getHeight()
45 w, h = width//nx, height//ny
67 csrc = afwDetection.Source()
69 csrc.setXAstrom(src.getXAstrom())
70 csrc.setYAstrom(src.getYAstrom())
73 cellSet.insertCandidate(measAlg.PsfCandidateF(csrc, exposure.getMaskedImage()))
74 except Exception
as e:
77 ncell = len(cellSet.getCellList())
78 nobj = np.ndarray(ncell, dtype=
'i')
80 for i
in range(ncell):
81 cell = cellSet.getCellList()[i]
85 dx = np.ndarray(cell.size())
86 dy = np.ndarray(cell.size())
94 mid = cand.getSource().getId()
95 dx[j] = srcMatchSet[mid].first.getXAstrom() - srcMatchSet[mid].second.getXAstrom()
96 dy[j] = srcMatchSet[mid].first.getYAstrom() - srcMatchSet[mid].second.getYAstrom()
100 log.debug(
"%s %-30s %8s dx,dy = %5.2f,%5.2f rms_x,y = %5.2f,%5.2f",
101 cell.getLabel(), cell.getBBox(), (
"nobj=%d" % cell.size()),
102 dx.mean(), dy.mean(), dx.std(), dy.std())
107 values[
"minObjectsPerCell"] = int(nobj[0])
108 values[
"maxObjectsPerCell"] = int(nobj[-1])
109 values[
"meanObjectsPerCell"] = nobj.mean()
110 values[
"stdObjectsPerCell"] = nobj.std()
def checkMatches(srcMatchSet, exposure, log=None)