custom AOI feature, changes to plotting and activity rate calculation #24

Merged
ymlesni merged 50 commits from July2026 into master 2026-07-22 12:43:46 +02:00
Showing only changes of commit 92b6eb4880 - Show all commits
+4 -4
View File
@@ -768,7 +768,7 @@ verbose: {verbose}")
imls = [dask.delayed(compute_IMT_exceedance)(rx_lat[i], rx_lon[i], distances[i].flatten(), fr, p, lambdas, imls = [dask.delayed(compute_IMT_exceedance)(rx_lat[i], rx_lon[i], distances[i].flatten(), fr, p, lambdas,
forecast_len, lambdas_perc, m_range, m_pdf, m_cdf, model, forecast_len, lambdas_perc, m_range, m_pdf, m_cdf, model,
log_level=logging.DEBUG, imt=imt, IMT_min=0.0, IMT_max=IMT_max, rx_label=i, log_level=logging.DEBUG, imt=imt, IMT_min=0.0, IMT_max=IMT_max, rx_label=i,
rtol=0.01, use_cython=True) for i in iter] rtol=0.1, use_cython=True) for i in iter]
iml = dask.compute(*imls) iml = dask.compute(*imls)
iml_grid_raw.append(list(iml)) iml_grid_raw.append(list(iml))
@@ -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 or exclude_low_fxy: #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
@@ -834,8 +834,8 @@ verbose: {verbose}")
# 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
for j in range(0, len(products)): for j in range(0, len(products)):
vmin = np.nanmin(iml_grid_prep[j]) vmin = np.nanmin(iml_grid_prep[j])