File: MagneticField.usage

package info (click to toggle)
geographiclib 1.37-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 9,688 kB
  • ctags: 4,871
  • sloc: cpp: 31,440; sh: 11,632; cs: 9,411; ansic: 1,428; java: 1,333; python: 1,131; makefile: 758; xml: 381; pascal: 30
file content (206 lines) | stat: -rw-r--r-- 9,864 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
int usage(int retval, bool brief) {
  if (brief)
    ( retval ? std::cerr : std::cout ) << "Usage:\n"
"    MagneticField [ -n name ] [ -d dir ] [ -t time | -c time lat h ] [ -r ]\n"
"    [ -T tguard ] [ -H hguard ] [ -p prec ] [ -v ] [ --comment-delimiter\n"
"    commentdelim ] [ --version | -h | --help ] [ --input-file infile |\n"
"    --input-string instring ] [ --line-separator linesep ] [ --output-file\n"
"    outfile ]\n"
"\n"
"For full documentation type:\n"
"    MagneticField --help\n"
"or visit:\n"
"    http://geographiclib.sf.net/1.37/MagneticField.1.html\n";
  else
    ( retval ? std::cerr : std::cout ) << "Man page:\n"
"NAME\n"
"       MagneticField -- compute the earth's magnetic field\n"
"\n"
"SYNOPSIS\n"
"       MagneticField [ -n name ] [ -d dir ] [ -t time | -c time lat h ] [ -r ]\n"
"       [ -T tguard ] [ -H hguard ] [ -p prec ] [ -v ] [ --comment-delimiter\n"
"       commentdelim ] [ --version | -h | --help ] [ --input-file infile |\n"
"       --input-string instring ] [ --line-separator linesep ] [ --output-file\n"
"       outfile ]\n"
"\n"
"DESCRIPTION\n"
"       MagneticField reads in times and positions on standard input and prints\n"
"       out the geomagnetic field on standard output and, optionally, its rate\n"
"       of change.\n"
"\n"
"       The input line is of the form time lat lon h. time is a date of the\n"
"       form 2012-07-03 or a fractional year such as 2012.5.  lat and lon are\n"
"       the latitude and longitude expressed as decimal degrees or degrees,\n"
"       minutes, and seconds; see GeoConvert(1) for details.  h is the height\n"
"       above the ellipsoid in meters; this is optional and defaults to zero.\n"
"       Alternatively, time can be given on the command line as the argument to\n"
"       the -t option, in which case it should not be included on the input\n"
"       lines.  Finally, the magnetic field can be computed at various points\n"
"       on a circle of latitude (constant time, lat, and h) via the -c option;\n"
"       in this case only the longitude should be given on the input lines.\n"
"\n"
"       The output consists of the following 7 items:\n"
"\n"
"         the declination (the direction of the horizontal component of\n"
"           the magnetic field measured clockwise from north) in degrees,\n"
"         the inclination (the direction of the magnetic field measured\n"
"           down from the horizontal) in degrees,\n"
"         the horizontal field in nanotesla (nT),\n"
"         the north component of the field in nT,\n"
"         the east component of the field in nT,\n"
"         the vertical component of the field in nT (down is positive),\n"
"         the total field in nT.\n"
"\n"
"       If the -r option is given, a second line is printed giving the rates of\n"
"       change of these quantities in degrees/yr and nT/yr.\n"
"\n"
"       The WGS84 ellipsoid is used, a = 6378137 m, f = 1/298.257223563.\n"
"\n"
"OPTIONS\n"
"       -n  use magnetic field model name instead of the default \"wmm2010\".\n"
"           See \"MODELS\".\n"
"\n"
"       -d  read magnetic models from dir instead of the default.  See\n"
"           \"MODELS\".\n"
"\n"
"       -t  evaluate the field at time instead of reading the time from the\n"
"           input lines.\n"
"\n"
"       -c  evaluate the field on a circle of latitude given by time, lat, h\n"
"           instead of reading these quantities from the input lines.  In this\n"
"           case, MagneticField can calculate the field considerably more\n"
"           quickly.\n"
"\n"
"       -r  toggle whether to report the rates of change of the field.\n"
"\n"
"       -T  signal an error if time lies tguard years (default 50 yr) beyond\n"
"           the range for the model.\n"
"\n"
"       -H  signal an error if h lies hguard meters (default 500000 m) beyond\n"
"           the range for the model.\n"
"\n"
"       -p  set the output precision to prec (default 1).  Fields are printed\n"
"           with precision with prec decimal places; angles use prec + 1\n"
"           places.\n"
"\n"
"       -v  print information about the magnetic model on standard error before\n"
"           processing the input.\n"
"\n"
"       --comment-delimiter\n"
"           set the comment delimiter to commentdelim (e.g., \"#\" or \"//\").  If\n"
"           set, the input lines will be scanned for this delimiter and, if\n"
"           found, the delimiter and the rest of the line will be removed prior\n"
"           to processing and subsequently appended to the output line\n"
"           (separated by a space).\n"
"\n"
"       --version\n"
"           print version and exit.\n"
"\n"
"       -h  print usage, the default magnetic path and name, and exit.\n"
"\n"
"       --help\n"
"           print full documentation and exit.\n"
"\n"
"       --input-file\n"
"           read input from the file infile instead of from standard input; a\n"
"           file name of \"-\" stands for standard input.\n"
"\n"
"       --input-string\n"
"           read input from the string instring instead of from standard input.\n"
"           All occurrences of the line separator character (default is a\n"
"           semicolon) in instring are converted to newlines before the reading\n"
"           begins.\n"
"\n"
"       --line-separator\n"
"           set the line separator character to linesep.  By default this is a\n"
"           semicolon.\n"
"\n"
"       --output-file\n"
"           write output to the file outfile instead of to standard output; a\n"
"           file name of \"-\" stands for standard output.\n"
"\n"
"MODELS\n"
"       MagneticField computes the geomagnetic field using one of the following\n"
"       models\n"
"\n"
"           wmm2010, the World Magnetic Model 2010, which approximates the\n"
"             main magnetic field for the period 2010-2015.  See\n"
"             http://ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml\n"
"           igrf11, the International Geomagnetic Reference Field (11th\n"
"             generation) which approximates the main magnetic field for\n"
"             the period 1900-2015.  See\n"
"             http://ngdc.noaa.gov/IAGA/vmod/igrf.html\n"
"           emm2010, the Enhanced Magnetic Model 2010, which approximates the\n"
"             main and crustal magnetic fields for the period 2010-2015.  See\n"
"             http://ngdc.noaa.gov/geomag/EMM/index.html\n"
"\n"
"       These models approximate the magnetic field due to the earth's core and\n"
"       (in the case of emm2010) its crust.  They neglect magnetic fields due\n"
"       to the ionosphere, the magnetosphere, nearby magnetized materials,\n"
"       electrical machinery, etc.\n"
"\n"
"       By default, the \"wmm2010\" magnetic model is used.  This may changed by\n"
"       setting the environment variable \"GEOGRAPHICLIB_MAGNETIC_NAME\" or with\n"
"       the -n option.\n"
"\n"
"       The magnetic models will be loaded from a directory specified at\n"
"       compile time.  This may changed by setting the environment variables\n"
"       \"GEOGRAPHICLIB_MAGNETIC_PATH\" or \"GEOGRAPHICLIB_DATA\", or with the -d\n"
"       option.  The -h option prints the default magnetic path and name.  Use\n"
"       the -v option to ascertain the full path name of the data file.\n"
"\n"
"       Instructions for downloading and installing magnetic models are\n"
"       available at\n"
"       <http://geographiclib.sf.net/html/magnetic.html#magneticinst>.\n"
"\n"
"ENVIRONMENT\n"
"       GEOGRAPHICLIB_MAGNETIC_NAME\n"
"           Override the compile-time default magnetic name of \"wmm2010\".  The\n"
"           -h option reports the value of GEOGRAPHICLIB_MAGNETIC_NAME, if\n"
"           defined, otherwise it reports the compile-time value.  If the -n\n"
"           name option is used, then name takes precedence.\n"
"\n"
"       GEOGRAPHICLIB_MAGNETIC_PATH\n"
"           Override the compile-time default magnetic path.  This is typically\n"
"           \"/usr/local/share/GeographicLib/magnetic\" on Unix-like systems and\n"
"           \"C:/ProgramData/GeographicLib/magnetic\" on Windows systems.  The -h\n"
"           option reports the value of GEOGRAPHICLIB_MAGNETIC_PATH, if\n"
"           defined, otherwise it reports the compile-time value.  If the -d\n"
"           dir option is used, then dir takes precedence.\n"
"\n"
"       GEOGRAPHICLIB_DATA\n"
"           Another way of overriding the compile-time default magnetic path.\n"
"           If it is set (and if GEOGRAPHICLIB_MAGNETIC_PATH is not set), then\n"
"           $GEOGRAPHICLIB_DATA/magnetic is used.\n"
"\n"
"ERRORS\n"
"       An illegal line of input will print an error message to standard output\n"
"       beginning with \"ERROR:\" and causes MagneticField to return an exit code\n"
"       of 1.  However, an error does not cause MagneticField to terminate;\n"
"       following lines will be converted.  If time or h are outside the\n"
"       recommended ranges for the model (but inside the ranges increase by\n"
"       tguard and hguard), a warning is printed on standard error and the\n"
"       field (which may be inaccurate) is returned in the normal way.\n"
"\n"
"EXAMPLES\n"
"       The magnetic field from WMM2010 in Timbuktu on 2012-01-01\n"
"\n"
"           echo 2012-01-01 16:46:33N 3:00:34W 300 | MagneticField -r\n"
"           => -2.55 12.43 33771.0 33737.6 -1500.5 7446.0 34582.1\n"
"              0.10 -0.07 34.3 36.8 54.4 -35.3 25.9\n"
"\n"
"       The first two numbers returned are the declination and inclination of\n"
"       the field.  The second line gives the annual change.\n"
"\n"
"SEE ALSO\n"
"       GeoConvert(1).\n"
"\n"
"AUTHOR\n"
"       MagneticField was written by Charles Karney.\n"
"\n"
"HISTORY\n"
"       MagneticField was added to GeographicLib,\n"
"       <http://geographiclib.sf.net>, in version 1.15.\n"
;
  return retval;
}