steveberardi / starplot

✨ Star charts and maps in Python
https://starplot.dev
MIT License
28 stars 8 forks source link

Gridlines don't meet at Celestial Poles #104

Closed hemisemidemipresent closed 4 days ago

hemisemidemipresent commented 1 week ago
from starplot import MapPlot, Projection
from starplot.styles import PlotStyle

p = MapPlot(
    projection=Projection.STEREO_NORTH,
    dec_min=35,
    dec_max=90,
    style=PlotStyle(),
)
p.gridlines() # add gridlines

p.export("n.png", padding=0.2, transparent=True)

image

Environment Details:

steveberardi commented 1 week ago

Ahh, I've noticed this before, and previously thought it was something with cartopy/matplotlib, but it's a bug in calculating the declination points -- that list comprehension never includes 90

I'm preparing v0.12.0 for release soon, so I'll fix this there.

Thanks for reporting this!

steveberardi commented 1 week ago

hmm, this may just be the way cartopy draws the gridlines, because when I fix that list comprehension to include 90 it still produces the same result. I also noticed Cartopy has an example of a south polar stereo projection that shows the same behavior.

I do prefer the lines meeting at the poles though, so I'll look into another solution 👍