Add get_x_l_ratio() method to BaseSurface for PFDHA applications#11201
Merged
micheles merged 6 commits intogem:masterfrom Feb 13, 2026
Merged
Add get_x_l_ratio() method to BaseSurface for PFDHA applications#11201micheles merged 6 commits intogem:masterfrom
micheles merged 6 commits intogem:masterfrom
Conversation
micheles
reviewed
Feb 9, 2026
| trace[1:, 0], trace[1:, 1] | ||
| ) | ||
| L_km = float(numpy.sum(seg_lengths_km)) | ||
| if L_km <= 0.0: |
Contributor
Author
There was a problem hiding this comment.
I removed this and only keep the if L_proj == 0.0 check ( at #284). It was if L_proj <= 0.0 before, but it actually won't be negative, so I modified it now to "== 0.0"
mmpagani
approved these changes
Feb 12, 2026
| dep = numpy.min(top_edge.depths) | ||
| return dep | ||
|
|
||
| def _get_surface_trace(self): |
Member
There was a problem hiding this comment.
I would call this _get_tor(self)
micheles
approved these changes
Feb 13, 2026
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.
This PR adds support for computing normalized along-strike position (x/L) for Probabilistic Fault Displacement Hazard Assessment (PFDHA) applications.
It includes:
_get_surface_trace():Private helper method that extracts the surface trace (top edge) as a 2D array of geographic coordinates with NaN
handling for KiteSurface compatibility.
get_x_l_ratio(mesh): It computes the normalized along-strike position (x/L) for each point in the mesh relative to the surface tracebase_surface_test.pyNotes:
for each site using vectorized distance calculations
(x_over_L, L_km)wherex_over_Lis a numpy array withvalues in [0, 1] and
L_kmis the total trace length in kilometers