def assertObjInBBox(self, refCat, bbox, wcs): """Assert that all reference objects are inside the specified pixel bounding box plus a margin @param[in] refCat reference object catalog, an lsst.afw.table.SimpleCatalog or compatible; the only fields read are "centroid_x/y" and "coord_ra/dec" @param[in] bbox pixel bounding box coordinates, an lsst.afw.geom.Box2I or Box2D; the supplied box is grown by self.config.pixelMargin before testing the stars @param[in] wcs WCS, an lsst.afw.image.Wcs """ bbox = afwGeom.Box2D(bbox) bbox.grow(self.config.pixelMargin) centroidKey = Point2DKey(refCat.schema["centroid"]) coordKey = CoordKey(refCat.schema["coord"]) for refObj in refCat: point = refObj.get(centroidKey) if not bbox.contains(point): coord = refObj.get(coordKey) self.fail("refObj at RA, Dec %0.3f, %0.3f point %s is not in bbox %s" % (coord[0].asDegrees(), coord[1].asDegrees(), point, bbox))
def __init__(self, config, name, mapper): MeasurementTransform.__init__(self, config, name, mapper) self.coordKey = CoordKey.addFields(mapper.editOutputSchema(), name, "Position from " + name)