-
Notifications
You must be signed in to change notification settings - Fork 224
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
pygmt.Figure.meca offset not working #1129
Comments
👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our contributing guidelines and code of conduct. |
Thanks, @rdcorona. I think you find a bug in the import pygmt
fig = pygmt.Figure()
fig.coast(region=[-125, -122, 47, 49], projection="M6c", land="grey", water="lightblue", shorelines=True, frame="a")
focal_mechanism = dict(strike=330, dip=30, rake=90, magnitude=3)
fig.meca(focal_mechanism, scale="1c", longitude=-124.3, latitude=48.1, depth=12.0, plot_longitude=-124.3, plot_latitude=47.5, offset=True)
fig.show() |
I can reproduce the issue, and now know why it fails. Unfortunately, there is no workaround now. |
Hello seisman. Thanks for the reply |
Currently, offsetting beachballs only works for files. I'll see what I can do to fix it. |
Ok, meanwhile I'll try it with a dataFrame and an ASCII file Thanks again |
Still a problem on PyGMT v0.5.0 unfortunately. Could you elaborate more on why it fails? I tried debugging this while handling #1611, and couldn't see any obvious issue on the Python side, e.g. the Lines 330 to 337 in 9e8a7bd
Only thing I can think of is that this is a problem with the Line 454 in 9e8a7bd
|
Yes, ideally we should use
We can only call Lines 1159 to 1172 in 4b80f3c
|
I don't know what happened to GitHub. My reply to your comment #1129 (comment) is displayed before your comment at here: #1129 (comment) |
Yeah I see the same thing, must be time going backwards 😆
Ok, I think I got a clear idea on what to do now. We'll need to convert the Probably do 2 separate PRs:
|
Yes! |
The input parameters of the
As you can see, plot_longitude & plot_latitude and event_name are optional. Thus users can give input parameters in many different ways:
Due to these complications, the first few columns (7 columns for the -Sa case) are read as numeric values ( See https://github.com/GenericMappingTools/gmt/blob/3e68b8de02774f2eda0068ea356586d61770f070/src/seis/psmeca.c#L775 and https://github.com/GenericMappingTools/gmt/blob/3e68b8de02774f2eda0068ea356586d61770f070/src/seis/psmeca.c#L824 if you want to read the GMT source code. Due to the above reasons, we have to pass the trailing columns (plot longitude&latitude and event_name) using Thus, what we need to do is:
|
Ah I see, maybe we could use Lines 1427 to 1431 in 4b80f3c
though it sounds like we'll need to be careful and ensure that it doesn't get into this case: Lines 1454 to 1458 in 4b80f3c
so some very careful refactoring and unit test writing to do!
Just to be clear, do you mean that |
On third thought, maybe 3 separate PRs (because
|
Apparently the beachball offset bug wasn't properly fixed in #1784 for PyGMT v0.7.0, but there's a workaround at #2016 (comment) (use |
I am using pygmt to graph focal mechanisms with magnitude scale.
However, when I try to give it an offset so that they don't pile up the function doesn't seem to work.
I'm using :
where all the objects are lists with real (float) values
System information
Do I make something wrong?
The text was updated successfully, but these errors were encountered: