Description
There are a couple of issues related to the rupture_mesh_spacing
(rms
) defined in the job file when multifault source rupture sections have kite fault geometries. In general, they are related to resampling of the lines that makeup the kitesurface profiles. A small test job is attached here, and there may be some useful code developed in #9280 but it's difficult to test since the branch is old.
1. when the rupture_mesh_spacing
is larger than the length of the profile, there is sometimes a resampling issue that causes the final Line to have only one Point.
File "/Users/kjohnson/GEM/oq-engine/openquake/hazardlib/geo/surface/kite_fault.py", line 454, in from_profiles
rprof, ref_idx = _fix_profiles(profiles, profile_sd, align, idl)
File "/Users/kjohnson/GEM/oq-engine/openquake/hazardlib/geo/surface/kite_fault.py", line 930, in _fix_profiles
rprofiles.append(prf.resample(profile_sd))
File "/Users/kjohnson/GEM/oq-engine/openquake/hazardlib/geo/line.py", line 447, in resample
return Line.from_coo(_resample(self, sect_len, orig_extremes))
File "/Users/kjohnson/GEM/oq-engine/openquake/hazardlib/geo/line.py", line 126, in _resample
return np.array(utils.clean_points(rtra))
File "/Users/kjohnson/GEM/oq-engine/openquake/hazardlib/geo/utils.py", line 383, in clean_points
raise ValueError(msg)
ValueError: node section: At least two distinct points are needed for a line!, line 17030 of None
Example: one profile from NZL model (Note: in kite_fault fix_profiles orig_extremes defaults to False as in resample)

The length of this profile is less than the rms
of 10 km

If rms
is decreased to 5 km, the code no longer produces an error but extends the profile in order to add an extra point – do we consider this OK?

If instead we change to orig_extremes=True, using either rms = 5 km or 10 km, there is no error and _resample reproduces the two original endpoints

But if rms
< profile length:
• If orig_extremes = True, end point is included but the last length is shorter than the others (does not seem to cause tests to break but hasn’t been tested for the full suite of engine tests)
• If orig_extremes = False, the profile is extended

- Sometimes a small
rupture_mesh_spacing
causes an error where nans are inserted in the mesh and not handled well in later steps
File "/Users/kjohnson/GEM/oq-engine/openquake/hazardlib/geo/surface/kite_fault.py", line 457, in from_profiles
msh = _create_mesh(rprof, ref_idx, edge_sd, idl, align)
File "/Users/kjohnson/GEM/oq-engine/openquake/hazardlib/geo/surface/kite_fault.py", line 754, in _create_mesh
prfl = _get_resampled_profs(
File "/Users/kjohnson/GEM/oq-engine/openquake/hazardlib/geo/surface/kite_fault.py", line 1111, in _get_resampled_profs
_check_sampling(edg, proj)
File "/Users/kjohnson/GEM/oq-engine/openquake/hazardlib/geo/surface/kite_fault.py", line 1171, in _check_sampling
dsts = np.array([dsts[0]] + dsts.tolist())
IndexError: node section: index 0 is out of bounds for axis 0 with size 0, line 50726 of /Users/kjohnson/GEM/HazardMosaic/mosaic/NZL/in/ssm/…xml
Changing to kite_fault.py Line 930 to rprofiles.append(prf.resample(profile_sd, orig_extremes=True))
also solves this problem but it’s not completely clear to me why.