diff --git a/src/seismic_hazard_forecasting.py b/src/seismic_hazard_forecasting.py index 6fc5d73..100a651 100644 --- a/src/seismic_hazard_forecasting.py +++ b/src/seismic_hazard_forecasting.py @@ -378,8 +378,11 @@ verbose: {verbose}") # validate m_max against the grond motion model models_anthro_limited = ['Lasocki2013', 'Atkinson2015', 'ConvertitoEtAl2012Geysers'] # these models require that m_max<=4.5 - if m_max > 4.5 and model in models_anthro_limited: - msg = f"Selected ground motion model {model} is only valid up to a maximum magnitude of 4.5. Please try again with a lower maximum magnitude." + if m_max > 4.5 and model in models_anthro_limited: + if m_file is None: + msg = f"Selected ground motion model {model} is only valid up to a maximum magnitude of 4.5. Please try again with a lower maximum magnitude." + else: + msg = f"Selected ground motion model {model} is only valid up to a maximum magnitude of 4.5. The magnitude file provided has a range up to {m_max}." logger.error(msg) raise Exception(msg)