diff --git a/src/seismic_hazard_forecasting.py b/src/seismic_hazard_forecasting.py index 3417616..15826b3 100644 --- a/src/seismic_hazard_forecasting.py +++ b/src/seismic_hazard_forecasting.py @@ -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