Created
April 25, 2019 17:47
-
-
Save translunar/0ce54bd9eef6c73780b8ab104d760515 to your computer and use it in GitHub Desktop.
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
import numpy as np | |
from spiceypy import spiceypy as spice | |
r_lclf = spice.georec(lon, lat, 0.0, r_eq, f) | |
normal = spice.latrec(1.0, lon, lat) | |
topo_xform = spice.twovec(normal, 3, np.array([0.0, 0.0, 1.0]), 1) | |
# Get sun state relative to topo frame | |
x_sun, lt = spice.spkcpo('SUN', et, 'MOON_ME', 'OBSERVER', 'NONE', r_lclf, 'MOON', 'MOON_ME') | |
r_sun_topo = spice.mxv(topo_xform, x_sun[0:3]) | |
rho, lon, el = spice.reclat(r_sun_topo) | |
az = -lon | |
import spice_helpers as sh | |
az, el = sh.sun_az_el( et ) | |
# returns azimuth and elevation at epoch time 'et', in radians |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment