pygmt
pygmt copied to clipboard
Suggested improvement for api/generated/pygmt.Figure.meca
Please describe what could be improved about this page or the typo/mistake that you found:
The spec parameter mentions the convention format columns must be ordered in for a file to be properly read. However, it is not clear what the correct order is when coordinates and depth columns are present. Additionally it is not clear that .csv files must be tab separated rather than comma separated for offsetting focal mechanisms to work.
I propose adding a complete example column order, such as for the "aki" convention. Something to the effect of:
"If using a filename for the spec parameter, [longitude, latitude, depth] columns must come before convention columns."
Additionally, I propose adding language to the offset parameter that notes column must be tab separated for offset to work. Something to the effect of:
"When using a filename for the spec parameter, columns must be tab separated."
Thanks for working to improve PyGMT based on your experiences with the library.
I agree that adding the full expectation for column order when a filename is given would be useful. It also seems that some parameters are ignored if spec is a filename, such as longitude and latitude, which should be documented.
For the documentation of offset parameter needing tab or space separation, I wonder whether this should be considered an upstream bug. I do not see why this shouldn't be expected to work. @seisman, do you have an opinion about whether this should be considered a code or documentation issue?
For the documentation of offset parameter needing tab or space separation, I wonder whether this should be considered an upstream bug. I do not see why this shouldn't be expected to work. @seisman, do you have an opinion about whether this should be considered a code or documentation issue?
It's an upstream bug, but I'm not sure how to fix it.
The
specparameter mentions the convention format columns must be ordered in for a file to be properly read. However, it is not clear what the correct order is when coordinates and depth columns are present.
We have rewritten the documentation of the Figure.meca method and hopefully, it now explains the meaning of columns well.
Additionally it is not clear that .csv files must be tab separated rather than comma separated for offsetting focal mechanisms to work.
It's an upstream bug. Here is the command to reproduce the issue:
Using a space/tab-separated file:
gmt meca -R-5/5/-5/5 -JX10c -Sa2c -Baf -A -png map << EOF
0 0 10 0 90 0 5.0 2 2 eventname
EOF

Using a comma-separated file:
gmt meca -R-5/5/-5/5 -JX10c -Sa2c -Baf -A -png map << EOF
0,0,10,0,90,0,5.0,2,2,eventname
EOF

@PaulWessel I'm wondering if there is an easy fix.
Ping @PaulWessel to see if the issue reported in https://github.com/GenericMappingTools/pygmt/issues/1365#issuecomment-1336192548 can be fixed.
Closed by upstream PR https://github.com/GenericMappingTools/gmt/pull/7599