Skip to content

Commit

Permalink
correction to indexing that takes the distance of the closest section…
Browse files Browse the repository at this point in the history
… of a fault to a site
  • Loading branch information
Kendra Johnson authored and Kendra Johnson committed Mar 7, 2025
1 parent 3f63bef commit f7d961d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openquake/hazardlib/source/multi_fault.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def _set_rupids_by_tag(src, allrids, dists, s2i):
for tag, idxs in src.faults.items():
fids = U32([s2i[idx] for idx in idxs])
rid = np.argmin(dists[fids])
closest.append((dists[rid], tag, fids))
closest.append((dists[fids][rid], tag, fids))

# build dictionary src.rupids_by_tag with the indices of
# ruptures belonging to each fault source; care is taken
Expand All @@ -301,6 +301,7 @@ def _set_rupids_by_tag(src, allrids, dists, s2i):
src.rupids_by_tag['off_rupids'] = off_rupids



# NB: as side effect delete _rupture_idxs,
# add .hdf5path and possibly .rupids_by_tag
def save_and_split(mfsources, sectiondict, hdf5path, site1=None,
Expand Down

0 comments on commit f7d961d

Please sign in to comment.