2

I'm going to try to do a modest simulation of the Moon's libration as seen from the Earth (geocenter), similar to the technical one's I've shown in this question. I'll do it in Python and render it in Blender.

I'm familliar with getting Ephemeris type data from JPL Horizons and from Skyfield, both of which use the JPL Development Ephemerides (e.g. DE405,...), (see also Horizon's Ephemerides page and links therein). From those I generate local tables and interpolate them for animations and other non-critical calculations.

I know that at least some of the DE's contain lunar body motion (e.g. in DE405, but in DE406 it comes separately? Also discussed here) as Loading Auxiliary Files/Dynamic Frames, but without first-hand knowledge of reading the Spice Kernel's directly, is there a way I can get something close through Horizons? For example, with the position of a fixed position on the Moon with respect to Earth's Geocenter, or vice-versa in addition to the motion of the two centers I could reconstruct it well enough for a fairly accurate animation. However, this is as far as I've gotten - I don't know how to specify a lat/lon position on the Moon.

I could fudge it by just spinning the moon on its axis at a fixed rotational angular velocity, but if it's possible to get a handle on the actual lunar rigid body motion, that would be much more helpful to me in the long run.

enter image description here

Brandon Rhodes
  • 991
  • 7
  • 12
uhoh
  • 148,791
  • 53
  • 476
  • 1,473
  • 1
    Aside #1: JPL's Horizons hasn't used DE405 for quite some time. It now uses DE431. – David Hammen Jan 28 '17 at 16:07
  • @DavidHammen DE405 showed up when I searched for "nutation" a long time ago, I included the DE405/DE406 pair to say sometimes it's in the DE, sometimes it isn't. If it's included in the DE431 proper, great! – uhoh Jan 28 '17 at 16:12
  • Careful there, @uhoh. The DE4xxx nutation model pertains to the Earth, not the Moon. What you want are the three libration terms. – David Hammen Jan 29 '17 at 16:29
  • 1
    Also, if you want the Moon, it's probably better to use DE421, which is now eight years old. Apparently it does a better job with regard to lunar orientation that do the more recent versions, whose primary purpose was improve accuracy with regard to Mars, Jupiter, and Pluto. – David Hammen Jan 29 '17 at 17:06
  • 1
    A not so easy way to check if a DE4xxx model contains Earth nutations and lunar librations is to look at the last two columns in the second row of the GROUP 1050 entry in the ASCII header file for that model. The model does not provide Earth nutations if the penultimate (second to last, or twelfth) element is zero, and it does not provide lunar librations of the last (thirteenth) element is zero. – David Hammen Jan 29 '17 at 17:11
  • @DavidHammen OK thanks - I'll take a look. For completeness, I'd still like to find out if there is any access to lunar topos in Horizons. If I can get absolute positions of the Lunacenter and one Lunar lat/lon point, or those relative to the Geocenter, that might be enough for animation purposes at least. – uhoh Jan 30 '17 at 01:37

2 Answers2

1

I'm going to jump in and give an answer before Mark Adler jumps in and tells you to use Spice in lieu of some (quite possibly outdated) Development Ephemeris.

My answer: Use Spice.

Spice provides kernels for the orientations of the Earth and of the Moon with respect to the ICRF as functions of time. From those, you can compute the relative orientation of the Moon with respect to the Earth at any moment in time.

David Hammen
  • 74,662
  • 5
  • 185
  • 283
  • To use Spice, you'll have to learn to program in C or C++ (or in Fortran, if you really want to torture yourself). Relying strictly on an HTML interface marks you as a noob. Moving up the chain, Python is a nice starter language, but still in the newb territory. (Note the spelling difference. Noob and newb are not alternative spellings of the same thing.) – David Hammen Jan 28 '17 at 03:23
  • Unless of course you use Python as the glue that makes C, C++, Fortran, and other languages talk to one another. That's tricky. – David Hammen Jan 28 '17 at 03:24
  • I am actually a language nomad. I learned FORTRAN on a Sigma-7, and I have even seen punch card "correction tape" (to cover wrong holes) though I'm not sure if it was real or just a gag. I've touched on C++ a few times over the years as well, but I'm trying to stick with Python - every time I learn a new one I forget the others, and now with this allergy to curly braces I've developed... – uhoh Jan 28 '17 at 03:30
  • I did have some recent exposure to kernel-reading with Python, I'll give it some thought. But are you saying I can not get at any lunar orientation information through the Horizons web interface or TELNET? – uhoh Jan 28 '17 at 03:32
  • TBH, that Python rejects braces in lieu of spacing put me in the anti-Python camp for a good long time. This goes very much against the grain of the visually impaired. The C family of languages does it just right, in my not so humble opinion. Braces are so much nicer than the if (condition) then do_stuff(); endif seen in Algol derivatives. Using whitespace? Good luck integrating your Python script that uses spaces and some other persons Python script that uses tabs. And good luck communicating your structure to the visually impaired. – David Hammen Jan 28 '17 at 03:37
  • 1
    That said, I do use Python a lot for short little scripts and for testing out an algorithm. Unless of course the short little script or algorithm involves regular expressions. In that case, I'll revert to my first and only resort, which would be perl. There is no language that beats perl when it comes to regular expressions. – David Hammen Jan 28 '17 at 03:40
  • 1
    OTOH, the perl expression @foo{@foo} = (1) x scalar @foo is quite mind boggling. Just because I know what this means and that this wipes out multiple lines of code does not mean that everyone should know what that means. Quite the opposite. Perl is only second to APL with respect to write-only languages. That said, I wouldn't be surprised one bit if there's a perl module out there somewhere that provides Spice functionality. – David Hammen Jan 28 '17 at 03:43
  • I loved using Perl! Most things I've done I've had to work within an existing ecosystem, but when I had a chance to do something new, Perl came to the rescue. But then the next project had to be in Pascal, the one after that had to be in Visual C++... OK I'll take a look at that expression if I find an on-line Perl emulator. In the mean time, I've asked here about the card correction tape. – uhoh Jan 28 '17 at 03:50
1

Using Spice data files, the Skyfield library for Python can now report lunar libration as the sub-longitude and sub-latitude of the point on the Moon facing the Earth. To take an example from its documentation:

from skyfield.api import PlanetaryConstants, load

ts = load.timescale(builtin=True)
t = ts.utc(2019, 12, 20, 11, 5)

eph = load('de421.bsp')
earth, moon = eph['earth'], eph['moon']

pc = PlanetaryConstants()
pc.read_text(load('moon_080317.tf'))
pc.read_text(load('pck00008.tpc'))
pc.read_binary(load('moon_pa_de421_1900-2050.bpc'))

frame = pc.build_frame_named('MOON_ME_DE421')

p = (earth - moon).at(t)
lat, lon, distance = p.frame_latlon(frame)
lon_degrees = (lon.degrees - 180.0) % 360.0 - 180.0
print('Libration in latitude: {:.3f}'.format(lat.degrees))
print('Libration in longitude: {:.3f}'.format(lon_degrees))

Further documentation is here:

https://rhodesmill.org/skyfield/planetary.html#computing-lunar-libration

Brandon Rhodes
  • 991
  • 7
  • 12