77 ):
78 """Generate circular vignette pattern.
79
80 Parameters
81 ----------
82 exposure : `lsst.afw.image.Exposure`, optional
83 Exposure to construct, apply, and optionally mask vignette for.
84 doUpdateMask : `bool`, optional
85 If true, the mask will be updated to mask the vignetted region.
86 maskPlane : `str`, optional
87 Mask plane to assign vignetted pixels to.
88 vignetteValue : `float` or `None`, optional
89 Value to assign to the image array pixels within the ``polygon``
90 region. If `None`, image pixel values are not replaced.
91 log : `logging.Logger`, optional
92 Log object to write to.
93 doUpdatePolygon : `bool`, optional
94 If true, the valid polygon will be updated.
95
96 Returns
97 -------
98 polygon : `lsst.afw.geom.Polygon`
99 Polygon defining the boundary of the vignetted region.
100 """
101 theta = np.linspace(0, 2*np.pi, num=self.config.numPolygonPoints, endpoint=False)
102 x = self.config.radius*np.cos(theta) + self.config.xCenter
103 y = self.config.radius*np.sin(theta) + self.config.yCenter
104 points = np.array([x, y]).transpose()
106 if exposure is None:
107 return fpPolygon
108
109
110
111 validPolygon = setValidPolygonCcdIntersect(exposure, fpPolygon, log=log, setPolygon=doUpdatePolygon)
112
113 if doUpdateMask:
114 maskVignettedRegion(
115 exposure,
116 validPolygon,
117 maskPlane=maskPlane,
118 vignetteValue=vignetteValue,
119 log=log,
120 )
121
122 return fpPolygon
123
124