Dean Dean - 1 year ago 94
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download