31 Settings to define vignetteing pattern 35 doc=
"Center of vignetting pattern, in focal plane x coordinates.",
40 doc=
"Center of vignetting pattern, in focal plane y coordinates.",
45 doc=
"Radius of vignetting pattern, in focal plane coordinates.",
47 check=
lambda x: x >= 0
49 numPolygonPoints = Field(
51 doc=
"Number of points used to define the vignette polygon.",
54 doWriteVignettePolygon = Field(
56 doc=
"Persist polygon used to define vignetted region?",
62 """Define a simple circular vignette pattern. 64 ConfigClass = VignetteConfig
65 _DefaultName =
"isrVignette" 67 def run(self, exposure):
68 """Generate circular vignette pattern. 72 exposure : `lsst.afw.image.Exposure` 73 Exposure to construct vignette for. 77 polygon : `lsst.afw.Geom.Polygon` 78 Polygon defining the boundary of the vignetted region. 81 if self.config.doWriteVignettePolygon:
82 theta = numpy.linspace(0, 2*numpy.pi, num=self.config.numPolygonPoints, endpoint=
False)
83 x = self.config.radius*numpy.cos(theta) + self.config.xCenter
84 y = self.config.radius*numpy.sin(theta) + self.config.yCenter
85 points = numpy.array([x, y]).transpose()
86 polygon = afwGeom.Polygon([afwGeom.Point2D(x1, y1)
for x1, y1
in reversed(points)])