How to find dates when the earth is at the apsides in it's orbit?

Asked by Morgan Wahl

The documentation for PyEphem seems to focus on getting position data given a particular date, but how do find the date when a body is at a position in it's orbit? Specifically, I'd like to write a little program to calculate when the earth is next at perihelion and apihelion, and PyEphem seems like the right library to use, but it's not obvious how.

Question information

Language:
English Edit question
Status:
Solved
For:
PyEphem Edit question
Assignee:
No assignee Edit question
Solved by:
Morgan Wahl
Solved:
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Brandon Rhodes (brandon-rhodes) said :
#2

One approach to finding perihelion is to write a loop that steps forward, say, a day at a time looking for the moment when the earth-sun distance stops getting smaller and starts getting longer again. Then, do the same thing over that day with hours. Then narrow in on the minute when the motion changes. And so on, to as much precision as you want.

There are more complex ways of doing it, and the "newton" function in PyEphem is one such way, which I use to find sunrises and sunsets and such things. I will add, as a feature request for the next version, explicit perihelion and aphelion functions so that people don't have to code them by themselves! But for now a loop that narrows in should work for you.

Revision history for this message
Brandon Rhodes (brandon-rhodes) said :
#3

Watch the "ChangeLog" of the next version I release to see if aphelion and perihelion make it in as features. They are now on the TODO list:

https://bitbucket.org/brandon/pyephem/changeset/af65124d5d2c

Revision history for this message
Morgan Wahl (morganwahl) said :
#4

Thanks! I thought about using the newton function, but thought there might be a more efficient way of doing it for someone familiar with PyEphem.

Revision history for this message
Jim Netter (netter-j) said :
#5

In "Astronomical Algorithms" Jean Meeus has a method for finding approximate perihelion and aphelion near a given date for a given planet. I use that, then narrow it down incrementally with sun_distance