[AstroPy] what does it mean get_body('moon',t,location=loc)?

Yang Hon-Jang hjyanghj at gmail.com
Fri Dec 15 12:20:45 EST 2017


I am a real beginner in astronomy.

It seems relation between get_body('moon',t,location=loc) and get_body('moon',t)
is not a translation.

So it raise a stupid question in my mind, what does it mean
get_body('moon',t,location=loc)?

Following is my snippet:

import astropy.units as u
from astropy.coordinates import get_body,EarthLocation
from astropy.time import Time
import numpy as np
t=Time('2017-12-16')
moon=get_body('moon',t)
loc=EarthLocation(x=6000,y=6000,z=6000,unit='km')
moon2=get_body('moon',t,location=loc)
print(np.array(loc.value))
print(np.array(moon2.cartesian.xyz.value))
print(np.array(moon.cartesian.xyz.value))
# wonder why np.array(moon.cartesian.xyz.value)-(np.array(moon2.cartesian.xyz.value)+np.array(loc.value))
 is not zero?
np.array(moon.cartesian.xyz.value)-(np.array(moon2.cartesian.xyz.value)+np.array(loc.value))

Hope some one can guide me, Thanks!


More information about the AstroPy mailing list