Skip to content

Geocentric altitude/az of the sun and moon. #299

Answered by cosinekitty
hidp123 asked this question in Q&A
Discussion options

You must be logged in to vote

OK, I think I figured it out. I was calculating the vectors in J2000 coordinates (EQJ in Astronomy Engine nomenclature), but to get accurate horizontal coordinates, I need to convert them to of-date coordinates (EQD).

#!/usr/bin/env python3
import astronomy
observer = astronomy.Observer(39, -76.8)
besttime = astronomy.Time.Make(1990, 11, 19, 22, 29, 11)
geomoon = astronomy.GeoVector(astronomy.Body.Moon, besttime, True)
geosun = astronomy.GeoVector(astronomy.Body.Sun, besttime, True)
rot = astronomy.Rotation_EQJ_EQD(besttime)
rotmoon = astronomy.RotateVector(rot, geomoon)
rotsun  = astronomy.RotateVector(rot, geosun)
meq = astronomy.EquatorFromVector(rotmoon)
seq = astronomy.EquatorFromVector

Replies: 2 comments 14 replies

Comment options

You must be logged in to vote
12 replies
@cosinekitty
Comment options

@hidp123
Comment options

@cosinekitty
Comment options

@cosinekitty
Comment options

Answer selected by hidp123
@hidp123
Comment options

Comment options

You must be logged in to vote
2 replies
@cosinekitty
Comment options

@YingChangJ
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants