Set the semi-major (*a*) and semi-minor radii (*b*) of the annulus. Parameters ---------- r : float or (float, float) The radius, or semi-axes: - If float: radius of the outer circle. - If two floats: semi-major and -minor axes o
(self, r)
| 2010 | self.stale = True |
| 2011 | |
| 2012 | def set_radii(self, r): |
| 2013 | """ |
| 2014 | Set the semi-major (*a*) and semi-minor radii (*b*) of the annulus. |
| 2015 | |
| 2016 | Parameters |
| 2017 | ---------- |
| 2018 | r : float or (float, float) |
| 2019 | The radius, or semi-axes: |
| 2020 | |
| 2021 | - If float: radius of the outer circle. |
| 2022 | - If two floats: semi-major and -minor axes of outer ellipse. |
| 2023 | """ |
| 2024 | if np.shape(r) == (2,): |
| 2025 | self.a, self.b = r |
| 2026 | elif np.shape(r) == (): |
| 2027 | self.a = self.b = float(r) |
| 2028 | else: |
| 2029 | raise ValueError("Parameter 'r' must be one or two floats.") |
| 2030 | |
| 2031 | self._path = None |
| 2032 | self.stale = True |
| 2033 | |
| 2034 | def get_radii(self): |
| 2035 | """Return the semi-major and semi-minor radii of the annulus.""" |