Skip to content

Instantly share code, notes, and snippets.

@TheBB
Created November 3, 2017 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheBB/5bb8c7a3e361be1acd6deea24be08a5a to your computer and use it in GitHub Desktop.
Save TheBB/5bb8c7a3e361be1acd6deea24be08a5a to your computer and use it in GitHub Desktop.
from astropy import coordinates as coords, time, units as u
from datetime import datetime, timezone
import numpy as np
now = time.Time.now()
wageningen = coords.EarthLocation(lat=51.9692*u.deg, lon=5.6654*u.deg, height=9*u.m)
for mins in 15 * np.arange(40):
timept = now + mins * u.minute
sun = coords.get_sun(timept).transform_to(coords.AltAz(obstime=timept, location=wageningen))
print(timept, '{:.2f}, {:.2f}'.format(sun.az.degree, sun.alt.degree))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment