raise exception for null magnitude values

This commit is contained in:
ftong 2025-07-07 14:43:42 +02:00
parent 1ea6c85ab2
commit 60ae1c96cd

View File

@ -138,6 +138,12 @@ verbose: {verbose}")
time, mag, lat, lon, depth = read_mat_cat(catalog_file, mag_label=mag_label, catalog_label='Catalog')
# check for null magnitude values
m_null_idx = np.where(np.isnan(mag))[0]
if len(m_null_idx) > 0:
msg = f"There are null values in the magnitude column of the catalog at indices {m_null_idx}"
logger.error(msg)
raise Exception(msg)
if mc != None:
logger.info("Mc value provided by user")
trim_to_mc = True