.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "GRAVITY 1" .TH GRAVITY 1 2023-07-25 "GeographicLib 2.3" "GeographicLib Utilities" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Gravity \-\- compute the earth's gravity field .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fBGravity\fR [ \fB\-n\fR \fIname\fR ] [ \fB\-d\fR \fIdir\fR ] [ \fB\-N\fR \fINmax\fR ] [ \fB\-M\fR \fIMmax\fR ] [ \fB\-G\fR | \fB\-D\fR | \fB\-A\fR | \fB\-H\fR ] [ \fB\-c\fR \fIlat\fR \fIh\fR ] [ \fB\-w\fR ] [ \fB\-p\fR \fIprec\fR ] [ \fB\-v\fR ] [ \fB\-\-comment\-delimiter\fR \fIcommentdelim\fR ] [ \fB\-\-version\fR | \fB\-h\fR | \fB\-\-help\fR ] [ \fB\-\-input\-file\fR \fIinfile\fR | \fB\-\-input\-string\fR \fIinstring\fR ] [ \fB\-\-line\-separator\fR \fIlinesep\fR ] [ \fB\-\-output\-file\fR \fIoutfile\fR ] .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBGravity\fR reads in positions on standard input and prints out the gravitational field on standard output. .PP The input line is of the form \fIlat\fR \fIlon\fR \fIh\fR. \fIlat\fR and \fIlon\fR are the latitude and longitude expressed as decimal degrees or degrees, minutes, and seconds; for details on the allowed formats for latitude and longitude, see the \f(CW\*(C`GEOGRAPHIC COORDINATES\*(C'\fR section of \&\fBGeoConvert\fR\|(1). \fIh\fR is the height above the ellipsoid in meters; this quantity is optional and defaults to 0. Alternatively, the gravity field can be computed at various points on a circle of latitude (constant \fIlat\fR and \fIh\fR) via the \fB\-c\fR option; in this case only the longitude should be given on the input lines. The quantities printed out are governed by the \fB\-G\fR (default), \fB\-D\fR, \fB\-A\fR, or \fB\-H\fR options. .PP All the supported gravity models, except for grs80, use WGS84 as the reference ellipsoid \fIa\fR = 6378137 m, \fIf\fR = 1/298.257223563, \fIomega\fR = 7292115e\-11 rad/s, and \fIGM\fR = 3986004.418e8 m^3/s^2. .SH OPTIONS .IX Header "OPTIONS" .IP "\fB\-n\fR \fIname\fR" 4 .IX Item "-n name" use gravity field model \fIname\fR instead of the default \f(CW\*(C`egm96\*(C'\fR. See "MODELS". .IP "\fB\-d\fR \fIdir\fR" 4 .IX Item "-d dir" read gravity models from \fIdir\fR instead of the default. See "MODELS". .IP "\fB\-N\fR \fINmax\fR" 4 .IX Item "-N Nmax" limit the degree of the model to \fINmax\fR. .IP "\fB\-M\fR \fIMmax\fR" 4 .IX Item "-M Mmax" limit the order of the model to \fIMmax\fR. .IP \fB\-G\fR 4 .IX Item "-G" compute the acceleration due to gravity (including the centrifugal acceleration due the the earth's rotation) \fBg\fR. The output consists of \&\fIgx\fR \fIgy\fR \fIgz\fR (all in m/s^2), where the \fIx\fR, \fIy\fR, and \fIz\fR components are in easterly, northerly, and up directions, respectively. Usually \fIgz\fR is negative. .IP \fB\-D\fR 4 .IX Item "-D" compute the gravity disturbance \fBdelta\fR = \fBg\fR \- \fBgamma\fR, where \&\fBgamma\fR is the "normal" gravity due to the reference ellipsoid . The output consists of \fIdeltax\fR \fIdeltay\fR \fIdeltaz\fR (all in mGal, 1 mGal = 10^\-5 m/s^2), where the \fIx\fR, \fIy\fR, and \fIz\fR components are in easterly, northerly, and up directions, respectively. Note that \fIdeltax\fR = \&\fIgx\fR, because \fIgammax\fR = 0. .IP \fB\-A\fR 4 .IX Item "-A" computes the gravitational anomaly. The output consists of 3 items \&\fIDg01\fR \fIxi\fR \fIeta\fR, where \fIDg01\fR is in mGal (1 mGal = 10^\-5 m/s^2) and \fIxi\fR and \fIeta\fR are in arcseconds. The gravitational anomaly compares the gravitational field \fBg\fR at \fIP\fR with the normal gravity \&\fBgamma\fR at \fIQ\fR where the \fIP\fR is vertically above \fIQ\fR and the gravitational potential at \fIP\fR equals the normal potential at \fIQ\fR. \&\fIDg01\fR gives the difference in the magnitudes of these two vectors and \&\fIxi\fR and \fIeta\fR give the difference in their directions (as northerly and easterly components). The calculation uses a spherical approximation to match the results of the NGA's synthesis programs. .IP \fB\-H\fR 4 .IX Item "-H" compute the height of the geoid above the reference ellipsoid (in meters). In this case, \fIh\fR should be zero. The results accurately match the results of the NGA's synthesis programs. \fBGeoidEval\fR\|(1) can compute geoid heights much more quickly by interpolating on a grid of precomputed results; however the results from \fBGeoidEval\fR\|(1) are only accurate to a few millimeters. .IP "\fB\-c\fR \fIlat\fR \fIh\fR" 4 .IX Item "-c lat h" evaluate the field on a circle of latitude given by \fIlat\fR and \fIh\fR instead of reading these quantities from the input lines. In this case, \&\fBGravity\fR can calculate the field considerably more quickly. If geoid heights are being computed (the \fB\-H\fR option), then \fIh\fR must be zero. .IP \fB\-w\fR 4 .IX Item "-w" toggle the longitude first flag (it starts off); if the flag is on, then on input and output, longitude precedes latitude (except that, on input, this can be overridden by a hemisphere designator, \fIN\fR, \fIS\fR, \fIE\fR, \&\fIW\fR). .IP "\fB\-p\fR \fIprec\fR" 4 .IX Item "-p prec" set the output precision to \fIprec\fR. By default \fIprec\fR is 5 for acceleration due to gravity, 3 for the gravity disturbance and anomaly, and 4 for the geoid height. .IP \fB\-v\fR 4 .IX Item "-v" print information about the gravity model on standard error before processing the input. .IP "\fB\-\-comment\-delimiter\fR \fIcommentdelim\fR" 4 .IX Item "--comment-delimiter commentdelim" set the comment delimiter to \fIcommentdelim\fR (e.g., "#" or "//"). If set, the input lines will be scanned for this delimiter and, if found, the delimiter and the rest of the line will be removed prior to processing and subsequently appended to the output line (separated by a space). .IP \fB\-\-version\fR 4 .IX Item "--version" print version and exit. .IP \fB\-h\fR 4 .IX Item "-h" print usage, the default gravity path and name, and exit. .IP \fB\-\-help\fR 4 .IX Item "--help" print full documentation and exit. .IP "\fB\-\-input\-file\fR \fIinfile\fR" 4 .IX Item "--input-file infile" read input from the file \fIinfile\fR instead of from standard input; a file name of "\-" stands for standard input. .IP "\fB\-\-input\-string\fR \fIinstring\fR" 4 .IX Item "--input-string instring" read input from the string \fIinstring\fR instead of from standard input. All occurrences of the line separator character (default is a semicolon) in \fIinstring\fR are converted to newlines before the reading begins. .IP "\fB\-\-line\-separator\fR \fIlinesep\fR" 4 .IX Item "--line-separator linesep" set the line separator character to \fIlinesep\fR. By default this is a semicolon. .IP "\fB\-\-output\-file\fR \fIoutfile\fR" 4 .IX Item "--output-file outfile" write output to the file \fIoutfile\fR instead of to standard output; a file name of "\-" stands for standard output. .SH MODELS .IX Header "MODELS" \&\fBGravity\fR computes the gravity field using one of the following models .PP .Vb 10 \& egm84, earth gravity model 1984. See \& https://earth\-info.nga.mil/index.php?dir=wgs84&action=wgs84#tab_egm84 \& egm96, earth gravity model 1996. See \& https://earth\-info.nga.mil/index.php?dir=wgs84&action=wgs84#tab_egm96 \& egm2008, earth gravity model 2008. See \& https://earth\-info.nga.mil/index.php?dir=wgs84&action=wgs84#tab_egm2008 \& wgs84, world geodetic system 1984. This returns the normal \& gravity for the WGS84 ellipsoid. \& grs80, geodetic reference system 1980. This returns the normal \& gravity for the GRS80 ellipsoid. .Ve .PP These models approximate the gravitation field above the surface of the earth. By default, the \f(CW\*(C`egm96\*(C'\fR gravity model is used. This may changed by setting the environment variable \&\f(CW\*(C`GEOGRAPHICLIB_GRAVITY_NAME\*(C'\fR or with the \fB\-n\fR option. .PP The gravity models will be loaded from a directory specified at compile time. This may changed by setting the environment variables \&\f(CW\*(C`GEOGRAPHICLIB_GRAVITY_PATH\*(C'\fR or \f(CW\*(C`GEOGRAPHICLIB_DATA\*(C'\fR, or with the \&\fB\-d\fR option. The \fB\-h\fR option prints the default gravity path and name. Use the \fB\-v\fR option to ascertain the full path name of the data file. .PP Instructions for downloading and installing gravity models are available at . .SH ENVIRONMENT .IX Header "ENVIRONMENT" .IP \fBGEOGRAPHICLIB_GRAVITY_NAME\fR 4 .IX Item "GEOGRAPHICLIB_GRAVITY_NAME" Override the compile-time default gravity name of \f(CW\*(C`egm96\*(C'\fR. The \fB\-h\fR option reports the value of \fBGEOGRAPHICLIB_GRAVITY_NAME\fR, if defined, otherwise it reports the compile-time value. If the \fB\-n\fR \fIname\fR option is used, then \fIname\fR takes precedence. .IP \fBGEOGRAPHICLIB_GRAVITY_PATH\fR 4 .IX Item "GEOGRAPHICLIB_GRAVITY_PATH" Override the compile-time default gravity path. This is typically \&\f(CW\*(C`/usr/local/share/GeographicLib/gravity\*(C'\fR on Unix-like systems and \&\f(CW\*(C`C:/ProgramData/GeographicLib/gravity\*(C'\fR on Windows systems. The \fB\-h\fR option reports the value of \fBGEOGRAPHICLIB_GRAVITY_PATH\fR, if defined, otherwise it reports the compile-time value. If the \fB\-d\fR \fIdir\fR option is used, then \fIdir\fR takes precedence. .IP \fBGEOGRAPHICLIB_DATA\fR 4 .IX Item "GEOGRAPHICLIB_DATA" Another way of overriding the compile-time default gravity path. If it is set (and if \fBGEOGRAPHICLIB_GRAVITY_PATH\fR is not set), then $\fBGEOGRAPHICLIB_DATA\fR/gravity is used. .SH ERRORS .IX Header "ERRORS" An illegal line of input will print an error message to standard output beginning with \f(CW\*(C`ERROR:\*(C'\fR and causes \fBGravity\fR to return an exit code of 1. However, an error does not cause \fBGravity\fR to terminate; following lines will be converted. .SH EXAMPLES .IX Header "EXAMPLES" The gravity field from EGM2008 at the top of Mount Everest .PP .Vb 2 \& echo 27:59:17N 86:55:32E 8820 | Gravity \-n egm2008 \& => \-0.00001 0.00103 \-9.76782 .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBGeoConvert\fR\|(1), \fBGeoidEval\fR\|(1), \fBgeographiclib\-get\-gravity\fR\|(8). .SH AUTHOR .IX Header "AUTHOR" \&\fBGravity\fR was written by Charles Karney. .SH HISTORY .IX Header "HISTORY" \&\fBGravity\fR was added to GeographicLib, , in version 1.16.