Skip to content

Commit

Permalink
Merge pull request #10428 from gem/fix_dist_idx_mfs
Browse files Browse the repository at this point in the history
[WIP] correction to indexing to get fault-to-site distance for multifault disagg by source
  • Loading branch information
micheles authored Mar 8, 2025
2 parents afb3958 + f7d961d commit 86559ab
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 86559ab

Please sign in to comment.