pygmt.fitcircle

pygmt.fitcircle(data, output_type='pandas', outfile=None, *, normalize=None, small_circle=None, verbose=None, **kwargs)[source]

Fit coordinators to create vectors on a sphere.

fitcircle reads lon,lat [or lat,lon] values from the first two columns on standard input [or table]. These are converted to Cartesian three-vectors on the unit sphere. Then two locations are found: the mean of the input positions, and the pole to the great circle which best fits the input positions. The user may choose one or both of two possible solutions to this problem. When the data are closely grouped along a great circle both solutions are similar. If the data have large dispersion, the pole to the great circle will be less well determined than the mean. Compare both solutions as a qualitative check.

Setting normalize to 1 approximates the minimization of the sum of absolute values of cosines of angular distances. This solution finds the mean position as the Fisher average of the data, and the pole position as the Fisher average of the cross-products between the mean and the data. Averaging cross-products gives weight to points in proportion to their distance from the mean, analogous to the “leverage” of distant points in linear regression in the plane.

Setting normalize to 2 approximates the minimization of the sum of squares of cosines of angular distances. It creates a 3 by 3 matrix of sums of squares of components of the data vectors. The eigenvectors of this matrix give the mean and pole locations. This method may be more subject to roundoff errors when there are thousands of data. The pole is given by the eigenvector corresponding to the smallest eigenvalue; it is the least-well represented factor in the data and is not easily estimated by either method.

Full option list at https://docs.generic-mapping-tools.org/latest/fitcircle.html

Aliases:

  • L = normalize

  • S = small_circle

  • V = verbose

Parameters ———-. output_type : str

Determine the format the xyz data will be returned in [Default is pandas]:

outfilestr

The file name for the output ASCII file.

Returns

ret (pandas.DataFrame or numpy.ndarray or None) – Return type depends on outfile and output_type: