-
Notifications
You must be signed in to change notification settings - Fork 223
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
Wrap coupe #2019
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 @konalindsey for trying out PyGMT 😃 ! Maybe the method pygmt.Figure.meca is helpful for you? There is also a gallery example for this method: https://www.pygmt.org/latest/gallery/seismology/meca.html#sphx-glr-gallery-seismology-meca-py Please note: This method was fully rewritten after release v0.7.0 (see #2016 (comment)). Despite this, there are still some known issues and limitations with this method (e.g. #2016). Edit |
Hi @yvonnefroehlich. Yes, meca works great! But I need to make cross sections of the focal mechanisms which would correspond to pscoupe in GMT. |
I have no experience with
I think it could be helpful if you post your code or a minimal example showing your issues when using |
Ping at @seisman, @weiji14, @maxrjones, @willschlitzer, and @michaelgrund for help on this, please. |
I don't think I have time to wrap the The example data is available at https://raw.githubusercontent.com/GenericMappingTools/gmt-for-geodesy/main/5_seismology/meca.dat
|
Thanks @seisman for your answer and especially for the code example! 😃 |
@GenericMappingTools/pygmt-maintainers Is there a remote file that would be applicable as a table for this? The example in the GMT docs does not point to an input file. |
I'm not sure how easy it would be to create a simpler example from this, but |
Thanks! I'm mostly looking for a remote file so I can write a test; I'll give that a go at some point! |
Another request from the forum at https://forum.generic-mapping-tools.org/t/how-to-plot-focal-mechanisme-cross-section-in-pygmt/3209. Looks like We've got some draft instructions on how to wrap a new module at #1687, specifically at https://github.com/GenericMappingTools/pygmt/blob/wrap-module-instructions/doc/contributing.md#initial-feature-implementation. Let us know if anyone is interested in helping out with this and the team will be happy to provide guidance. |
I'm planning on trying to wrap it in September/October (my computer is still enroute from the U.K.); happy to help if anyone wants to give it a go! |
I was unsuccessful in getting |
The format of mts_array is The 2 coordinates in the -Aa argument are the start and end long-lat locations of the profile, w is the width of profile in kilometers and d90 makes sure the moment tensors are viewed vertically from the side |
Found this blog post (in Japanese) from @yasuit21 who implemented some code to wrap |
Thank you for the guidance. I have checked on the website and tried to implement it (the coupe.py). However, I encountered a problem related to: decorators.py I tried to trace the script. As I checked on this website (https://github.com/GenericMappingTools/pygmt/blob/wrap-module-instructions/doc/contributing.md#add-missing-aliases), I tried to guess that the issue is possibly related to missing aliases in my case (?) (please correct me if I'm wrong). However, I am still puzzled about how to solve the problem. May I ask for help regarding this problem? Below is the screenshot of the error. Your guidance will be very valuable to me. Thank you. |
It seems the error comes from |
for the meca_edit.py script, I copied it entirely from the script in https://github.com/GenericMappingTools/pygmt/blob/v0.10.0/pygmt/src/meca.py I renamed it to meca_edit.py because there is already a meca.py script in the Pygmt installation on my machine, and I noticed there is a slight difference with the meca script posted in Git Hub. Below is the attachment of the script (meca_edit.py as well as with the other script that I use) in a zip file. Thank you |
The script works well for me after some necessary minor changes, and I can't reproduce your issue. |
After I checked on the PyGMT version requirement (python=3.10.12 pygmt=0.10.0 numpy=1.25.2 pandas=2.0.3) on the website from @yasuit21, I was able to produce the figure in the example script. My previous PyGMT version was 0.5.0. Kindly apologize for the missed version. |
Description of the desired feature
I am mapping cross sections of subduction zones, and need to plot focal mechanisms.
I tried using Session.call_module, but ran into various errors... I probably am not using it correctly, but a real pyGMT function of pscoupe would be preferable.
Are you willing to help implement and maintain this feature? Yes/No
The text was updated successfully, but these errors were encountered: