Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain the basin term in the toml better #446

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docsrc/contents/smt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ Comparing GMPEs
Z1 = -999
Z25 = -999
up_or_down_dip = 1 # 1 = up-dip, 0 = down-dip
region = 'Global' # get region specific z1pt0 and zpt50 ('Global' or 'Japan')
z_basin_region = 'Global' # Obtain z1pt0/z2pt5 from "Global" or "JPN" (Japan) empirical Vs30-based relationships if z1pt0 or z2pt5 not specified above

# Characterise earthquake for the region of interest as finite rupture
[source_properties]
Expand Down
2 changes: 1 addition & 1 deletion openquake/smt/comparison/compare_gmpes.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self, filename):
self.Z25 = config_file['site_properties']['Z25']
up_or_down_dip = config_file['site_properties']['up_or_down_dip']
self.up_or_down_dip = float(up_or_down_dip)
self.region = config_file['site_properties']['region']
self.z_basin_region = config_file['site_properties']['z_basin_region']

# Get rupture params
self.trt = config_file['source_properties']['trt']
Expand Down
12 changes: 8 additions & 4 deletions openquake/smt/comparison/utils_compare_gmpes.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def plot_trellis_util(config, output_directory):
gmc_p= [[{}, {}, {}], [{}, {}, {}], [{}, {}, {}], [{}, {}, {}]]

# Get basin params
Z1, Z25 = get_z1_z25(config.Z1, config.Z25, config.Vs30, config.region)
Z1, Z25 = get_z1_z25(config.Z1, config.Z25,
config.Vs30, config.z_basin_region)

# Get lt weights
lt_weights = [config.lt_weights_gmc1, config.lt_weights_gmc2,
Expand Down Expand Up @@ -187,7 +188,8 @@ def plot_spectra_util(config, output_directory, obs_spectra):
gmc_weights = [config.lt_weights_gmc1, config.lt_weights_gmc2,
config.lt_weights_gmc3, config.lt_weights_gmc4]
imt_list, periods = _get_imts(max_period)
Z1, Z25 = get_z1_z25(config.Z1, config.Z25, config.Vs30, config.region)
Z1, Z25 = get_z1_z25(config.Z1, config.Z25,
config.Vs30, config.z_basin_region)

# Get colours and make the figure
colors = get_colors(config.custom_color_flag, config.custom_color_list)
Expand Down Expand Up @@ -319,7 +321,8 @@ def plot_ratios_util(config, output_directory):
dep_list = config.trellis_and_rs_depth_list

# Get basin params
Z1, Z25 = get_z1_z25(config.Z1, config.Z25, config.Vs30, config.region)
Z1, Z25 = get_z1_z25(config.Z1, config.Z25,
config.Vs30, config.z_basin_region)

# Get config key
cfg_key = 'vs30 = %s m/s, GMM sigma epsilon = %s' % (config.Vs30,
Expand Down Expand Up @@ -409,7 +412,8 @@ def compute_matrix_gmpes(config, mtxs_type):

# Set store and get z1pt0, z2pt5
mtxs_median = {}
Z1, Z25 = get_z1_z25(config.Z1, config.Z25, config.Vs30, config.region)
Z1, Z25 = get_z1_z25(config.Z1, config.Z25,
config.Vs30, config.z_basin_region)

for n, i in enumerate(config.imt_list): # Iterate through imt_list
matrix_medians=np.zeros((len(config.gmpes_list), (len(mag_list)*int((
Expand Down
2 changes: 1 addition & 1 deletion openquake/smt/demos/demo_comparison_analysis_inputs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ vs30 = 800
Z1 = -999
Z25 = -999
up_or_down_dip = 1 # 1 = up-dip, 0 = down-dip
region = 'Global' # region specific basin effects
basin_z_region = 'Global' # Obtain z1pt0/z2pt5 from "Global" or "JPN" (Japan) empirical Vs30-based relationships if z1pt0 or z2pt5 not specified above

# Characterise earthquake for the region of interest as finite rupture
[source_properties]
Expand Down
4 changes: 2 additions & 2 deletions openquake/smt/tests/comparison/comparison_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

# Defines the target values for each run in the inputted .toml file
TARGET_VS30 = 800
TARGET_REGION = 'Global'
TARGET_Z_BASIN_REGION = 'Global'
TARGET_TRELLIS_DEPTHS = [20, 25, 30]
TARGET_RMIN = 0
TARGET_RMAX = 300
Expand Down Expand Up @@ -90,7 +90,7 @@ def test_configuration_object_check(self):
self.assertEqual(config.Vs30, TARGET_VS30)

# Check for target region
self.assertEqual(config.region, TARGET_REGION)
self.assertEqual(config.z_basin_region, TARGET_Z_BASIN_REGION)

# Check for target depths (other functions use arrays from these
# depths)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Nstd = 1 # num. of std. dev. to sample sigma for in median prediction (0, 1, 2 o
vs30 = 800
Z1 = -999
Z25 = -999
up_or_down_dip = 0 # 1 = up-dip, 0 = down-dip
region = 'Global' # region specific basin effects
up_or_down_dip = 0 # 1 = up-dip, 0 = down-dist_type
z_basin_region = 'Global' # Obtain z1pt0/z2pt5 from "Global" or "JPN" (Japan) empirical Vs30-based relationships if z1pt0 or z2pt5 not specified above

# Characterise earthquake for the region of interest (note in this case we are using information in the observed spectra csv, so this information is overwritten)
[source_properties]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ vs30 = 800
Z1 = -999
Z25 = -999
up_or_down_dip = 1 # 1 = up-dip, 0 = down-dip
region = 'Global' # region specific basin effects
z_basin_region = 'Global' # Obtain z1pt0/z2pt5 from "Global" or "JPN" (Japan) empirical Vs30-based relationships if z1pt0 or z2pt5 not specified above

[source_properties] # Characterise EQ as finite rupture
trt = 'ASCR' # Either string of 'None' to use user-provided aratio OR specify a TRT string from ASCR, InSlab, Interface, Stable, Upper_Mantle, Volcanic, Induced, Induced_Geothermal to assign a trt-dependent proxy aratio
Expand Down
4 changes: 2 additions & 2 deletions openquake/smt/tests/comparison/data/mgmpe_inputs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Nstd = 1 # number of standard deviations to sample from sigma distribution
vs30 = 800
Z1 = -999
Z25 = -999
up_or_down_dip = 1 # 1 = up-dip, 0 = down-dip
region = 'Global' # region specific basin effects
up_or_down_dip = 1 # 1 = up-dip, 0 = down-dist_type
z_basin_region = 'Global' # Obtain z1pt0/z2pt5 from "Global" or "JPN" (Japan) empirical Vs30-based relationships if z1pt0 or z2pt5 not specified above

[source_properties] # Characterise EQ as finite rupture
trt = 'ASCR' # Either string of 'None' to use user-provided aratio OR specify a TRT string from ASCR, InSlab, Interface, Stable, Upper_Mantle, Volcanic, Induced, Induced_Geothermal to assign a trt-dependent proxy aratio
Expand Down
Loading