diff --git a/src/seismic_hazard_forecasting.py b/src/seismic_hazard_forecasting.py index a4d929a..f3eb9b4 100644 --- a/src/seismic_hazard_forecasting.py +++ b/src/seismic_hazard_forecasting.py @@ -146,7 +146,7 @@ def compute_IMT_exceedance(rx_lat, rx_lon, r, fr, p, lambdas, D, percentages_D, return exceedance_prob_sum - p - return None + # Check function values at different test points IMT_mid = (IMT_max-IMT_min)/2 @@ -159,6 +159,8 @@ def compute_IMT_exceedance(rx_lat, rx_lon, r, fr, p, lambdas, D, percentages_D, logger.info(f"Function value at {imt} = {str(IMT_mid)} : {mid_point_value}") logger.info(f"Function value at {imt} = {str(IMT_max)} : {upper_bound_value}") + return None + if np.sign(lower_bound_value) == np.sign(upper_bound_value): msg = "Function values at the interval endpoints must differ in sign for fsolve to work. Expand the interval or use a different model." logger.error(msg)