-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add geodetic to geocentric coordinates conversion #28
Conversation
The geodetic_to_geocentric function now correctly uses the first_eccentricity instead of the second one.
👍 Merged #27 so feel free to update/rebase this branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@santis19 just a minor comment but something we should think about. We can also merge this and change the name later but that's usually more work.
# To do so, we define a zero flattening, thus an infinite inverse flattening. | ||
spherical_ellipsoid = ReferenceEllipsoid( | ||
"unit_sphere", sphere_radius, np.infty, 0, 0 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I'm increasingly happy with the ellipsoid mechanics in Harmonica.
I merged in the changes from master so please remember to |
Co-Authored-By: santis19 <[email protected]>
Co-Authored-By: santis19 <[email protected]>
@santis19 this looks good to me. Just thinking if we should standardize the API for things that take in coordinates. It might be good to always have |
I'm going to merge this and we'll think about the arguments a bit more before making changes. Thanks @santis19 |
Convert geocentric coordinates (defined by the ReferenceEllipsoid) to
geocentric (spherical) coordinates. Only geodetic
latitude
andheight
are converted to
geocentric_latitude
andradius
, geocentric andgeodetic latitudes are equal. Add tests for new function: (1) test with
a "spherical" ellipsoid (in such case the geodetic and gecentric
coordinates are the same) (2) test with real ellipsoids on equator and
poles (on those points geodetic and geocentric latitudes are must be
equal).
Fixes #20
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.