Dean Dean - 6 months ago 18
Python Question

Is there a sunset/sunrise function built into Astropy yet?

I have seen a couple of answers referring to PyEphem on here and how that can produce sunset/sunrise times, however it would be more useful to me if I could find a solution using solely Astropy packages. At the moment the closest I have found is the (get_sun) function in the astropy.coordinates package. Is this sunset/sunrise functionality built into Astropy anywhere yet?


The Astroplan package has an Observer class with a Observer.sun_rise_time and a Observer.sun_set_time method.

Astroplan is an Astropy affiliated package.

Whether this functionality is going to be put into the core Astropy package in the future or remain in Astroplan isn't clear. But with pip install astroplan or conda install -c astropy astroplan you can easily install Astroplan and use this.