From 0eebfc619afbe66a1bb2afff98e6d5cde9aa4845 Mon Sep 17 00:00:00 2001 From: ftong Date: Wed, 4 Jun 2025 17:43:08 +0200 Subject: [PATCH] Update src/seismic_hazard_forecasting.py --- src/seismic_hazard_forecasting.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/seismic_hazard_forecasting.py b/src/seismic_hazard_forecasting.py index 91ea5cb..edc8e5a 100644 --- a/src/seismic_hazard_forecasting.py +++ b/src/seismic_hazard_forecasting.py @@ -48,7 +48,7 @@ def main(catalog_file, mc_file, pdf_file, m_file, m_select, mag_label, mc, m_max import logging from base_logger import getDefaultLogger from timeit import default_timer as timer - from math import ceil, floor + from math import ceil, floor, isnan import numpy as np import scipy import obspy @@ -501,8 +501,8 @@ verbose: {verbose}") iml_grid_hd[iml_grid_hd == 0.0] = np.nan # change zeroes back to nan # trim edges so the grid is not so blocky - vmin_hd = min(x for x in iml_grid_hd.flatten() if not math.isnan(x)) - vmax_hd = max(x for x in iml_grid_hd.flatten() if not math.isnan(x)) + vmin_hd = min(x for x in iml_grid_hd.flatten() if not isnan(x)) + vmax_hd = max(x for x in iml_grid_hd.flatten() if not isnan(x)) trim_thresh = vmin iml_grid_hd[iml_grid_hd < trim_thresh] = np.nan