Update src/seismic_hazard_forecasting.py
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user