Open kirstybayliss opened 6 months ago
The classification step is giving the dreaded 'Surface does not conform with Aki & Richards' error, even though the 3D plot and cross-sections look fine. We already test that we follow Aki and Richard's convention when making the profiles.
I have made a small PR (https://github.com/gem/oq-engine/pull/9596) to change the Aki and Richard's test in the complex fault part of the hazardlib (it will check that the convention is met at one end of the fault, because it seems unlikely that we would somehow have profiles that switch sides part way through!).
I would also like to have a simple test that runs all the way to the classification step for completeness - this would make sure that we don't break any steps in the workflow for subduction when we make other changes. I can make this from some of the GEESE TR stuff.
However, I am confident that this specific code is actually behaving as we'd like at the moment
This PR adds the option to create profiles for subduction using a geojson file containing manually chosen cross-sections, the dip direction and length. The get_profiles_geojson function fits into the subduction workflow in place of the get_profiles function inside the call to get_profiles_from_slab2pt0, or get_profiles_from_slab2pt0_geojson can be called directly in the workflow as a replacement in the subduction profile, specifying the geojson file in the toml.
Also fixes a minor weirdness with the interpolator, where it would previously fail occasionally for cross-sections that trended along a single x or y coordinate. Instead we call the tesselation step directly and allow it to add a small jitter to account for this if the original tesselation fails (otherwise there will be no change). If this is still failing for a provided geometry, no cross-sections will be generated.
Tests imply that the difference in depths when using the 'jitter' are less than 0.03km.![image](https://github.com/GEMScienceTools/oq-mbtk/assets/37081055/7e938373-3044-41a2-91bb-bab8f16e0bde)
Updated so that the old version is used unless we have an issue like this, in which case we assume that a small difference in depth is acceptable.