Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bccd9e2
commit 1bc379f
Showing
9 changed files
with
248 additions
and
77 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
User guide | ||
========== | ||
|
||
Units (`gmeterpy.units`) | ||
------------------------ | ||
|
||
The unit aware calculations is one of the main goals of the `gMeterPy`. | ||
We are using `astropy.units` sub-package for this. To use units you need | ||
to import `gmeterpy.units` module: | ||
|
||
>>> import gmeterpy.units as u | ||
|
||
And now you can work with gravity acceleration SI units: | ||
|
||
>>> gravity = 9.8 * u.m / u.s**2 | ||
>>> gravity | ||
<Quantity 9.8 m / s2> | ||
|
||
and convert them to more convinient CGS units: | ||
|
||
>>> gravity.to(u.Gal) | ||
<Quantity 980. Gal> | ||
|
||
and even use prefixes (u -- micro): | ||
|
||
>>> gravity.to(u.uGal) | ||
<Quantity 9.8e+08 uGal> | ||
|
||
In addition to Astropy built-in units we introduce Eotvos unit for | ||
the gravity gradient: | ||
|
||
>>> gradient = 0.3086 * u.mGal / u.m | ||
>>> gradient.to(u.E) | ||
<Quantity 3086. E> | ||
|
||
|
||
Constants (`gmeterpy.constants`) | ||
-------------------------------- | ||
|
||
The `gMeterPy` uses `astropy.constants` sub-package for handling constants. | ||
We expand it for some frequently used constants in gravimetry. | ||
|
||
+------------+-------+------------------------------------------------+ | ||
| Constant | Description | | ||
+============+========================================================+ | ||
| `omega` | Mean angular rotation rate of the Earth | | ||
+------------+-------+------------------------------------------------+ | ||
| `atm_sens` | Default gravity/pressure sensitivity (0.3 uGal / mbar) | | ||
+------------+-------+------------------------------------------------+ | ||
|
||
International Standard Atmosphere | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The Standard Atmosphere (ISO 2533:1975) is used to calculate | ||
the normal pressure in the atmospheric pressure correction. | ||
|
||
+----------+-------+----------------------------------------------+ | ||
| Constant | Description | | ||
+==========+======================================================+ | ||
| `p0` | Standard atmospheric pressure at sea level | | ||
+----------+-------+----------------------------------------------+ | ||
| `L` | Temperature lapse rate | | ||
+----------+-------+----------------------------------------------+ | ||
| `Tn` | Standard thermodynamic air temperature at sea level | | ||
+----------+-------+----------------------------------------------+ | ||
| `gn` | Standard acceleration of free-fall | | ||
+----------+-------+----------------------------------------------+ | ||
| `M` | Air molar mass at sea level | | ||
+----------+-------+----------------------------------------------+ | ||
| `R` | Universal gas constant | | ||
+----------+-------+----------------------------------------------+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Constants for gMeterPy. | ||
""" | ||
|
||
from astropy.constants import Constant | ||
|
||
|
||
omega = Constant( | ||
abbrev='omega', | ||
name='Mean angular rotation rate of the Earth', | ||
value=7292115.0e-11, | ||
unit='rad / s', | ||
uncertainty=0.0, | ||
reference='') | ||
|
||
atm_sens = Constant( | ||
abbrev='atm_sens', | ||
name='Default sensitivity of changes in gravity ' | ||
'with variations in atmospheric pressure.', | ||
value=0.3, | ||
unit='uGal / mbar', | ||
uncertainty=0.0, | ||
reference='IAG 1983 Resolution no.9') | ||
|
||
|
||
# ISO 2533:1975 constants | ||
class ISA1975(Constant): | ||
default_reference = 'Standard Atmosphere ISO 2533:1975' | ||
_registry = {} | ||
_has_incompatible_units = set() | ||
|
||
|
||
p0 = ISA1975('p0', 'Standard atmospheric pressure at sea level.', | ||
101325.0, 'Pa', 0.0, system='si') | ||
|
||
L = ISA1975('L', 'Temperature lapse rate.', | ||
0.0065, 'K / m', 0.0, system='si') | ||
|
||
Tn = ISA1975('Tn', 'Standard thermodynamic air temperature at sea level.', | ||
288.15, 'K', 0.0, system='si') | ||
|
||
gn = ISA1975('gn', 'Standard acceleration of free-fall.', | ||
9.80665, 'm / s**2', 0.0, system='si') | ||
|
||
M = ISA1975('M', 'Air molar mass at sea level.', | ||
0.028964420, 'kg / mol', 0.0, system='si') | ||
|
||
R = ISA1975('R', 'Universal gas constant.', | ||
8.31432, 'J / (mol * K)', 0.0, system='si') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.