Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lunar (and others) Topos Coordinates #124

Closed
hphilli5 opened this issue Mar 26, 2017 · 9 comments
Closed

Lunar (and others) Topos Coordinates #124

hphilli5 opened this issue Mar 26, 2017 · 9 comments

Comments

@hphilli5
Copy link

I have been using the Topos feature to calculate a rotation matrix from ICRS to an earth-centered, earth-fixed coordinate frame using the following method:

  1. Pull position of earth center referenced from solar system barycenter
  2. Pull position from solar system barycenter to 0 deg latitude, 0 deg longitude, 0 meter elevation. This is where the ECEF x axis would pierce the geoid
  3. Subtract setup.py uses setuptools feature but imports distutils #1 from Don’t recommend implicit relative imports in TODO #2 and calculate the unit vector of that. This is the unit vector of an ECEF x axis.
  4. Repeat 2) and 3) but for 90 deg latitude, 0 meter elevation (any longitude). This is the unit vector of an ECEF z axis.
  5. Take the cross product of ECEF z axis and ECEF x axis (in that order). This is the unit vector of an ECEF y axis.
  6. Steps 3-5 provide what is necessary to calculate a direction cosines matrix from ECEF to ICRS and vice versa (at a specific epoch)

I would like to be able to do the same thing for the lunar orientation (equatorial plane). Does this capability already exist and I'm overlooking? It appears that I can specify 'center' and 'center_name' with Topos, but it ends up just assuming earth-centered.

Thanks for creation and continued development of this awesome tool.

@davidmikolas
Copy link

davidmikolas commented Mar 26, 2017

related: Generate topos for body other than Earth #79 and also Method to access lunar libration data present in the ephemerides #80, I can't be of much help, but it is good to know there is interest!

@brandon-rhodes brandon-rhodes self-assigned this Mar 27, 2017
@brandon-rhodes
Copy link
Member

(Catching up, now that PyCon is over!)

No, Skyfield doesn't currently have a model of the Moon as a spheroid, nor any routines for understanding the JPL data files that might provide those data. I'd welcome contributions that start adding such capabilities but might not get to them myself for at least another few years.

As for generating your rotation matrix: am I correct that you're looking for something like the matrix computed near the bottom of terra() in earthlib.py, but with latitude and longitude set to zero? If so, then maybe we could come up with a way of exposing that matrix instead of having it thrown away when terra() is done with its computation. Take a look, and let me know what you think!

@brandon-rhodes brandon-rhodes removed their assignment May 19, 2018
@tcz
Copy link

tcz commented Jul 18, 2019

Hi @brandon-rhodes,
While I feel unable to perform this contribution, I'd be happy to reward your time spent on this with money if you are up for this.

@brandon-rhodes
Copy link
Member

@tcz I am definitely busy for the next 2 weeks, but am hoping to have more time for progress on Skyfield after that. You are interested in Skyfield being able to accept the lunar longitude and latitude of a spot on the lunar surface, and to return altitude+azimuth coordinates for objects above the horizon from that spot on the Moon?

@tcz
Copy link

tcz commented Jul 26, 2019

That's exactly right!

@davidmikolas
Copy link

davidmikolas commented Jul 26, 2019

@brandon-rhodes
Copy link
Member

I have just released Skyfield 1.16 which implements support for lunar latitude/longitude locations. Try it out, and let me know if you run into any snags or problems with the implementation!

https://rhodesmill.org/skyfield/planetary.html

It wound up taking about two weeks of half-time work, more than I was expecting, to get the coordinates to finally all agree! @tcz, if this came in time to be of any help to you, let me know if I should set up a Patreon or something to enable a donation. :)

@tcz
Copy link

tcz commented Dec 20, 2019 via email

@brandon-rhodes
Copy link
Member

@tcz — The review process took several weeks, but at your suggestion I have joined the GitHub sponsors program! There should now be a “Sponsor” link at the top of this page.

This is my first time trying to set up contribution levels and draft their descriptions. Whether you opt at this point to sponsor or not (it’s been 7 months, so you might of course have moved on to other projects!), if you have any advice about what levels would work best from the point of view of a potential sponsor, I would welcome an email with ideas about how to improve them. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants