From 105a36893aa7d296f0081e92360b71c2f673e7a3 Mon Sep 17 00:00:00 2001 From: ftong <95+ftong@noreply.example.org> Date: Tue, 23 Jun 2026 00:04:34 +0200 Subject: [PATCH] Update src/seismic_hazard_forecasting.py --- src/seismic_hazard_forecasting.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/seismic_hazard_forecasting.py b/src/seismic_hazard_forecasting.py index cef5655..12ee04d 100644 --- a/src/seismic_hazard_forecasting.py +++ b/src/seismic_hazard_forecasting.py @@ -341,7 +341,7 @@ def main(catalog_file, mc_file, pdf_file, m_file, m_select, mag_label, mc, m_max else: logger.setLevel(logging.INFO) - exclude_low_fxy = False # skip low probability areas of the map + exclude_low_fxy = True # skip low probability areas of the map thresh_fxy = 1e-3 # minimum fxy value (location PDF) needed to do PGA estimation (to skip low probability areas); also should scale according to number of grid points # AOI_lat = np.array(AOI_extent[:2]) @@ -805,7 +805,7 @@ verbose: {verbose}") iml_grid = [[] for _ in range(len(products))] # final ground motion grids iml_grid_prep = iml_grid.copy() # temp ground motion grids - if use_AOI: + if use_AOI or exclude_low_fxy: for j in range(0, len(products)): # Reassemble the grid cleanly using the original shape @@ -819,21 +819,21 @@ verbose: {verbose}") iml_grid_prep[j] = iml_grid_flat.reshape(grid_shape) - for i in indices: - if i in indices_filtered: - for j in range(0, len(products)): - iml_grid_prep[j].append(iml_grid_raw[j].pop(0)) - else: - list(map(lambda lst: lst.append(np.nan), - iml_grid_prep)) # use np.nan to indicate grid point excluded - elif exclude_low_fxy: - for i in range(0, len(distances)): - if i in indices: - for j in range(0, len(products)): - iml_grid_prep[j].append(iml_grid_raw[j].pop(0)) - else: - list(map(lambda lst: lst.append(np.nan), - iml_grid_prep)) # use np.nan to indicate grid point excluded + #for i in indices: + # if i in indices_filtered: + # for j in range(0, len(products)): + # iml_grid_prep[j].append(iml_grid_raw[j].pop(0)) + # else: + # list(map(lambda lst: lst.append(np.nan), + # iml_grid_prep)) # use np.nan to indicate grid point excluded + #elif exclude_low_fxy: + # for i in range(0, len(distances)): + # if i in indices: + # for j in range(0, len(products)): + # iml_grid_prep[j].append(iml_grid_raw[j].pop(0)) + # else: + # list(map(lambda lst: lst.append(np.nan), + # iml_grid_prep)) # use np.nan to indicate grid point excluded else: iml_grid_prep = iml_grid_raw