improve error message when user provides magnitude file incompatible with ground motion model
This commit is contained in:
parent
dd84829b6d
commit
2906af6918
@ -378,8 +378,11 @@ verbose: {verbose}")
|
|||||||
|
|
||||||
# validate m_max against the grond motion model
|
# validate m_max against the grond motion model
|
||||||
models_anthro_limited = ['Lasocki2013', 'Atkinson2015', 'ConvertitoEtAl2012Geysers'] # these models require that m_max<=4.5
|
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:
|
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_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)
|
logger.error(msg)
|
||||||
raise Exception(msg)
|
raise Exception(msg)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user