fatiando / boule

Reference ellipsoids for geodesy and geophysics
https://www.fatiando.org/boule
BSD 3-Clause "New" or "Revised" License
38 stars 17 forks source link

Add a method for the ellipsoid geocentric radius #37

Closed leouieda closed 4 years ago

leouieda commented 4 years ago

This is the distance from the center of the ellipsoid to its surface as a function of geodetic latitude.

Fixes #34

Reminders:

leouieda commented 4 years ago

@MarkWieczorek just to check, this is what you had in mind right?

MarkWieczorek commented 4 years ago

That is about what I was looking for: But would it be possible to allow inputting geodetic or geocentric latitude? Perhaps you could just add a default parameter like geodetic=True. If False, the geocentric latitude would first be converted to geodetic.

I have almost never used geodetic coordinates, and when dealing with spherical harmonics, it is natural to use the gecentric latitude :)

leouieda commented 4 years ago

Hum, I'll need to think about this a bit since we need the radius in the first place to convert geocentric to geodetic. So it doesn't seem to be straight forward. But there should be a way.

leouieda commented 4 years ago

Alright, I worked out the equation and implemented the option for geodetic=False and some tests. I added a note saying that this is an exception since we generally favor solutions where the conversions are done by the user prior to input to simplify the code. But this wouldn't be an option here since there is no way to do the conversion without knowing the radius already.

Seems like I got my math right :slightly_smiling_face: