From 7e89f75c844e1f7994c172668d52b995a0ccde08 Mon Sep 17 00:00:00 2001 From: ftong <95+ftong@noreply.example.org> Date: Mon, 15 Jun 2026 11:05:04 +0200 Subject: [PATCH] Update src/seismic_hazard_forecasting.py put AOI_extent as a parameter of the main function --- src/seismic_hazard_forecasting.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/seismic_hazard_forecasting.py b/src/seismic_hazard_forecasting.py index ba5f1aa..3602e52 100644 --- a/src/seismic_hazard_forecasting.py +++ b/src/seismic_hazard_forecasting.py @@ -3,7 +3,7 @@ def main(catalog_file, mc_file, pdf_file, m_file, m_select, mag_label, mc, m_max, m_kde_method, xy_select, grid_dim, xy_win_method, rate_select, time_win_duration, - forecast_select, custom_rate, forecast_len, time_unit, model, products_string, verbose): + forecast_select, custom_rate, forecast_len, time_unit, AOI_extent, model, products_string, verbose): """ Python application that reads an earthquake catalog and performs seismic hazard forecasting. Arguments: @@ -33,6 +33,8 @@ def main(catalog_file, mc_file, pdf_file, m_file, m_select, mag_label, mc, m_max forecasting. forecast_len: Length of the forecast for seismic hazard assessment. time_unit: Times units for the inputs Time Window Duration, Custom Activity Rate, and Forecast Length. + AOI_extent: The forecast geographical area of interest specified as a latitude and longitude range in decimal degrees + in the form [lat_min, lat_max, lon_min, lon_max]. model: Select from the following ground motion models available. Other models in the Openquake library are available but have not yet been tested. products_string: The ground motion intensity types to output. Use a space between names to select more than @@ -91,8 +93,8 @@ def main(catalog_file, mc_file, pdf_file, m_file, m_select, mag_label, mc, m_max exclude_low_fxy = False # 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([51.48, 51.54]) # temporary hard-coding to area of Zelazny Most. To be replaced with user-defined lat and lon range - AOI_lon = np.array([16.15, 16.24]) + AOI_lat = np.array(AOI_extent[:2]) + AOI_lon = np.array(AOI_extent[2:]) # log user selections logger.debug(f"User input files\n Catalog: {catalog_file}\n Mc: {mc_file}\n Mag_PDF: {pdf_file}\n Mag: {m_file}")