Skip to content

Commit

Permalink
Specify that mean_radius R1 is the mean radius of the ellipsoid semi-…
Browse files Browse the repository at this point in the history
…axes
  • Loading branch information
Mark Wieczorek authored and MarkWieczorek committed Mar 25, 2024
1 parent 2cb926e commit 418e1b0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
23 changes: 15 additions & 8 deletions boule/_constants.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Gravitational constant
# units: m3 / (kg s2)
# Copyright (c) 2019 The Boule Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
#
# Reference:
# E. Tiesinga, P. J. Mohr, D. B. Newell, and B. N. Taylor (2019),
# "The 2018 CODATA Recommended Values of the Fundamental Physical Constants"
# (Web Version 8.1). Database developed by J. Baker, M. Douma, and S.
# Kotochigova. Available at http://physics.nist.gov/constants, National
# Institute of Standards and Technology, Gaithersburg, MD 20899.
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
"""
Gravitational constant
units: m3 / (kg s2)
Reference:
E. Tiesinga, P. J. Mohr, D. B. Newell, and B. N. Taylor (2019),
"The 2018 CODATA Recommended Values of the Fundamental Physical Constants"
(Web Version 8.1). Database developed by J. Baker, M. Douma, and S.
Kotochigova. Available at http://physics.nist.gov/constants, National
Institute of Standards and Technology, Gaithersburg, MD 20899.
"""
G = 6.67430e-11
4 changes: 2 additions & 2 deletions boule/_ellipsoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def second_eccentricity(self):
@property
def mean_radius(self):
"""
The arithmetic mean radius of the ellipsoid [Moritz1988]_.
The arithmetic mean radius of the ellipsoid semi-axes [Moritz1988]_.
Definition: :math:`R_1 = (2a + b)/3`.
Units: :math:`m`.
"""
Expand Down Expand Up @@ -255,7 +255,7 @@ def volume_equivalent_radius(self):
Definition: :math:`R_3 = \left(\dfrac{3}{4 \pi} V \right)^{1/3}`.
Units: :math:`m`.
"""
return (self.volume * 3 / 4 / np.pi)**(1 / 3)
return (self.volume * 3 / 4 / np.pi) ** (1 / 3)

Check warning on line 258 in boule/_ellipsoid.py

View check run for this annotation

Codecov / codecov/patch

boule/_ellipsoid.py#L258

Added line #L258 was not covered by tests

@property
def _emm(self):
Expand Down
6 changes: 3 additions & 3 deletions boule/_sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ def first_eccentricity(self):
@property
def mean_radius(self):
"""
The mean radius of the sphere is by definition equal to its radius.
Added for compatibility with pymap3d.
Definition: :math:`R = R`.
The arithmetic mean radius of the ellipsoid semi-axes is equal to its
radius. Added for compatibility with pymap3d.
Definition: :math:`R_1 = R`.
Units: :math:`m`.
"""
return self.radius

Check warning on line 189 in boule/_sphere.py

View check run for this annotation

Codecov / codecov/patch

boule/_sphere.py#L189

Added line #L189 was not covered by tests
Expand Down
6 changes: 3 additions & 3 deletions boule/_triaxialellipsoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ def _check_geocentric_grav_const(self, geocentric_grav_const, value):
@property
def mean_radius(self):
r"""
The arithmetic mean radius of the ellipsoid.
Definition: :math:`R = \dfrac{a + b + c}{3}`.
The arithmetic mean radius of the ellipsoid semi-axes.
Definition: :math:`R_1 = \dfrac{a + b + c}{3}`.
Units: :math:`m`.
"""
return (self.semimajor_axis + self.semimedium_axis + self.semiminor_axis) / 3
Expand Down Expand Up @@ -212,7 +212,7 @@ def volume_equivalent_radius(self):
Definition: :math:`R_3 = \left(\dfrac{3}{4 \pi} V \right)^{1/3}`.
Units: :math:`m`.
"""
return (self.volume * 3 / 4 / np.pi)**(1 / 3)
return (self.volume * 3 / 4 / np.pi) ** (1 / 3)

Check warning on line 215 in boule/_triaxialellipsoid.py

View check run for this annotation

Codecov / codecov/patch

boule/_triaxialellipsoid.py#L215

Added line #L215 was not covered by tests

@property
def equatorial_flattening(self):
Expand Down

0 comments on commit 418e1b0

Please sign in to comment.