[AstroPy] What should I know in advance to understand get_body(planet, time, location)?

Yang Hon-Jang hjyanghj at gmail.com
Fri Dec 22 19:37:16 EST 2017


As far as I know get_body('mars',time,location) return GCRS coordinate of
mars observed at location on earth.

So difference vector between get_body('mars',time,loc1) and
get_body('mars',time,loc2) should be the same as differce vector between
loc1 and doc2.

Therefore difference vector between get_body('mars',time,loc1) and
get_body('mars',time,loc2) should be the same as difference vector between
get_body('jupiter',time,loc1) and get_body('jupiter',time,loc2).

But use following snippet,

from astropy.coordinates import
> EarthLocation,solar_system_ephemeris,get_body
> from astropy.time import Time
> import astropy.units as u
> planets=solar_system_ephemeris.bodies
> t=Time('2017-1-7')
> loc1=EarthLocation.of_site('ALMA')
> loc2=EarthLocation.of_site('BAO')
> with solar_system_ephemeris.set('jpl'):
>     poses1=[]
>     poses2=[]
>     for i in range(len(planets)):
>         poses1.append(get_body(planets[i],t,location=loc1).cartesian.xyz)
>         poses2.append(get_body(planets[i],t,location=loc2).cartesian.xyz)
>         print(poses2[i]-poses1[i])


get result:

[ 8063.95816843  7068.00850269 -6606.53423256] km
> [ 8224.04320343  7065.45624797 -6482.55365168] km
> [ 8064.42921932  7067.72318247 -6607.26674529] km
> [ 8266.19750362  7036.04863887 -6534.63230393] km
> [ 8025.04757395  6956.33442213 -6558.59139917] km
> [ 8064.08233562  7068.37313613 -6606.78203702] km
> [ 7979.54002401  6710.05480098 -6540.78743029] km
> [ 8766.62041795  5208.77094686 -6699.57502227] km
> [ 11237.56838802   6188.62185216  -5658.59566617] km
> [ 10447.75206614    304.28817022  -6981.0367673 ] km
> [ 6385.49008512  1293.04231977 -5061.7454344 ] km


The result is a list of very different vectors, it confused me very much.

Hope some one can help me?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20171223/90f69dcb/attachment.html>


More information about the AstroPy mailing list