1FITCIRCLE(1)                          GMT                         FITCIRCLE(1)
2
3
4

NAME

6       fitcircle  -  find  mean position and pole of best-fit great [or small]
7       circle to points on a sphere.
8

SYNOPSIS

10       fitcircle [ table ]  -Lnorm [  -Fflags ] [  -S[lat] ] [  -V[level] ]  [
11       -bibinary ] [ -dinodata ] [ -eregexp ] [ -fflags ] [ -ggaps ] [ -hhead‐
12       ers ] [ -iflags ] [ -oflags ] [ -:[i|o] ]
13
14       Note: No space is allowed between the option flag  and  the  associated
15       arguments.
16

DESCRIPTION

18       fitcircle  reads lon,lat [or lat,lon] values from the first two columns
19       on  standard  input  [or  table].  These  are  converted  to  Cartesian
20       three-vectors  on  the  unit  sphere. Then two locations are found: the
21       mean of the input positions, and the pole to  the  great  circle  which
22       best  fits  the input positions. The user may choose one or both of two
23       possible solutions to this problem. The first is  called  -L1  and  the
24       second  is  called -L2. When the data are closely grouped along a great
25       circle both solutions are similar. If the data have  large  dispersion,
26       the  pole  to  the  great  circle will be less well determined than the
27       mean. Compare both solutions as a qualitative check.
28
29       The -L1 solution is so called because it approximates the  minimization
30       of  the  sum  of  absolute values of cosines of angular distances. This
31       solution finds the mean position as the Fisher average of the data, and
32       the  pole  position as the Fisher average of the cross-products between
33       the mean and the data. Averaging cross-products gives weight to  points
34       in proportion to their distance from the mean, analogous to the "lever‐
35       age" of distant points in linear regression in the plane.
36
37       The -L2 solution is so called because it approximates the  minimization
38       of  the  sum of squares of cosines of angular distances. It creates a 3
39       by 3 matrix of sums of squares of components of the data  vectors.  The
40       eigenvectors  of  this  matrix  give  the mean and pole locations. This
41       method may be more subject to roundoff errors when there are  thousands
42       of  data.  The  pole  is  given by the eigenvector corresponding to the
43       smallest eigenvalue; it is the least-well  represented  factor  in  the
44       data and is not easily estimated by either method.
45

REQUIRED ARGUMENTS

47       -Lnorm Specify the desired norm as 1 or 2, or use -L or -L3 to see both
48              solutions.
49

OPTIONAL ARGUMENTS

51       table  One or more ASCII [or binary, see -bi] files containing  lon,lat
52              [or  lat,lon;  see -:[i|o]] values in the first 2 columns. If no
53              file is specified, fitcircle will read from standard input.
54
55       -Ff|m|n|s|c
56              Normally, fitcircle will write its results in the form of a text
57              report, with the values intermingled with report sentences.  Use
58              -F to only return data coordinates, and append flags to  specify
59              which  coordinates  you  would like. You can choose from f (Flat
60              Earth mean location), m (mean location), n (north pole of  great
61              circle),  s  (south  pole of great circle), and c (pole of small
62              circle and its colatitude, which requires -S).
63
64       -S[lat]
65              Attempt to fit a small circle instead of  a  great  circle.  The
66              pole  will  be constrained to lie on the great circle connecting
67              the pole of the best-fit great circle and the mean  location  of
68              the  data.   Optionally append the desired fixed latitude of the
69              small circle [Default will determine the latitude].
70
71       -V[level] (more ...)
72              Select verbosity level [c].
73
74       -bi[ncols][t] (more ...)
75              Select native binary input. [Default is 2 input columns].
76
77       -dinodata (more ...)
78              Replace input columns that equal nodata with NaN.
79
80       -e[~]"pattern" | -e[~]/regexp/[i] (more ...)
81              Only accept data records that match the given pattern.
82
83       -f[i|o]colinfo (more ...)
84              Specify data types of input and/or output columns.
85
86       -g[a]x|y|d|X|Y|D|[col]z[+|-]gap[u] (more ...)
87              Determine data gaps and line breaks.
88
89       -h[i|o][n][+c][+d][+rremark][+rtitle] (more ...)
90              Skip or produce header record(s).
91
92       -icols[+l][+sscale][+ooffset][,...] (more ...)
93              Select input columns and transformations (0 is first column).
94
95       -ocols[,...] (more ...)
96              Select output columns (0 is first column).
97
98       -:[i|o] (more ...)
99              Swap 1st and 2nd column on input and/or output.
100
101       -^ or just -
102              Print a short message about the  syntax  of  the  command,  then
103              exits (NOTE: on Windows just use -).
104
105       -+ or just +
106              Print  an extensive usage (help) message, including the explana‐
107              tion of any module-specific  option  (but  not  the  GMT  common
108              options), then exits.
109
110       -? or no arguments
111              Print a complete usage (help) message, including the explanation
112              of all options, then exits.
113

ASCII FORMAT PRECISION

115       The ASCII output formats of numerical data are controlled by parameters
116       in  your  gmt.conf file. Longitude and latitude are formatted according
117       to  FORMAT_GEO_OUT,  absolute  time  is  under  the  control  of   FOR‐
118       MAT_DATE_OUT  and FORMAT_CLOCK_OUT, whereas general floating point val‐
119       ues are formatted according to FORMAT_FLOAT_OUT. Be aware that the for‐
120       mat  in effect can lead to loss of precision in ASCII output, which can
121       lead to various problems downstream. If you  find  the  output  is  not
122       written with enough precision, consider switching to binary output (-bo
123       if available) or specify more decimals using the FORMAT_FLOAT_OUT  set‐
124       ting.
125

EXAMPLES

127       Suppose  you  have  lon,lat,grav  data along a twisty ship track in the
128       file ship.xyg. You want to project this data onto a  great  circle  and
129       resample  it  in distance, in order to filter it or check its spectrum.
130       Do the following:
131
132              gmt fitcircle ship.xyg -L2
133              gmt project ship.xyg -Cox/oy -Tpx/py -S -Fpz | sample1d -S-100 -I1 > output.pg
134
135       Here, ox/oy is the lon/lat of the mean from fitcircle, and px/py is the
136       lon/lat of the pole. The file output.pg has distance, gravity data sam‐
137       pled every 1 km along the great circle which best fits ship.xyg
138
139       If you have lon, lat points in the file data.txt and wish to return the
140       northern hemisphere great circle pole location using the L2 norm, try
141
142              gmt fitcircle data.txt -L2 -Fn > pole.txt
143

SEE ALSO

145       gmt, gmtvector, project, mapproject, sample1d
146
148       2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
149
150
151
152
1535.4.5                            Feb 24, 2019                     FITCIRCLE(1)
Impressum