Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
CB-quakemodel committed Jul 7, 2024
1 parent 547db3b commit d4e3f94
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 36 deletions.
38 changes: 6 additions & 32 deletions openquake/smt/comparison/compare_gmpes.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ def __init__(self, filename):
self.trellis_and_rs_mag_list[idx])

# Depths per magnitude for trellis plots
self.trellis_and_rs_depth = config_file['source_properties'][
self.trellis_and_rs_depth_list = config_file['source_properties'][
'trellis_and_rs_depths']
for idx, depth in enumerate(self.trellis_and_rs_depth):
self.trellis_and_rs_depth[idx] = float(
self.trellis_and_rs_depth[idx])
for idx, depth in enumerate(self.trellis_and_rs_depth_list):
self.trellis_and_rs_depth_list[idx] = float(
self.trellis_and_rs_depth_list[idx])

# Get mags for Sammons, Euclidean distance and clustering
mag_params = config_file['mag_values_non_trellis_or_spectra_functions']
Expand Down Expand Up @@ -198,33 +198,7 @@ def plot_trellis(filename, output_directory):
# Generate config object
config = Configurations(filename)

store = plot_trellis_util(config.trt,
config.ztor,
config.rake,
config.strike,
config.dip,
config.trellis_and_rs_depth,
config.Z1,
config.Z25,
config.Vs30,
config.region,
config.imt_list,
config.trellis_and_rs_mag_list,
config.minR,
config.maxR,
config.gmpes_list,
config.aratio,
config.Nstd,
output_directory,
config.custom_color_flag,
config.custom_color_list,
config.eshm20_region,
config.dist_type,
config.lt_weights_gmc1,
config.lt_weights_gmc2,
config.lt_weights_gmc3,
config.lt_weights_gmc4,
config.up_or_down_dip)
store = plot_trellis_util(config)

return store

Expand All @@ -247,7 +221,7 @@ def plot_spectra(filename, output_directory, obs_spectra=None):
config.rake,
config.strike,
config.dip,
config.trellis_and_rs_depth,
config.trellis_and_rs_depth_list,
config.Z1,
config.Z25,
config.Vs30,
Expand Down
9 changes: 5 additions & 4 deletions openquake/smt/tests/comparison/comparison_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def test_configuration_object_check(self):

# Check for target depths (other functions use arrays from these
# depths)
self.assertEqual(config.trellis_and_rs_depth, TARGET_TRELLIS_DEPTHS)
self.assertEqual(config.trellis_and_rs_depth_list,
TARGET_TRELLIS_DEPTHS)

# Check for target Rmin
self.assertEqual(config.minR, TARGET_RMIN)
Expand Down Expand Up @@ -316,7 +317,7 @@ def test_trellis_and_spectra_functions(self):
config.ztor,
config.rake, config.strike,
config.dip,
config.trellis_and_rs_depth,
config.trellis_and_rs_depth_list,
config.Z1,
config.Z25,
config.Vs30,
Expand Down Expand Up @@ -345,7 +346,7 @@ def test_trellis_and_spectra_functions(self):
config.rake,
config.strike,
config.dip,
config.trellis_and_rs_depth,
config.trellis_and_rs_depth_list,
config.Z1,
config.Z25,
config.Vs30,
Expand Down Expand Up @@ -393,7 +394,7 @@ def test_plot_observed_spectra(self):
config.rake,
config.strike,
config.dip,
config.trellis_and_rs_depth,
config.trellis_and_rs_depth_list,
config.Z1,
config.Z25,
config.Vs30,
Expand Down

0 comments on commit d4e3f94

Please sign in to comment.