Closed pllim closed 1 year ago
Using the example posted above, this is what the polygon looks like:
from matplotlib import pyplot as plt
x, y = ann.to_polygon()
plt.gca().set_aspect('equal')
plt.plot(x, y)
Great! Maybe we should have 100 points instead of 20?
Done!
Not sure why CI didn't kick off.
This PR adds a new class to represent circular annulus as ROI.
Motivation: Even though we can use annulus now after https://github.com/glue-viz/glue-astronomy/pull/90 , it is not very user-friendly, as we have to expose parameters from the outer and inner circles separately, which would cause user to easily make the subset state no longer a circular annulus (see https://github.com/spacetelescope/jdaviz/pull/2182#issuecomment-1542882590 for exciting screenshots). Therefore, there is a need to represent this shape as ROI so that we only expose the relevant parameters (one center only, inner radius, outer radius) without a lot of hacky workaround downstream.
With this patch, I could do the following in Jdaviz after unpinning maxversion of glue-core (xref https://github.com/spacetelescope/jdaviz/issues/2183).
The next step following this PR is to support this new ROI both in glue-astronomy (https://github.com/glue-viz/glue-astronomy/pull/92) and Jdaviz.
🐱