Python ObserverGravity function.

This commit is contained in:
Don Cross
2021-07-19 22:09:49 -04:00
parent a9479832dd
commit aa2eb01dbf
8 changed files with 256 additions and 1 deletions

View File

@@ -1637,6 +1637,30 @@ Keep calling this function as many times as you want to keep finding more transi
---
<a name="ObserverGravity"></a>
### ObserverGravity(latitude, height)
**Calculates the gravitational acceleration experienced by an observer on the Earth.**
This function implements the WGS 84 Ellipsoidal Gravity Formula.
The result is a combination of inward gravitational acceleration
with outward centrifugal acceleration, as experienced by an observer
in the Earth's rotating frame of reference.
The resulting value increases toward the Earth's poles and decreases
toward the equator, consistent with changes of the weight measured
by a spring scale of a fixed mass moved to different latitudes and heights
on the Earth.
| Type | Parameter | Description |
| --- | --- | --- |
| `float` | `latitude` | The latitude of the observer in degrees north or south of the equator. By formula symmetry, positive latitudes give the same answer as negative latitudes, so the sign does not matter. |
| `float` | `height` | The height above the sea level geoid in meters. No range checking is done; however, accuracy is only valid in the range 0 to 100000 meters. |
### Returns: `float`
The effective gravitational acceleration expressed in meters per second squared [m/s^2].
---
<a name="ObserverVector"></a>
### ObserverVector(time, observer, ofdate)

View File

@@ -4404,6 +4404,38 @@ def VectorObserver(vector, ofdate):
ovec = _nutation(ovec, vector.t, _PrecessDir.From2000)
return _inverse_terra(ovec, gast)
def ObserverGravity(latitude, height):
"""Calculates the gravitational acceleration experienced by an observer on the Earth.
This function implements the WGS 84 Ellipsoidal Gravity Formula.
The result is a combination of inward gravitational acceleration
with outward centrifugal acceleration, as experienced by an observer
in the Earth's rotating frame of reference.
The resulting value increases toward the Earth's poles and decreases
toward the equator, consistent with changes of the weight measured
by a spring scale of a fixed mass moved to different latitudes and heights
on the Earth.
Parameters
----------
latitude : float
The latitude of the observer in degrees north or south of the equator.
By formula symmetry, positive latitudes give the same answer as negative
latitudes, so the sign does not matter.
height : float
The height above the sea level geoid in meters.
No range checking is done; however, accuracy is only valid in the
range 0 to 100000 meters.
Returns
-------
float
The effective gravitational acceleration expressed in meters per second squared [m/s^2].
"""
s2 = math.sin(math.radians(latitude)) ** 2
g0 = 9.7803253359 * (1.0 + 0.00193185265241*s2) / math.sqrt(1.0 - 0.00669437999013*s2)
return g0 * (1.0 - (3.15704e-07 - 2.10269e-09*s2)*height + 7.37452e-14*height*height)
@enum.unique
class Refraction(enum.Enum):
"""Selects if/how to correct for atmospheric refraction.