26 from lsst.pex.config
import Config, Field
32 Settings to define vignetteing pattern 36 doc=
"Center of vignetting pattern, in focal plane x coordinates.",
41 doc=
"Center of vignetting pattern, in focal plane y coordinates.",
46 doc=
"Radius of vignetting pattern, in focal plane coordinates.",
48 check=
lambda x: x >= 0
50 numPolygonPoints = Field(
52 doc=
"Number of points used to define the vignette polygon.",
55 doWriteVignettePolygon = Field(
57 doc=
"Persist polygon used to define vignetted region?",
63 """Define a simple circular vignette pattern. 65 ConfigClass = VignetteConfig
66 _DefaultName =
"isrVignette" 68 def run(self, exposure):
69 """Generate circular vignette pattern. 73 exposure : `lsst.afw.image.Exposure` 74 Exposure to construct vignette for. 78 polygon : `lsst.afw.Geom.Polygon` 79 Polygon defining the boundary of the vignetted region. 82 if self.config.doWriteVignettePolygon:
83 theta = numpy.linspace(0, 2*numpy.pi, num=self.config.numPolygonPoints, endpoint=
False)
84 x = self.config.radius*numpy.cos(theta) + self.config.xCenter
85 y = self.config.radius*numpy.sin(theta) + self.config.yCenter
86 points = numpy.array([x, y]).transpose()
87 polygon = afwGeom.Polygon([
lsst.geom.Point2D(x1, y1)
for x1, y1
in reversed(points)])