Repository navigation
Add ry0_distance transform and fix multi-fault GC2 strike discordance - #156
Open
lispandfound wants to merge 3 commits into
Open
lispandfound wants to merge 3 commits into
lispandfound wants to merge 3 commits into
Conversation
Implements Ry0 = max(0, -U, U - L) as a standalone function. For multi-fault ruptures the rupture extent is taken as the span of the fault traces along the GC2 U axis, and a RuntimeWarning is raised since the transform is not well-defined there. Factors the segment length / U-origin calculation out of multi_trace_rx_ry into multi_trace_u_origins so the rupture extent can be computed without evaluating GC2 on the trace itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… use Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Spudich & Chiou (2015, p. 5-6) reverse the point order of each trace whose end-minus-start vector disagrees with the system's general strike before calculating T and U. Previously only segment direction vectors were flipped (and only to compute the nominal strike), so discordant traces contributed rx/ry with the wrong orientation and U was not monotonic along strike (e.g. the Darfield rupture, where Greendale NW-SE and the fault near Hororata are discordant). - Add gc2_distances.strike_corrected_traces, deciding discordance per trace and reversing the trace points. - Use corrected traces in multi_fault_rx_ry_distance and ry0_distance. - Take the nominal strike as the sum of corrected trace vectors (Eq. 11) and place the U origin at the back end of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
sources.ry0_distance(faults, point), implementing Ry0 = max(0, −U, U − L) using the GC2 U coordinate. Accepts a singleFault/Planeor a sequence of them, and is vectorised over points (output shapepoint.shape[:-1]).RuntimeWarning(the transform isn't really well-defined there) and takes the rupture extent as the span of the traces along the GC2 U axis, i.e.[min segment origin, max(segment origin + segment length)]. For a single fault this reduces exactly to[0, L].gc2_distances.multi_trace_rx_ryintomulti_trace_u_origins.Multi-fault GC2 fix
Plotting Ry0 for Darfield showed U was not monotonic along strike: west of the rupture, U increased, so Ry0 stayed 0 for 30+ km past the trace ends. Spudich & Chiou (2015, pp. 5–6) reverse the point order of each discordant trace (
e_j = (p_{n+1,j} − p_{1,j})·âwith a different sign fromE = Σ e_j) before computing T and U. We only flipped per-segment direction vectors when computing the nominal strike, so discordant traces (Greendale NW-SE and the fault near Hororata, for Darfield) contributed rx/ry with the wrong orientation. This PR:gc2_distances.strike_corrected_traces, which decides discordance per trace and reverses the trace points;multi_fault_rx_ry_distanceandry0_distance;Along an E–W profile through Darfield (northing 5174 km, eastings 1480–1580 km), U went from
10.5 13.8 16.6 15.6 22.2 17.9 27.6 …to a monotonic-19.8 -12.2 -4.8 1.6 9.8 18.0 27.7 37.2 45.2 52.7 60.4.Darfield Ry0
Ry0 around the 7-fault Darfield (Beavan) rupture, shared by all 29 realisations in
darfield_rupture_gen_validation:Tests
New tests in
tests/test_rx_ry.py:max(0, -U, U - L)for a plane and a multi-plane fault; vectorised results match a per-point loop for single- and multi-fault rupturesRuntimeWarningfor multi-fault rupturestests/test_rx_ry.pyandtests/test_sources.pypass locally (116 tests).🤖 Generated with Claude Code