Skip to content

Commit bdf750d

Browse files
Mark WieczorekMarkWieczorek
authored andcommitted
Update normal gravity web documentation
1 parent e1b650a commit bdf750d

File tree

3 files changed

+51
-43
lines changed

3 files changed

+51
-43
lines changed

boule/_ellipsoid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ def normal_gravity(self, latitude, height, si_units=False):
845845
z_pp2 = r_p2 - z_p2
846846
r_pp2 = r_p2 + z_p2
847847

848-
if self.flattening < 5.e-5:
848+
if self.flattening < 5.0e-5:
849849
# Use the Taylor series approximation for flattenings close to
850850
# zero to avoid numerical issues.
851851
cosbeta_p2 = (

boule/tests/test_ellipsoid.py

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,6 @@ def test_check_flattening():
4040
geocentric_grav_const=0,
4141
angular_velocity=0,
4242
)
43-
with pytest.raises(ValueError):
44-
Ellipsoid(
45-
name="zero_flattening",
46-
semimajor_axis=1.0,
47-
flattening=0,
48-
geocentric_grav_const=0,
49-
angular_velocity=0,
50-
)
5143
with pytest.raises(ValueError):
5244
Ellipsoid(
5345
name="almost_zero_negative_flattening",
@@ -56,15 +48,6 @@ def test_check_flattening():
5648
geocentric_grav_const=0,
5749
angular_velocity=0,
5850
)
59-
with warnings.catch_warnings(record=True) as warn:
60-
Ellipsoid(
61-
name="almost-zero-flattening",
62-
semimajor_axis=1,
63-
flattening=1e-8,
64-
geocentric_grav_const=1,
65-
angular_velocity=0,
66-
)
67-
assert len(warn) >= 1
6851

6952

7053
def test_check_semimajor_axis():
@@ -396,9 +379,9 @@ def test_emm_wgs84():
396379

397380
def test_small_flattenings():
398381
"Check that no errors arise when using small values for the flattening"
399-
flattening = 10.**(-np.arange(1, 20, .5))
400-
latitude = np.linspace(-90, 90, 13 )
401-
height = np.array([[1.e3] * len(latitude)])
382+
flattening = 10.0 ** (-np.arange(1, 20, 0.5))
383+
latitude = np.linspace(-90, 90, 13)
384+
height = np.array([[1.0e3] * len(latitude)])
402385
with warnings.catch_warnings(record=True) as warn:
403386
for f in flattening:
404387
ellipsoid = Ellipsoid(
@@ -408,10 +391,10 @@ def test_small_flattenings():
408391
geocentric_grav_const=WGS84.geocentric_grav_const,
409392
angular_velocity=WGS84.angular_velocity,
410393
)
411-
big_u_0 = ellipsoid.reference_normal_gravity_potential
412-
g_b = ellipsoid.gravity_pole
413-
g_a = ellipsoid.gravity_equator
414-
big_v = ellipsoid.normal_gravitational_potential(latitude, height)
415-
big_u = ellipsoid.normal_gravity_potential(latitude, height)
416-
gamma = ellipsoid.normal_gravity(latitude, height)
417-
assert warn == None
394+
_ = ellipsoid.reference_normal_gravity_potential
395+
_ = ellipsoid.gravity_pole
396+
_ = ellipsoid.gravity_equator
397+
_ = ellipsoid.normal_gravitational_potential(latitude, height)
398+
_ = ellipsoid.normal_gravity_potential(latitude, height)
399+
_ = ellipsoid.normal_gravity(latitude, height)
400+
assert len(warn) == 0

doc/user_guide/normal_gravity.rst

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ And plotted with :mod:`pygmt`:
9191
particularly useful for geophysics.
9292

9393
These calculations can be performed for any oblate ellipsoid (see
94-
:ref:`ellipsoids`). Here is the normal gravity of the Martian ellipsoid:
94+
:ref:`ellipsoids`). Here is an example for the normal gravity of the Martian
95+
ellipsoid:
9596

9697
.. jupyter-execute::
9798

@@ -109,10 +110,18 @@ These calculations can be performed for any oblate ellipsoid (see
109110

110111

111112
Notice that the overall trend is the same as for the Earth (the Martian
112-
ellipsoid is also oblate) but the range of values is different. The mean
113+
ellipsoid is slightly more oblate than Earth) but the range of values
114+
is different. The mean
113115
gravity on Mars is much weaker than on the Earth: around 370,000 mGal or 3.7
114116
m/s² when compared to 970,000 mGal or 9.7 m/s² for the Earth.
115117

118+
The computations of the gravimetric quantities in boule are accurate for oblate
119+
ellipsoids with flattenings that are arbitrarily small. In fact, even a
120+
flattening of zero is permissible. Whereas the standard textbook equations
121+
become numerically unstable when the flattening is less than about
122+
:math:`1-^{-7}`, boule makes use of approximate equations in the low flattening
123+
limit that do not suffer any numerical limitations.
124+
116125
.. admonition:: Assumptions for oblate ellipsoids
117126
:class: important
118127

@@ -132,16 +141,28 @@ Spheres
132141
-------
133142

134143
Method :meth:`boule.Sphere.normal_gravity` performs the normal gravity
135-
calculations for spheres. It behaves mostly the same as the oblate ellipsoid
136-
version except that the latitude is a *geocentric spherical latitude* instead
137-
of a geodetic latitude (for spheres they are actually the same thing).
144+
calculations for spheres. This method behaves mostly the same as the oblate
145+
ellipsoid version, with two exceptions. First, spherical coordinates are
146+
used in the case of a sphere, and the latitude coordinate corresponds to
147+
*geocentric spherical latitude*. Geodetic and spherical latitude are, in fact,
148+
the same for an ellipsoid with zero flattening.
149+
150+
Second, boule makes the assumption that the interior density distribution of
151+
the planet varies only as a function of radius. Because of this, the normal
152+
gravitation potential is constant on the sphere surface, but the normal gravity
153+
potential (which includes the centrifugal potential) is not.
154+
155+
One planetary object that makes use of the Sphere class is the Moon. This
156+
example computes the normal gravity of the Moon at 45 degrees latitude
157+
and for heights between 0 and 1 km above the reference radius.
138158

139159
.. jupyter-execute::
140160

141161
gamma = bl.Moon2015.normal_gravity(latitude=45, height=height)
142162
print(gamma)
143163

144-
This is what the normal gravity of Moon looks like on a map:
164+
This is what the normal gravity of Moon looks like in map form, 10 km above
165+
the surface:
145166

146167
.. jupyter-execute::
147168

@@ -162,22 +183,26 @@ This is what the normal gravity of Moon looks like on a map:
162183

163184
Normal gravity of spheres is calculated under the following assumptions:
164185

186+
* The :term:`gravitational potential` is constant on the surface of the
187+
ellipsoid.
188+
* The internal density structure is unspecified but must be either
189+
homogeneous or vary only as a function of radius (e.g., in concentric
190+
layers).
165191
* The normal gravity is the magnitude of the gradient of the :term:`gravity
166192
potential` of the sphere.
167-
* The internal density structure is unspecified but must be either
168-
homogeneous or vary radially (e.g., in concentric layers).
169193

170-
A constant gravity potential on the surface of a rotating sphere is not
171-
possible. Therefore, the normal gravity calculated for a sphere is
172-
different than that of an oblate ellipsoid (hence why we need a separate
173-
method of calculation).
194+
**Important:** Unlike an ellipsoid, the normal gravity potential of a
195+
sphere is not constant on its surface, and the normal gravity vector is
196+
not perpendicular to the surface.
197+
174198

175199
Gravity versus gravitation
176200
++++++++++++++++++++++++++
177201

178-
Notice that the variation between poles and equator is much smaller than for
179-
the Earth or Mars.
180-
That's because the **variation is due solely to the centrifugal acceleration**.
202+
Notice that the variation of the normal gravity between the poles and equator
203+
for the Moon is much smaller than for the Earth or Mars.
204+
That's because the **variation is due solely to the centrifugal acceleration**,
205+
and the angular rotation rate of the Moon is small.
181206

182207
We can see this clearly when we calculate the **normal gravitation** (without
183208
the centrifugal component) using :meth:`boule.Sphere.normal_gravitation`:

0 commit comments

Comments
 (0)