1GRAVITY(1)                  GeographicLib Utilities                 GRAVITY(1)
2
3
4

NAME

6       Gravity -- compute the earth's gravity field
7

SYNOPSIS

9       Gravity [ -n name ] [ -d dir ] [ -N Nmax ] [ -M Mmax ] [ -G | -D | -A |
10       -H ] [ -c lat h ] [ -w ] [ -p prec ] [ -v ] [ --comment-delimiter
11       commentdelim ] [ --version | -h | --help ] [ --input-file infile |
12       --input-string instring ] [ --line-separator linesep ] [ --output-file
13       outfile ]
14

DESCRIPTION

16       Gravity reads in positions on standard input and prints out the
17       gravitational field on standard output.
18
19       The input line is of the form lat lon h.  lat and lon are the latitude
20       and longitude expressed as decimal degrees or degrees, minutes, and
21       seconds; for details on the allowed formats for latitude and longitude,
22       see the "GEOGRAPHIC COORDINATES" section of GeoConvert(1).  h is the
23       height above the ellipsoid in meters; this quantity is optional and
24       defaults to 0.  Alternatively, the gravity field can be computed at
25       various points on a circle of latitude (constant lat and h) via the -c
26       option; in this case only the longitude should be given on the input
27       lines.  The quantities printed out are governed by the -G (default),
28       -D, -A, or -H options.
29
30       All the supported gravity models, except for grs80, use WGS84 as the
31       reference ellipsoid a = 6378137 m, f = 1/298.257223563, omega =
32       7292115e-11 rad/s, and GM = 3986004.418e8 m^3/s^2.
33

OPTIONS

35       -n name
36           use gravity field model name instead of the default "egm96".  See
37           "MODELS".
38
39       -d dir
40           read gravity models from dir instead of the default.  See "MODELS".
41
42       -N Nmax
43           limit the degree of the model to Nmax.
44
45       -M Mmax
46           limit the order of the model to Mmax.
47
48       -G  compute the acceleration due to gravity (including the centrifugal
49           acceleration due the the earth's rotation) g.  The output consists
50           of gx gy gz (all in m/s^2), where the x, y, and z components are in
51           easterly, northerly, and up directions, respectively.  Usually gz
52           is negative.
53
54       -D  compute the gravity disturbance delta = g - gamma, where gamma is
55           the "normal" gravity due to the reference ellipsoid .  The output
56           consists of deltax deltay deltaz (all in mGal, 1 mGal = 10^-5
57           m/s^2), where the x, y, and z components are in easterly,
58           northerly, and up directions, respectively.  Note that deltax = gx,
59           because gammax = 0.
60
61       -A  computes the gravitational anomaly.  The output consists of 3 items
62           Dg01 xi eta, where Dg01 is in mGal (1 mGal = 10^-5 m/s^2) and xi
63           and eta are in arcseconds.  The gravitational anomaly compares the
64           gravitational field g at P with the normal gravity gamma at Q where
65           the P is vertically above Q and the gravitational potential at P
66           equals the normal potential at Q.  Dg01 gives the difference in the
67           magnitudes of these two vectors and xi and eta give the difference
68           in their directions (as northerly and easterly components).  The
69           calculation uses a spherical approximation to match the results of
70           the NGA's synthesis programs.
71
72       -H  compute the height of the geoid above the reference ellipsoid (in
73           meters).  In this case, h should be zero.  The results accurately
74           match the results of the NGA's synthesis programs.  GeoidEval(1)
75           can compute geoid heights much more quickly by interpolating on a
76           grid of precomputed results; however the results from GeoidEval(1)
77           are only accurate to a few millimeters.
78
79       -c lat h
80           evaluate the field on a circle of latitude given by lat and h
81           instead of reading these quantities from the input lines.  In this
82           case, Gravity can calculate the field considerably more quickly.
83           If geoid heights are being computed (the -H option), then h must be
84           zero.
85
86       -w  toggle the longitude first flag (it starts off); if the flag is on,
87           then on input and output, longitude precedes latitude (except that,
88           on input, this can be overridden by a hemisphere designator, N, S,
89           E, W).
90
91       -p prec
92           set the output precision to prec.  By default prec is 5 for
93           acceleration due to gravity, 3 for the gravity disturbance and
94           anomaly, and 4 for the geoid height.
95
96       -v  print information about the gravity model on standard error before
97           processing the input.
98
99       --comment-delimiter commentdelim
100           set the comment delimiter to commentdelim (e.g., "#" or "//").  If
101           set, the input lines will be scanned for this delimiter and, if
102           found, the delimiter and the rest of the line will be removed prior
103           to processing and subsequently appended to the output line
104           (separated by a space).
105
106       --version
107           print version and exit.
108
109       -h  print usage, the default gravity path and name, and exit.
110
111       --help
112           print full documentation and exit.
113
114       --input-file infile
115           read input from the file infile instead of from standard input; a
116           file name of "-" stands for standard input.
117
118       --input-string instring
119           read input from the string instring instead of from standard input.
120           All occurrences of the line separator character (default is a
121           semicolon) in instring are converted to newlines before the reading
122           begins.
123
124       --line-separator linesep
125           set the line separator character to linesep.  By default this is a
126           semicolon.
127
128       --output-file outfile
129           write output to the file outfile instead of to standard output; a
130           file name of "-" stands for standard output.
131

MODELS

133       Gravity computes the gravity field using one of the following models
134
135           egm84, earth gravity model 1984.  See
136             https://earth-info.nga.mil/index.php?dir=wgs84&action=wgs84#tab_egm84
137           egm96, earth gravity model 1996.  See
138             https://earth-info.nga.mil/index.php?dir=wgs84&action=wgs84#tab_egm96
139           egm2008, earth gravity model 2008.  See
140             https://earth-info.nga.mil/index.php?dir=wgs84&action=wgs84#tab_egm2008
141           wgs84, world geodetic system 1984.  This returns the normal
142             gravity for the WGS84 ellipsoid.
143           grs80, geodetic reference system 1980.  This returns the normal
144             gravity for the GRS80 ellipsoid.
145
146       These models approximate the gravitation field above the surface of the
147       earth.  By default, the "egm96" gravity model is used.  This may
148       changed by setting the environment variable
149       "GEOGRAPHICLIB_GRAVITY_NAME" or with the -n option.
150
151       The gravity models will be loaded from a directory specified at compile
152       time.  This may changed by setting the environment variables
153       "GEOGRAPHICLIB_GRAVITY_PATH" or "GEOGRAPHICLIB_DATA", or with the -d
154       option.  The -h option prints the default gravity path and name.  Use
155       the -v option to ascertain the full path name of the data file.
156
157       Instructions for downloading and installing gravity models are
158       available at
159       <https://geographiclib.sourceforge.io/html/gravity.html#gravityinst>.
160

ENVIRONMENT

162       GEOGRAPHICLIB_GRAVITY_NAME
163           Override the compile-time default gravity name of "egm96".  The -h
164           option reports the value of GEOGRAPHICLIB_GRAVITY_NAME, if defined,
165           otherwise it reports the compile-time value.  If the -n name option
166           is used, then name takes precedence.
167
168       GEOGRAPHICLIB_GRAVITY_PATH
169           Override the compile-time default gravity path.  This is typically
170           "/usr/local/share/GeographicLib/gravity" on Unix-like systems and
171           "C:/ProgramData/GeographicLib/gravity" on Windows systems.  The -h
172           option reports the value of GEOGRAPHICLIB_GRAVITY_PATH, if defined,
173           otherwise it reports the compile-time value.  If the -d dir option
174           is used, then dir takes precedence.
175
176       GEOGRAPHICLIB_DATA
177           Another way of overriding the compile-time default gravity path.
178           If it is set (and if GEOGRAPHICLIB_GRAVITY_PATH is not set), then
179           $GEOGRAPHICLIB_DATA/gravity is used.
180

ERRORS

182       An illegal line of input will print an error message to standard output
183       beginning with "ERROR:" and causes Gravity to return an exit code of 1.
184       However, an error does not cause Gravity to terminate; following lines
185       will be converted.
186

EXAMPLES

188       The gravity field from EGM2008 at the top of Mount Everest
189
190           echo 27:59:17N 86:55:32E 8820 | Gravity -n egm2008
191           => -0.00001 0.00103 -9.76782
192

SEE ALSO

194       GeoConvert(1), GeoidEval(1), geographiclib-get-gravity(8).
195

AUTHOR

197       Gravity was written by Charles Karney.
198

HISTORY

200       Gravity was added to GeographicLib,
201       <https://geographiclib.sourceforge.io>, in version 1.16.
202
203
204
205GeographicLib 1.52                2021-06-21                        GRAVITY(1)
Impressum