distance for planets

Asked by Bryan Butler

is there a reason to not have the range attribute set for all objects (rather than just the artificial satellites)? it's more fundamental than the size attribute in some ways, because you don't need the physical radius of the body.

for instance, i'd like to be able to:

from ephem import *

mars = Mars()
mars.compute('2010/4/28')
mySize = 2.062648e5*2*myMarsRadius/mars.range
print mars.size, ' ', mySize

Question information

Language:
English Edit question
Status:
Solved
For:
PyEphem Edit question
Assignee:
No assignee Edit question
Solved by:
Bryan Butler
Solved:
Last query:
Last reply:
Revision history for this message
Brandon Rhodes (brandon-rhodes) said :
#1

You can use the "earth_distance" attribute on Mars; it's in AU instead of in meters. The reason that normal objects do not supply "range" is because "range" is supposed to differ with your location — which makes sense since an earth satellite is close to some earthbound observers but far from others. But for solar system objects, the difference between their range from, say, New York and their range from Moscow is just not significant enough to bother with. So we just give the "earth_distance" from the center of the earth.

Revision history for this message
Bryan Butler (bbutler) said :
#2

ahh, right you are. i had missed that attribute. thanks!