Skip to content
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

Problem with GCMT convention in meca.py #1580

Closed
weiji14 opened this issue Oct 13, 2021 · 0 comments · Fixed by #1611
Closed

Problem with GCMT convention in meca.py #1580

weiji14 opened this issue Oct 13, 2021 · 0 comments · Fixed by #1611
Labels
bug Something isn't working
Milestone

Comments

@weiji14
Copy link
Member

weiji14 commented Oct 13, 2021

Description of the problem

Originally reported by @philcummins at https://forum.generic-mapping-tools.org/t/pygmt-parameter-check-in-meca-py/1874. Copying here to keep track.

In the parameters section of the documentation block in meca.py, it says that the GCMT convention is determined if a dictionary with the following keys is passed:

  • "gcmt" — strike1, dip1, rake1, strike2, dip2, rake2, mantissa,exponent
    But later in the code, when the parameters to check against are set (line 250-252), it says:
    param_conventions = {
    “AKI”: [“strike”, “dip”, “rake”, “magnitude”],
    “GCMT”: [“strike1”, “dip1”, “dip2”, “rake2”, “mantissa”,“exponent”],

So it seems if you pass all the parameters it says it requires, it fails with:
GMTError: Parameters in spec dictionary do not match known conventions.

BTW, it says a geopandas dataframe an be used to pass in location info. Are there any planes to pass in the focal mechanism parameters in the geopandas dataframe as well?

Solution would be to modify this line I think:

"GCMT": ["strike1", "dip1", "dip2", "rake2", "mantissa", "exponent"],

I.e., need to add "rake1", "strike2" in the middle of the list.

Full code that generated the error

PASTE CODE HERE

Full error message

PASTE ERROR MESSAGE HERE

System information

Please paste the output of python -c "import pygmt; pygmt.show_versions()":

PASTE THE OUTPUT HERE
@weiji14 weiji14 added the bug Something isn't working label Oct 13, 2021
@weiji14 weiji14 added this to the 0.6.0 milestone Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant