Wrap fitcircle - #1550
Open
willschlitzer wants to merge 67 commits into
Open
Conversation
seisman
reviewed
Aug 14, 2026
seisman
reviewed
Aug 14, 2026
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
seisman
reviewed
Aug 15, 2026
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
seisman
reviewed
Aug 21, 2026
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
seisman
reviewed
Sep 7, 2026
Comment on lines
+26
to
+54
| Find mean position and great or small circle fit to points on sphere. | ||
|
|
||
| This method takes (longitude, latitude) values and converts them 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. | ||
|
|
||
| Setting ``norm`` to ``1`` (L1 norm) 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 ``norm`` to ``2`` (L2 norm) 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. | ||
|
|
||
| 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 by calling :func:`pygmt.fitcircle` | ||
| twice, once for each ``norm``. |
Member
There was a problem hiding this comment.
Please rewrap these lines to ~88 characters per line.
seisman
reviewed
Sep 8, 2026
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request wraps the module
fitcircle.Preview at https://pygmt-dev--1550.org.readthedocs.build/en/1550/api/generated/pygmt.fitcircle.html
Reminders
make formatandmake checkto make sure the code follows the style guide.doc/api/index.rst.Slash Commands
You can write slash commands (
/command) in the first line of a comment to performspecific operations. Supported slash commands are:
/format: automatically format and lint the code/test-gmt-dev: run full tests on the latest GMT development version