From a67ca1980ccbd9f5133c3b30dd0537b2f592d079 Mon Sep 17 00:00:00 2001 From: ftong Date: Fri, 22 Aug 2025 14:24:58 +0200 Subject: [PATCH] Update src/seismic_hazard_forecasting.py --- src/seismic_hazard_forecasting.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/seismic_hazard_forecasting.py b/src/seismic_hazard_forecasting.py index 1aec1ca..94f5bed 100644 --- a/src/seismic_hazard_forecasting.py +++ b/src/seismic_hazard_forecasting.py @@ -162,19 +162,19 @@ def compute_IMT_exceedance(rx_lat, rx_lon, r, fr, p, lambdas, D, percentages_D, upper_bound_value = exceedance_root_function(IMT_max) - return None - logger.info(f"Receiver: {str(rx_label)}") - logger.info(f"Function value at {imt} = {str(IMT_min)} : {lower_bound_value}") - 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}") + + #logger.info(f"Receiver: {str(rx_label)}") + #logger.info(f"Function value at {imt} = {str(IMT_min)} : {lower_bound_value}") + #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}") 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) + #logger.error(msg) gm_est = np.nan return gm_est # raise ValueError(msg) @@ -185,18 +185,18 @@ def compute_IMT_exceedance(rx_lat, rx_lon, r, fr, p, lambdas, D, percentages_D, try: method='brenth' - logger.debug("Now trying Scipy " + method) + #logger.debug("Now trying Scipy " + method) output = root_scalar(exceedance_root_function, bracket=[IMT_min, IMT_max], rtol=rtol, method=method) gm_est = output.root except Exception as error: - logger.error(f"An exception occurred: {error}") - logger.info("Set ground motion value to nan") + #logger.error(f"An exception occurred: {error}") + #logger.info("Set ground motion value to nan") gm_est = np.nan end = timer() - logger.info(f"Ground motion estimation computation time: {round(end - start,1)} seconds") - logger.info(f"Estimated {imt}: {gm_est}") + #logger.info(f"Ground motion estimation computation time: {round(end - start,1)} seconds") + #logger.info(f"Estimated {imt}: {gm_est}") return gm_est