Skip to content

Conversation

@Chuan1937
Copy link
Contributor

Fixes a numerical instability in meca_axe2dc when P.dip ≈ T.dip.

This issue caused the im flag (fault type) to flip unpredictably between 1 and -1, which in turn shifted the rake by 180 degrees. This resulted in swapped P/T quadrants for psmeca -Sy.

This patch introduces an SEIS_EPSILON tolerance. When |P.dip - T.dip| is within this tolerance, a deterministic im value (-1) is assigned, eliminating the instability.

Issues: #8009

@Chuan1937 Chuan1937 changed the title seis/utilmeca: stabilize NP selection near P/T dip tie with epsilon g… Fix seis/utilmeca Oct 31, 2025
Co-authored-by: Dongdong Tian <[email protected]>
Copy link
Member

@joa-quim joa-quim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and rely on your testings to considered this as a good fix.

@joa-quim joa-quim merged commit bf5ba5b into GenericMappingTools:master Nov 3, 2025
10 of 13 checks passed
@Chuan1937 Chuan1937 deleted the gmt-meca branch November 4, 2025 00:32
@seisman
Copy link
Member

seisman commented Nov 4, 2025

Changes here look reasonable but break existing tests:

	1197 - test/seis/full_moment_tensor.sh (Failed)
	1198 - test/seis/meca_-Smdz.sh (Failed)
	1208 - test/seis/seis_07.sh (Failed)

We need to revert the changes and find the cause.

@Chuan1937
Copy link
Contributor Author

Changes here look reasonable but break existing tests:

	1197 - test/seis/full_moment_tensor.sh (Failed)
	1198 - test/seis/meca_-Smdz.sh (Failed)
	1208 - test/seis/seis_07.sh (Failed)

We need to revert the changes and find the cause.

I'm trying

@Chuan1937 Chuan1937 mentioned this pull request Nov 4, 2025
seisman added a commit that referenced this pull request Nov 14, 2025
joa-quim pushed a commit that referenced this pull request Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants