skyfielders / python-skyfield

Elegant astronomy for Python
MIT License
1.41k stars 211 forks source link

'ChebyshevPosition' object has no attribute 'target_name' #161

Closed JoshPaterson closed 6 years ago

JoshPaterson commented 6 years ago

When I try to create a vector from the sun to the earth like this:

earth = ephem['earth']
sun = ephem['sun']
vector = earth - sun

I get this error:

AttributeError: 'ChebyshevPosition' object has no attribute 'target_name'

I believe this error occurs for any body whose vector is a ChebyshevPosition object, such as the earth barycenter, or the sun. This issue means that geometric positions involving these objects cannot be generated.

ghost commented 6 years ago

Could we see the entire code? Have you loaded an ephemeris?

JoshPaterson commented 6 years ago

The full script to reproduce this error is:

from skyfield.api import load

ephem = load('de430t.bsp')

earth = ephem['earth']
sun = ephem['sun']

vector = earth - sun

Also, I am using the latest version.

brandon-rhodes commented 6 years ago

Thanks for letting me know!