Skip to content

Commit

Permalink
some edits
Browse files Browse the repository at this point in the history
  • Loading branch information
CB-quakemodel committed Nov 16, 2024
1 parent 83cf7a7 commit 38274bf
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
11 changes: 8 additions & 3 deletions openquake/hazardlib/gsim/kuehn_2020.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,15 @@ def get_mean_values(C, region, imt, trt, m_b, ctx, a1100=None,
else:
usgs_baf = 1.0

if m9_basin_term:
# For KuehnEtAl2020 in US 2023 either the M9 basin term OR the GMM's
# basin term is applied (i.e. it is not additive to GMM basin term here
# as can be seen in the code - line 457 to 499 of KuehnEtAl_2020.java)
if m9_basin_term and imt != PGV:
# Apply + np.log(2.0) for long period motions at deep basin sites
mean = _apply_m9_basin_term(ctx, imt, mean, usgs_baf)

mean += get_basin_term(C, ctx, region) * usgs_baf
else:
# Use the GMM's own basin term
mean += get_basin_term(C, ctx, region) * usgs_baf

return mean

Expand Down
3 changes: 2 additions & 1 deletion openquake/hazardlib/gsim/mgmpe/m9_basin_term.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def _apply_m9_basin_term(ctx, imt, mean, usgs_baf=1.0):
class M9BasinTerm(GMPE):
"""
Implements a modified GMPE class that can be used to implement the "M9"
US 2023 NSHM basin amplification adjustment.
US 2023 NSHM basin amplification adjustment (an additive factor for long
period ground-motions in the Seattle Basin region).
This implementation is based on the description of the M9 adjustment
within the Moschetti et al. (2024) EQ Spectra article on the conterminous
Expand Down
19 changes: 12 additions & 7 deletions openquake/hazardlib/gsim/parker_2020.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

def _get_adjusted_m9_basin_term(C, z2pt5):
"""
Return the adjusted version of the m9 basin term as detailed within the
Return the adjusted version of the M9 basin term as detailed within the
USGS NSHM java code for the Abrahamson and Gulerce 2020 subduction GMM.
"""
delta_z2pt5_adj = np.log(z2pt5 * 1000.) - np.log(1179.)
Expand All @@ -59,6 +59,7 @@ def _get_adjusted_m9_basin_term(C, z2pt5):
fb_adj[fb_adj == 0.] = C['C_e3'] * delta_z2pt5_adj
return np.log(2.0) - fb_adj


def _get_sigma_mu_adjustment(sat_region, trt, imt, epi_adjs_table):
"""
Get the sigma_mu_adjustment (epistemic uncertainty) factor to be applied
Expand Down Expand Up @@ -463,19 +464,23 @@ def compute(self, ctx: np.recarray, imts, mean, sig, tau, phi):
C, C_PGA, ctx.mag, ctx.rrup, m_b)
fd = _depth_scaling(trt, C, ctx)
fd_pga = _depth_scaling(trt, C_PGA, ctx)
fb = _get_basin_term(C, ctx, self.region, self.basin) * usgs_baf
fb = _get_basin_term(C, ctx, self.region, self.basin)
flin = _linear_amplification(self.region, C, ctx.vs30)
fnl = _non_linear_term(C, imt, ctx.vs30, fp_pga, fm_pga, c0_pga,
fd_pga)

# The output is the desired median model prediction in LN units
# Take the exponential to get PGA, PSA in g or the PGV in cm/s
pre_baf_mean = fp + fnl + flin + fm + c0 + fd
if self.m9_basin_term:
m9_adj = _get_adjusted_m9_basin_term(C, ctx.z2pt5)
mean[m] = pre_baf_mean + m9_adj
else:
mean[m] = pre_baf_mean + fb

# Get the m9 basin adjustment if long period SA for deep basin sites
if self.m9_basin_term and imt != PGV:
if imt.period >= 1.9:
m9_adj = _get_adjusted_m9_basin_term(C, ctx.z2pt5)
fb[ctx.z2pt5 >= 6.0] += m9_adj[ctx.z2pt5 >= 6.0]

# Now get the mean with basin term added
mean[m] = pre_baf_mean + (fb * usgs_baf)

if self.sigma_mu_epsilon and imt != PGV: # Assume don't apply to PGV
# Apply epistemic uncertainty scaling
Expand Down

0 comments on commit 38274bf

Please sign in to comment.