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
Enhance meca and coupe w.r.t. adjusting positions and connecting with a line #7778
Conversation
… line This PR started with the discussions on #7777. To prepare this, I found that there were much duplicated #define statements in psmeca and pscoupe.c so I pulled those into meca.h. Then, given we want a "-A"-like option in coupe I placed the -A parser from psmeca.c into utilmeca.c as well as the usage message now that it will have more modifiers. Then there is a common structure defined in meca that is included in Ctrl as member A or D. This reduces the amount of code needed to implement the desired features. THis initial commit jus does that - no actual "-D" option will be acted on yet.
Hi @seisman, draft version 1 is pushed. I tested coupe with -D+o (reads the alternative coordinates as offsets instead) and -Dodx/dy (same offset from projected location for all points). Things not tested (but hope they work as is): Use CPT in coupe and with -D (should be completely decoupled) Questions:
|
Once things work we should make a test or two. |
OK, I added documentation for coupe -D and updated meca -A docs as well. Default assume the two cols are distance, depth in the crossection Comments? Shall I add +c to coupe. |
Note I got bored and added +g[fill] for how to fill the circle [Default is same as beachball as before] but also modified +s to be +s[symbol]size where symbol can be any of the standard geometric plot symbols [c]. |
Also fix color of crosses in the docs
Hi @seisman, I ended up adding +c to coupe -D since people plotting with meca may have alternative geographic coordinates which they use with meca -A but coupe would normally expect _distance, dept_h coordinates instead. The -D+c projects the alternative geographic coordinates into the crossectional plane. After than, **+**odx/dy can be used to shift any further since hard to know where things project. With no +c then we expect distance, depth in those columns. In that case, **+**odx/dy can be used to apply a constant shift to all alternative events. If just +o is given then we initialise the alternate plot locations as the same as the original plot location, then add variable dx dy read from those two special columns. See what you think. I have updated docs. |
The codes look pretty good to me. I still need some time for more testings. |
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Thanks for spotting those glitches. |
Bug in parsing the trailing text:
|
Will look, but you are giving both a file (meca.dat) and feed from stdin. Intentional? |
Good test, It tries to convert to a number. But help me with this: In record looks like this: 112 31.05 30 90 0 4 2.0 1.0 Strike-slip and -Sa sets the number of input columns to 7 But you are giving only 6 and then the two extra. So se set GMT_Set_Columns to 7 and then the trailing text is "1.0 Strike-slip". Is the n_cols settings when parsing 'S' expecting 6 ir 7? |
Sorry, my mistake. It's weird that I lost the depth column when copying and paste the data. |
Yes, it looks good. Will do more tests. |
Some issues using +s and x (cross) requires -W to change pen and +c to set pen color to event depth color. Maybe computer cross pen width from size is more practical. At least as default |
This PR looks pretty good to me. |
Hi @seisman, I am done with this branch. All 13 seis scripts passes and unless you see anything funny I hope you can approve it and we can merge. Then onto stroke-symbol revitalization! |
This PR started with the discussions on #7777. To prepare this, I found that there were much duplicated
#define
statements in psmeca.c and pscoupe.c so I pulled those into meca.h. Then, given we want a "-A"-like option in coupe I placed the -A parser from psmeca.c into utilmeca.c as well as the usage message now that it will have more modifiers. Then there is a common structure defined in meca that is included in Ctrl as member A or D. This reduces the amount of code needed to implement the desired features. This initial commit just does that - no actual "-D" option will be acted on yet. However, the parser has been extended to process +c and +o but they are basically ignored.