Skip to content

Commit

Permalink
Make gravity units more explicit (#421)
Browse files Browse the repository at this point in the history
Add admonitions in forward modelling functions for prisms and
tesseroids, making the returned units more explicit.
  • Loading branch information
santisoler authored Jul 6, 2023
1 parent cf89138 commit a8b4359
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
12 changes: 11 additions & 1 deletion harmonica/_forward/prism.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def prism_gravity(
progressbar=False,
disable_checks=False,
):
"""
r"""
Gravitational fields of right-rectangular prisms in Cartesian coordinates
Compute the gravitational potential, gravitational acceleration and tensor
Expand All @@ -76,6 +76,14 @@ def prism_gravity(
i.e. the ``g_ez`` is the non-diagonal **easting-downward** tensor
component.
.. important::
- The gravitational potential is returned in
:math:`\text{J}/\text{kg}`.
- The gravity acceleration components are returned in mgal
(:math:`\text{m}/\text{s}^2`).
- The tensor components are returned in Eotvos (:math:`\text{s}^{-2}`).
Parameters
----------
coordinates : list of arrays
Expand Down Expand Up @@ -124,6 +132,8 @@ def prism_gravity(
-------
result : array
Gravitational field generated by the prisms on the computation points.
Gravitational potential is returned in :math:`\text{J}/\text{kg}`,
acceleration components in mgal, and tensor components in Eotvos.
Notes
-----
Expand Down
12 changes: 10 additions & 2 deletions harmonica/_forward/tesseroid.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def tesseroid_gravity(
dtype=np.float64,
disable_checks=False,
):
"""
r"""
Compute gravitational field of tesseroids on computation points.
.. warning::
Expand All @@ -51,6 +51,13 @@ def tesseroid_gravity(
It is equivalent to the opposite of the radial component, therefore
it's positive if the acceleration vector points inside the spheroid.
.. important::
- The gravitational potential is returned in
:math:`\text{J}/\text{kg}`.
- The gravity acceleration components are returned in mgal
(:math:`\text{m}/\text{s}^2`).
Parameters
----------
coordinates : list of arrays
Expand Down Expand Up @@ -102,7 +109,8 @@ def tesseroid_gravity(
-------
result : array
Gravitational field generated by the tesseroids on the computation
points.
points. Gravitational potential is returned in
:math:`\text{J}/\text{kg}` and acceleration components in mgal.
References
----------
Expand Down

0 comments on commit a8b4359

Please sign in to comment.