Repository navigation
added approximate routine for calculating position of the moon - #4963
Conversation
|
|
||
| suml = sumr = 0.0 | ||
| lrnum = len(_MOON_L_R) | ||
| for i in range(lrnum): |
There was a problem hiding this comment.
A bit more pythonic might be:
for moon_l_r in _MOON_L_R:
DNum, MNum, McNum, FNum, LFac, RFac = moon_l_r
corr = E ** abs(MNum)
suml += LFac * corr * np.sin(...)
sumr += RFac * corr * np.cos(...)
|
@StuartLittlefair - yep, rebase just as you said (and maybe address @mhvk's comments at the same time?) Two larger scale thoughts (I'll do a more thorough review post-rebase):
|
…get_apparent_body_position as the Meeus algorithm already has the light travel time correction added in
|
The commits I just pushed rebase this on @mhvk's changes made in #4920. @eteq if these tests pass I guess this could do with a more thorough review. I thought about your suggestions for generalising to a location with arbitrary orbital elements but struggled to see how such a generalisation could be done. For example, the VSOP87 planetary theory uses different types of sum and even terms to the ELP2000-82 Lunar position model encoded here. If you think it can be done, however, feel free to make a PR and show me how! |
| E = polyval(T, _coE) | ||
|
|
||
| suml = sumr = 0.0 | ||
| for moon_l_r in _MOON_L_R: |
There was a problem hiding this comment.
Looking at this again, I think one can simply write
for DNum, MNum, McNum, FNum, LFac, RFac in _MOON_L_R:
(and same below)
Sorry that I didn't note that earlier!
|
I still think we might want to generalize the orbital elements machinery, but on reflection it's definitely a task for a future PR. So with that this looks good-to-go to me, right @StuartLittlefair? @astrofrog and @taldcroft, are you OK with backporting this to 1.2 (as it's part of the solar system stuff that's new in 1.2)? If so, it doesn't need a changelog entry as it's an addition to an already-mentioned new feature. |
|
👍 to backporting |
|
@StuartLittlefair - can you confirm this is ready to go? @taldcroft - do you agree with backporting this? |
|
@mhvk - yes, ready to go from me. |
|
👍 on backporting to 1.2. |
added approximate routine for calculating position of the moon
This PR fixes #4943.
I have coded up the algorithm in Jean Meeus', 'Astronomical Algorithms', second edition, 1998, Willmann-Bell for the approximate position of the Moon. Compared with JPL ephemerides this is only accurate to 15 arcsecs and 60 km over the range 1950-2050 (see below). However, it does not require any public downloads.
The function defined here has not been made part of the public API. I am thinking that the function can be used to add the moon to the
approximateephemeris added in #4920 once that PR is merged.