Update src/seismic_hazard_forecasting.py

This commit is contained in:
2026-06-23 00:04:34 +02:00
parent d5e5435d83
commit 105a36893a
+17 -17
View File
@@ -341,7 +341,7 @@ def main(catalog_file, mc_file, pdf_file, m_file, m_select, mag_label, mc, m_max
else: else:
logger.setLevel(logging.INFO) 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 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]) # 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 = [[] for _ in range(len(products))] # final ground motion grids
iml_grid_prep = iml_grid.copy() # temp 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)): for j in range(0, len(products)):
# Reassemble the grid cleanly using the original shape # Reassemble the grid cleanly using the original shape
@@ -819,21 +819,21 @@ verbose: {verbose}")
iml_grid_prep[j] = iml_grid_flat.reshape(grid_shape) iml_grid_prep[j] = iml_grid_flat.reshape(grid_shape)
for i in indices: #for i in indices:
if i in indices_filtered: # if i in indices_filtered:
for j in range(0, len(products)): # for j in range(0, len(products)):
iml_grid_prep[j].append(iml_grid_raw[j].pop(0)) # iml_grid_prep[j].append(iml_grid_raw[j].pop(0))
else: # else:
list(map(lambda lst: lst.append(np.nan), # list(map(lambda lst: lst.append(np.nan),
iml_grid_prep)) # use np.nan to indicate grid point excluded # iml_grid_prep)) # use np.nan to indicate grid point excluded
elif exclude_low_fxy: #elif exclude_low_fxy:
for i in range(0, len(distances)): # for i in range(0, len(distances)):
if i in indices: # if i in indices:
for j in range(0, len(products)): # for j in range(0, len(products)):
iml_grid_prep[j].append(iml_grid_raw[j].pop(0)) # iml_grid_prep[j].append(iml_grid_raw[j].pop(0))
else: # else:
list(map(lambda lst: lst.append(np.nan), # list(map(lambda lst: lst.append(np.nan),
iml_grid_prep)) # use np.nan to indicate grid point excluded # iml_grid_prep)) # use np.nan to indicate grid point excluded
else: else:
iml_grid_prep = iml_grid_raw iml_grid_prep = iml_grid_raw