Created
January 24, 2018 17:10
-
-
Save StuartLittlefair/907f3c8fb068bbc1eb22a1924725e90e to your computer and use it in GitHub Desktop.
quick-ish calculation of sun and moon location
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from astropy import coordinates as coord | |
from astropy.time import Time | |
from astropy import units as u | |
lapalma = coord.EarthLocation.of_site('lapalma') | |
times = Time.now() + u.minute*np.linspace(-720, 720, 1440) | |
altaz_frame = coord.AltAz(location=lapalma, obstime=times) | |
sun = coord.get_body('sun', location=lapalma, time=times) | |
moon = coord.get_body('moon', location=lapalma, time=times) | |
sun_altaz = sun.transform_to(altaz_frame) | |
moon_altaz = moon.transform_to(altaz_frame) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment