Closed mcoughlin closed 5 months ago
@ManonMarchand @fxpineau
This example is very old. There is now a function that allows to draw the border of the MOC directly:
from astropy.coordinates import Latitude, Longitude
import astropy.units as u
import matplotlib.pyplot as plt
lon = Longitude([5, -5, -5, 5], u.deg)
lat = Latitude([5, 5, -5, -5], u.deg)
moc = MOC.from_polygon(lon, lat)
fig = plt.figure(figsize=(10, 10))
wcs = moc.wcs(fig)
ax = fig.add_subplot(projection=wcs)
moc.border(ax, wcs, color='purple')
plt.show()
Do you think the example misled you? Should we remove it? Or were you looking for the details of the implementation of the border? In that case we should keep it.
@ManonMarchand This issue comes up when the border is plotted: moc.border(ax=ax, wcs=ax.wcs, alpha=1, color="black") etc. in certain cases.
Ah got it! Sorry I was out of it. Don't know why but I thought we were in the example on borders that shows the implementation. I'll rebase and merge this, thanks.
This PR fixes an error in case the MOC results in empty path_vertices_l (which happens in case of a MOC on the other side of the globe).
Also, the pre-commit did a number on this file.