-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Wrap fitcircle #1550
base: main
Are you sure you want to change the base?
WIP: Wrap fitcircle #1550
Conversation
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
if outfile == tmpfile.name: # if user did not set outfile, return pd.DataFrame | ||
result = pd.read_csv( | ||
tmpfile.name, | ||
sep="\t", | ||
names=["longitude", "latitude", "method"], | ||
comment=">", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ gmt fitcircle @sat_03.txt -L2
330.249933144 -18.4048179232 Points read: 703 Average Position (Flat Earth)
330.169184777 -18.4206532702 L2 Average Position (Eigenval Method)
52.7451972868 21.2040074195 L2 N Hemisphere Great Circle Pole (Eigenval Method)
232.745197287 -21.2040074195 L2 S Hemisphere Great Circle Pole (Eigenval Method)
$ gmt fitcircle @sat_03.txt -L2 -Fms
330.169184777 -18.4206532702 232.745197287 -21.2040074195
As you can see, the output of fitcircle
is quite different with or without -F
option, so the read_csv
call doesn't work with -F
.
I'm wondering should we return a dict instead, e.g.,:
>>> solution = fitcircle(data="@sat_03.txt", norm=2)
>>> print(solution)
{'average': {'latitude': -18.4048179232, 'longitude': 330.249933144},
'L2_average': {'latitude': -18.4206532702, 'longitude': 330.169184777},
'L2_north': {'latitude': 21.2040074195, 'longitude': 52.7451972868},
'L2_south': {'latitude': -21.2040074195, 'longitude': 232.745197287}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can work on this, but I'm about to move so I may not be too speedy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No hurry. Better to have more discussions about the output before working on it.
I don't think I'm able to come up with a good way to format the output; I'm going to close this PR for the time being. If anyone has a solution please feel free to reopen it! |
I'm reopening the issue so it's more visible to people who'd like to help. |
This pull request wraps the module
fitcircle
.Reminders
make format
andmake check
to 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