GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Enhance meca and coupe w.r.t. adjusting positions and connecting with a line by PaulWessel · Pull Request #7778 · GenericMappingTools/gmt

Conversation

@PaulWessel

@PaulWessel PaulWessel commented Sep 2, 2023

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
PaulWessel added 2 commits September 2, 2023 13:31
@PaulWessel
Enhance meca and coupe w.r.t. adjusting positions and connecting with…
3f42931
… 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.
@PaulWessel
Add the +c and +o modifiers to the parser function
dbc78ad
@PaulWessel PaulWessel added the enhancement Improving an existing feature label Sep 2, 2023
@PaulWessel PaulWessel added this to the 6.5.0 milestone Sep 2, 2023
@PaulWessel PaulWessel assigned seisman and PaulWessel Sep 2, 2023
@PaulWessel PaulWessel mentioned this pull request Sep 2, 2023
using coupe to map focal mechanism, don't move beach ball location when providing a new coordinates. #7777
Closed
PaulWessel added 2 commits September 2, 2023 20:47
@PaulWessel
Draft 1.0
56af45b
Seems like coupe is working with new -D.  Have not tested meca yet but since it worked before I dont expect troubles.
@PaulWessel
Update psmeca.c
73b4bbb
@PaulWessel
PaulWessel requested a review from seisman September 2, 2023 19:00
@PaulWessel

PaulWessel commented Sep 2, 2023

Copy link
Copy Markdown
Contributor Author

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)
Do same tests with meca

Questions:

  1. Would be easy to add modifier -D +gfill if you want to paint that circle with another color than the beachball. Could also all +g- which would not fill the circle.
  2. I did not implement a +c to affect conversions. meca will always expect an alternative plot location in geographical coordinates, whereas coupe should aways expect offsets in plot units. So unless I am missing something I do not see a need for any +c.. When +o is given we read those two columns as plot units in both modules.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PaulWessel

PaulWessel commented Sep 2, 2023

Copy link
Copy Markdown
Contributor Author

Once things work we should make a test or two.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

PaulWessel added 2 commits September 3, 2023 10:30
@PaulWessel
Merge branch 'master' into refresh-seis-adjust
5b61268
@PaulWessel
Draft 1 RST
edfebf6
@PaulWessel

PaulWessel commented Sep 3, 2023

Copy link
Copy Markdown
Contributor Author

OK, I added documentation for coupe -D and updated meca -A docs as well.
Have a look. I decided it only made sense in coupe that the two alternative coordinates are in distance, depth since if they were lon lat then the conversion to distance,depth requires (lon, lat, depth) and we would presumably have to use epicenter depth to do that. If would be simple to do but would require a new +c modifier just for coupe. Then coupe could do (with -D):

Default assume the two cols are distance, depth in the crossection
+c No, they are lon, lat and with epicentre depth compute distance, depth for the alternate location in the crossection
+o offset the final alternate location by dx/dy:
With +c, only +odx/dy is allowed since already read two cols to compute alternative coordinates.
Without +c, if just +o then the two cols have variable dx dy in plot units.
Without +c, +odx/dy adjusts the alternate locations by this fixed offset.

Comments? Shall I add +c to coupe.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PaulWessel
Control symbol type [circle] and fill-no-fill
7bd8e8a
@PaulWessel

PaulWessel commented Sep 3, 2023

Copy link
Copy Markdown
Contributor Author

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].
Might be done?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PaulWessel

PaulWessel commented Sep 3, 2023

Copy link
Copy Markdown
Contributor Author

gmt coupe meca.dat -Sa1c -Aa111/33/119/33+d90+w500+z0/50+r -Q -JX15c/-8c -B -D+o+sa6p+gyellow -Gred -png map
map

Should we do something with the label justification if +o gives a negative dy? i.e., TC -> BC?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PaulWessel
Merge branch 'master' into refresh-seis-adjust
351aa61
@PaulWessel PaulWessel added the add-changelog Add PR to the changelog label Sep 3, 2023
PaulWessel added 2 commits September 4, 2023 09:38
@PaulWessel
Merge branch 'master' into refresh-seis-adjust
c12545b
@PaulWessel
Add +c to coupe after all
97da344
Also fix color of crosses in the docs
@PaulWessel

PaulWessel commented Sep 4, 2023

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

seisman
seisman reviewed Sep 4, 2023
View reviewed changes
Comment thread src/seis/meca.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread doc/rst/source/supplements/seis/psmeca.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread doc/rst/source/supplements/seis/pscoupe.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/seis/pscoupe.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/seis/pscoupe.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/seis/psmeca.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@seisman

seisman commented Sep 4, 2023

Copy link
Copy Markdown
Member

The codes look pretty good to me. I still need some time for more testings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

PaulWessel and others added 5 commits September 4, 2023 16:15
@PaulWessel @seisman
Update src/seis/meca.h
cfcc91c
Co-authored-by: Dongdong Tian <[email protected]>
@PaulWessel @seisman
Update doc/rst/source/supplements/seis/psmeca.rst
0d091e5
Co-authored-by: Dongdong Tian <[email protected]>
@PaulWessel @seisman
Update doc/rst/source/supplements/seis/pscoupe.rst
46a748f
Co-authored-by: Dongdong Tian <[email protected]>
@PaulWessel @seisman
Update src/seis/pscoupe.c
b915846
Co-authored-by: Dongdong Tian <[email protected]>
@PaulWessel @seisman
Update src/seis/pscoupe.c
856af7a
Co-authored-by: Dongdong Tian <[email protected]>
@PaulWessel @seisman
Update src/seis/psmeca.c
7c9b820
Co-authored-by: Dongdong Tian <[email protected]>
@PaulWessel

PaulWessel commented Sep 4, 2023

Copy link
Copy Markdown
Contributor Author

Thanks for spotting those glitches.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seisman

seisman commented Sep 5, 2023

Copy link
Copy Markdown
Member

Bug in parsing the trailing text:

gmt meca meca.dat -Sa1c -JM10c -B -R110/120/30/36 -A+o -png map << EOF
112 31.05  30  90   0  4  2.0 1.0 Strike-slip                                   
115 34 15  30  60  90  5  1.0 1.0 Reverse
118 32 45  30  60 -90  6  1.0 1.0 Normal
EOF
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PaulWessel

PaulWessel commented Sep 5, 2023

Copy link
Copy Markdown
Contributor Author

Will look, but you are giving both a file (meca.dat) and feed from stdin. Intentional?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PaulWessel

PaulWessel commented Sep 5, 2023

Copy link
Copy Markdown
Contributor Author

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seisman

seisman commented Sep 5, 2023

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PaulWessel

PaulWessel commented Sep 5, 2023

Copy link
Copy Markdown
Contributor Author

Oh, now I see it; the decimals tricked you. Looks OK?

map

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seisman

seisman commented Sep 5, 2023

Copy link
Copy Markdown
Member

Yes, it looks good. Will do more tests.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PaulWessel

PaulWessel commented Sep 5, 2023

Copy link
Copy Markdown
Contributor Author

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
The issue with label justifications and offsets dc day

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@seisman

seisman commented Sep 7, 2023

Copy link
Copy Markdown
Member

This PR looks pretty good to me.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

PaulWessel added 4 commits September 9, 2023 12:25
@PaulWessel
Merge branch 'master' into refresh-seis-adjust
13e19f3
@PaulWessel
Set default symbol if old -C setting
4926bda
@PaulWessel
Merge branch 'master' into refresh-seis-adjust
6a5f365
@PaulWessel
Fix seis_12.sh to avoid round-off in time.
03ec232
@PaulWessel PaulWessel changed the title WIP Enhance meca and coupe w.r.t. adjusting positions and connecting with a line Enhance meca and coupe w.r.t. adjusting positions and connecting with a line Sep 9, 2023
@PaulWessel
Merge branch 'master' into refresh-seis-adjust
42a9b6b
@PaulWessel PaulWessel added the documentation Improve documentation label Sep 9, 2023
@PaulWessel

PaulWessel commented Sep 9, 2023

Copy link
Copy Markdown
Contributor Author

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!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PaulWessel
PaulWessel requested a review from joa-quim September 9, 2023 11:38
PaulWessel added 2 commits September 9, 2023 14:02
@PaulWessel
Typo
617386e
@PaulWessel
Update gmt_init.c
af98479
seisman
seisman approved these changes Sep 9, 2023
View reviewed changes
@PaulWessel
PaulWessel merged commit f3bcba5 into master Sep 9, 2023
@PaulWessel
PaulWessel deleted the refresh-seis-adjust branch September 9, 2023 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@seisman seisman seisman approved these changes
@joa-quim joa-quim Awaiting requested review from joa-quim

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@seisman seisman

@PaulWessel PaulWessel

Labels

add-changelog Add PR to the changelog documentation Improve documentation enhancement Improving an existing feature

Projects

None yet

Milestone

6.5.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@PaulWessel @seisman
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.