Skip to content

Add ry0_distance transform and fix multi-fault GC2 strike discordance - #156

Open
lispandfound wants to merge 3 commits into
mainfrom
ry0-transform
Open

lispandfound wants to merge 3 commits into
mainfrom
ry0-transform

Conversation

@lispandfound

@lispandfound lispandfound commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds sources.ry0_distance(faults, point), implementing Ry0 = max(0, −U, U − L) using the GC2 U coordinate. Accepts a single Fault/Plane or a sequence of them, and is vectorised over points (output shape point.shape[:-1]).
  • For multi-fault ruptures, raises a 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].
  • Factors the segment-length / U-origin computation out of gc2_distances.multi_trace_rx_ry into multi_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 from E = Σ 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:

  • adds gc2_distances.strike_corrected_traces, which decides discordance per trace and reverses the trace points;
  • uses the corrected traces in multi_fault_rx_ry_distance and ry0_distance;
  • takes the nominal strike as the sum of corrected end-minus-start vectors (Eq. 11) and places the U origin at the back end of it (p. 6).

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:

  • Ry0 matches 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 ruptures
  • No warning for a single fault; RuntimeWarning for multi-fault ruptures
  • Discordant traces are reversed as a whole (not per segment); T and U are invariant to a discordant trace's point order; U = 0 at the back end of a westward-striking system

tests/test_rx_ry.py and tests/test_sources.py pass locally (116 tests).

🤖 Generated with Claude Code

lispandfound and others added 3 commits October 19, 2026 13:32
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>
@lispandfound lispandfound changed the title Add ry0_distance transform Add ry0_distance transform and fix multi-fault GC2 strike discordance Oct 19, 2026
@lispandfound

Copy link
Copy Markdown
Contributor Author

Uploading darfield_ry0.png…

This branch has not been deployed

No deployments
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.

1 participant