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 ] [ -G | -D | -A | -H ] [ -c lat h ] [ -w
10       ] [ -p prec ] [ -v ] [ --comment-delimiter commentdelim ] [ --version |
11       -h | --help ] [ --input-file infile | --input-string instring ] [
12       --line-separator linesep ] [ --output-file outfile ]
13

DESCRIPTION

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

OPTIONS

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

MODELS

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

ENVIRONMENT

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

ERRORS

175       An illegal line of input will print an error message to standard output
176       beginning with "ERROR:" and causes Gravity to return an exit code of 1.
177       However, an error does not cause Gravity to terminate; following lines
178       will be converted.
179

EXAMPLES

181       The gravity field from EGM2008 at the top of Mount Everest
182
183           echo 27:59:17N 86:55:32E 8820 | Gravity -n egm2008
184           => -0.00001 0.00103 -9.76782
185

SEE ALSO

187       GeoConvert(1), GeoidEval(1), geographiclib-get-gravity(8).
188

AUTHOR

190       Gravity was written by Charles Karney.
191

HISTORY

193       Gravity was added to GeographicLib,
194       <https://geographiclib.sourceforge.io>, in version 1.16.
195
196
197
198GeographicLib 1.49                2017-10-05                        GRAVITY(1)
Impressum