Comment 1 for bug 391183

Revision history for this message
Brandon Rhodes (brandon-rhodes) wrote :

cagey —

Yes, as you noted, this is considered a feature. The reason the routine does not work on a copy of the body is that, if it did, then the final result of its calculations would be "hidden" from the user, and the user would have to ask the body to re-calculate its position — that had just been calculated already! — to find out the circumstances of the rising or setting.

Since to find out when, say, the Moon rises, PyEphem has to go ahead and compute its position, the idea is that leaving it there for the user keeps useful information that would otherwise be lost. In nearly all real astronomical work that I know of, after when something rises, you immediately want to know where; and especially after asking about when something transits, you want to know the altitude at which it transits. Making users do a second calculation every time this happens seemed unacceptibly inefficient.

If you were surprised by this behavior, however, it means that the documentation needs to be improved. What did you read that introduced you to the rising/setting functions? Let me know, and we'll work to make that document describe much better how PyEphem works. Thanks for sharing your confusing rather than staying silent and letting the documentation suffer!