Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00c0ca4c3a | ||
|
|
008b3f7d21 | ||
|
|
2b6cd52131 | ||
|
|
7e550f36f9 |
@@ -7,13 +7,13 @@ from matplotlib.ticker import MultipleLocator
|
|||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
global ncp_choice, tcp_max, torder_min, torder_max, AOI_lat, AOI_lon
|
global ncp_choice, tcp_max, torder_min, torder_max
|
||||||
ncp_choice = 'default'
|
ncp_choice = 'default'
|
||||||
tcp_max = 5
|
tcp_max = 5
|
||||||
torder_min = 0
|
torder_min = 0
|
||||||
torder_max = 1
|
torder_max = 1
|
||||||
AOI_lat = np.array([51.48, 51.54])
|
#AOI_lat = np.array([51.48, 51.54])
|
||||||
AOI_lon = np.array([16.15, 16.24])
|
#AOI_lon = np.array([16.15, 16.24])
|
||||||
#AOI_lat = np.array([None, None])
|
#AOI_lat = np.array([None, None])
|
||||||
#AOI_lon = np.array([None, None])
|
#AOI_lon = np.array([None, None])
|
||||||
|
|
||||||
@@ -253,8 +253,8 @@ def bins_and_beast(dates, unit, bin_dur, multiplicator):
|
|||||||
|
|
||||||
def main(catalog_file, mc_file, pdf_file, m_file, m_select, mag_label, mc, m_max,
|
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,
|
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, model, products_string, verbose):
|
||||||
# forecast_select, custom_rate, forecast_len, time_unit, AOI_extent, 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.
|
Python application that reads an earthquake catalog and performs seismic hazard forecasting.
|
||||||
Arguments:
|
Arguments:
|
||||||
@@ -344,8 +344,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
|
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
|
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])
|
||||||
# AOI_lon = np.array(AOI_extent[2:])
|
AOI_lon = np.array(AOI_extent[2:])
|
||||||
|
|
||||||
# log user selections
|
# 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}")
|
logger.debug(f"User input files\n Catalog: {catalog_file}\n Mc: {mc_file}\n Mag_PDF: {pdf_file}\n Mag: {m_file}")
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ def main(argv):
|
|||||||
else:
|
else:
|
||||||
raise argparse.ArgumentTypeError("Boolean value expected.")
|
raise argparse.ArgumentTypeError("Boolean value expected.")
|
||||||
|
|
||||||
|
def float_or_none(v):
|
||||||
|
return None if v.lower() == "none" else float(v)
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
|
||||||
parser.add_argument("catalog_file", help="Path to input file of type 'catalog'")
|
parser.add_argument("catalog_file", help="Path to input file of type 'catalog'")
|
||||||
@@ -55,6 +58,7 @@ def main(argv):
|
|||||||
parser.add_argument("--time_unit", type=str)
|
parser.add_argument("--time_unit", type=str)
|
||||||
parser.add_argument("--model", type=str)
|
parser.add_argument("--model", type=str)
|
||||||
parser.add_argument("--products_string", type=str)
|
parser.add_argument("--products_string", type=str)
|
||||||
|
parser.add_argument("--AOI_extent", nargs=4, type=float_or_none, default=[None] * 4, required=False)
|
||||||
parser.add_argument("--verbose", type=str2bool)
|
parser.add_argument("--verbose", type=str2bool)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|||||||
Reference in New Issue
Block a user