fatiando / boule

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

Add optional argument geodetic to Ellipsoid.normal_gravity #162

Open MarkWieczorek opened 4 months ago

MarkWieczorek commented 4 months ago

The Ellipsoid.normal_gravity() method takes as input the geodetic latitude. I propose to add an optional argument geodetic=True/False that would allow the user to specify if the input latitudes are geodetic or geo/planetocentric. The default option would be to use geodetic. Though this could easily be accomplished using the spherical_to_geodetic method, this would make things easier for many applications where the geocentric latitude is the more appropriate value to use.

I note that that option is already implemented in the method Ellipsoid.geocentric_radius()

leouieda commented 3 months ago

The geocentric_radius is justified since it's calculated differently when using spherical coordinates. The normal gravity is not and passing the keyword will mean running the coordinates conversion under the hood.

I'm OK with this if it makes life easier for users.

MarkWieczorek commented 3 months ago

What if we noted that its preferable to input geodetic coordinates (which is the default), because the normal gravity routine uses a formalism that requires geodetic coordinates? If this is done repeatedly in a loop, then it wouldn't be very efficient to do the conversion over and over, but if its just a single call, then the computational load would be the same.

I only bring this up because in planetary geophysics, its really rare to use geodetic coordinates, so it would be a convenience for us. :)

leouieda commented 3 months ago

What if we noted that its preferable to input geodetic coordinates (which is the default), because the normal gravity routine uses a formalism that requires geodetic coordinates?

That sounds like a good idea! We can add it to the description of the geodetic argument.

I only bring this up because in planetary geophysics, its really rare to use geodetic coordinates, so it would be a convenience for us. :)

I've been reading more planetary papers and I noticed 🙂