From 46052794d25af1384d3baf985ddf25a0561fe5a3 Mon Sep 17 00:00:00 2001 From: Jason Altekruse <jaltekruse@usgs.gov> Date: Tue, 16 Apr 2024 09:05:30 -0600 Subject: [PATCH] consolidate Global interface AK bias correction coefficient into the GMM's main Coefficients class. This ensures the PGA correction is used for the PGA reference calc in the same manner as the other coefficients. --- .../nshmp/gmm/AbrahamsonGulerce_2020.java | 40 ++++++++-------- .../earthquake/nshmp/gmm/KuehnEtAl_2020.java | 46 +++++++++---------- .../earthquake/nshmp/gmm/ParkerEtAl_2020.java | 44 +++++++++--------- 3 files changed, 62 insertions(+), 68 deletions(-) diff --git a/src/main/java/gov/usgs/earthquake/nshmp/gmm/AbrahamsonGulerce_2020.java b/src/main/java/gov/usgs/earthquake/nshmp/gmm/AbrahamsonGulerce_2020.java index 63f7a88c..16cd08f2 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/gmm/AbrahamsonGulerce_2020.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/gmm/AbrahamsonGulerce_2020.java @@ -130,7 +130,14 @@ public abstract class AbrahamsonGulerce_2020 implements GroundMotionModel { final double a1Adj; final double ε; // epistemic uncertainty in mean - Coefficients(Imt imt, CoefficientContainer cc, SubductionZone zone) { + // USGS bias correction coefficient for Gobal interface models in Alaska + final double correctionAK; + + Coefficients( + Imt imt, + CoefficientContainer cc, + CoefficientContainer ccBias, + SubductionZone zone) { this.imt = imt; Map<String, Double> coeffs = cc.get(imt); @@ -191,32 +198,24 @@ public abstract class AbrahamsonGulerce_2020 implements GroundMotionModel { ÏW = coeffs.get("rhoW"); vlin = coeffs.get("vlin"); b = coeffs.get("b"); - } - } - - /* - * Average bias-correction for NGA-Subduction interface models in Alaska nshm. - */ - private static final class CoefficientsAkBias { - final double correction; - final double correctionPGA; - CoefficientsAkBias(Imt imt, CoefficientContainer cc) { - correction = cc.get(imt).get("bias_ak"); - correctionPGA = cc.get(PGA).get("bias_ak"); + /* + * Average bias-correction for NGA-Subduction global interface models in + * Alaska NSHM. + */ + Map<String, Double> coeffsBias = ccBias.get(imt); + correctionAK = coeffsBias.get("bias_ak"); } } private final Coefficients coeffs; private final Coefficients coeffsPGA; - private final CoefficientsAkBias coeffAkBias; private final Gmm subtype; AbrahamsonGulerce_2020(Imt imt, Gmm subtype, SubductionZone zone) { this.subtype = subtype; - coeffs = new Coefficients(imt, COEFFS, zone); - coeffsPGA = new Coefficients(PGA, COEFFS, zone); - coeffAkBias = new CoefficientsAkBias(imt, COEFFS_AK_BIAS); + coeffs = new Coefficients(imt, COEFFS, COEFFS_AK_BIAS, zone); + coeffsPGA = new Coefficients(PGA, COEFFS, COEFFS_AK_BIAS, zone); } @Override @@ -255,11 +254,11 @@ public abstract class AbrahamsonGulerce_2020 implements GroundMotionModel { double pgaRock = 0.0; if (in.vs30 < coeffs.vlin) { pgaRock = exp(calcMean( - coeffsPGA, coeffAkBias.correctionPGA, slab(), basin(), adjusted(), akBiasAdjusted(), + coeffsPGA, slab(), basin(), adjusted(), akBiasAdjusted(), 0.0, in.Mw, in.rRup, in.zTor, VS30_ROCK, in.z2p5)); } double μ = calcMean( - coeffs, coeffAkBias.correction, slab(), basin(), adjusted(), akBiasAdjusted(), + coeffs, slab(), basin(), adjusted(), akBiasAdjusted(), pgaRock, in.Mw, in.rRup, in.zTor, in.vs30, in.z2p5); double σ = calcSigma(coeffs, coeffsPGA, pgaRock, in.rRup, in.vs30); @@ -273,7 +272,6 @@ public abstract class AbrahamsonGulerce_2020 implements GroundMotionModel { private static double calcMean( Coefficients c, - double correctionAk, boolean slab, boolean basin, boolean adjust, @@ -353,7 +351,7 @@ public abstract class AbrahamsonGulerce_2020 implements GroundMotionModel { } if (!slab && akBiasAdjusted) { - μ += correctionAk; + μ += c.correctionAK; } return μ; diff --git a/src/main/java/gov/usgs/earthquake/nshmp/gmm/KuehnEtAl_2020.java b/src/main/java/gov/usgs/earthquake/nshmp/gmm/KuehnEtAl_2020.java index 9c1fe65a..7ec3bea9 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/gmm/KuehnEtAl_2020.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/gmm/KuehnEtAl_2020.java @@ -182,7 +182,15 @@ public abstract class KuehnEtAl_2020 implements GroundMotionModel { final double zBreak; // dzb_if dzb_slab final double zRef; - Coefficients(Imt imt, CoefficientContainer cc, SubductionZone zone, boolean slab) { + // USGS bias correction coefficient for Gobal interface models in Alaska + final double correctionAK; + + Coefficients( + Imt imt, + CoefficientContainer cc, + CoefficientContainer ccBias, + SubductionZone zone, + boolean slab) { this.imt = imt; this.zone = zone; Map<String, Double> coeffs = cc.get(imt); @@ -243,31 +251,23 @@ public abstract class KuehnEtAl_2020 implements GroundMotionModel { φ = coeffs.get("phi"); Ï„ = coeffs.get("tau"); Ï = coeffs.get("rho"); - } - } - /* - * Average bias-correction for NGA-Subduction interface models in Alaska nshm. - */ - private static final class CoefficientsAkBias { - final double correction; - final double correctionPGA; - - CoefficientsAkBias(Imt imt, CoefficientContainer cc) { - correction = cc.get(imt).get("bias_ak"); - correctionPGA = cc.get(PGA).get("bias_ak"); + /* + * Average bias-correction for NGA-Subduction global interface models in + * Alaska NSHM. + */ + Map<String, Double> coeffsBias = ccBias.get(imt); + correctionAK = coeffsBias.get("bias_ak"); } } private final Coefficients coeffs; private final Coefficients coeffsPGA; - private final CoefficientsAkBias coeffsAkBias; private final GroundMotionTable epistemicTable; KuehnEtAl_2020(Imt imt, SubductionZone zone) { - coeffs = new Coefficients(imt, COEFFS, zone, slab()); - coeffsPGA = new Coefficients(PGA, COEFFS, zone, slab()); - coeffsAkBias = new CoefficientsAkBias(imt, COEFFS_AK_BIAS); + coeffs = new Coefficients(imt, COEFFS, COEFFS_AK_BIAS, zone, slab()); + coeffsPGA = new Coefficients(PGA, COEFFS, COEFFS_AK_BIAS, zone, slab()); SubductionZone.Type szType = slab() ? SLAB : INTERFACE; epistemicTable = GroundMotionTables.getKbcg20(zone, szType, imt); } @@ -306,17 +306,17 @@ public abstract class KuehnEtAl_2020 implements GroundMotionModel { public LogicTree<GroundMotion> calc(GmmInput in) { double pgaRef = exp(calcPgaRef( - coeffsPGA, coeffsAkBias.correctionPGA, slab(), akBiasAdjusted(), + coeffsPGA, slab(), akBiasAdjusted(), in.Mw, in.rRup, in.zTor)); double μ = calcMean( - coeffs, coeffsAkBias.correction, slab(), basin(), seattle(), m9(), akBiasAdjusted(), + coeffs, slab(), basin(), seattle(), m9(), akBiasAdjusted(), in.Mw, in.rRup, in.zTor, in.vs30, in.z2p5, pgaRef); // short periods can't be lower than PGA if (coeffs.imt.isSA() && coeffs.imt.period() <= 0.1) { double μPga = calcMean( - coeffsPGA, coeffsAkBias.correctionPGA, slab(), basin(), seattle(), m9(), akBiasAdjusted(), + coeffsPGA, slab(), basin(), seattle(), m9(), akBiasAdjusted(), in.Mw, in.rRup, in.zTor, in.vs30, in.z2p5, pgaRef); μ = max(μ, μPga); } @@ -337,7 +337,6 @@ public abstract class KuehnEtAl_2020 implements GroundMotionModel { private static double calcPgaRef( Coefficients c, - double correctionAk, boolean slab, boolean akBiasAdjusted, double Mw, @@ -352,7 +351,7 @@ public abstract class KuehnEtAl_2020 implements GroundMotionModel { double μ = c.θ1 + fMag + fGeom + fDepth + fAtten + fSite; if (!slab && akBiasAdjusted) { - μ += correctionAk; + μ += c.correctionAK; } return μ; @@ -360,7 +359,6 @@ public abstract class KuehnEtAl_2020 implements GroundMotionModel { private static double calcMean( Coefficients c, - double correctionAk, boolean slab, boolean basin, boolean seattle, @@ -382,7 +380,7 @@ public abstract class KuehnEtAl_2020 implements GroundMotionModel { double μ = c.θ1 + fMag + fGeom + fDepth + fAtten + fSite + fBasin; if (!slab && akBiasAdjusted) { - μ += correctionAk; + μ += c.correctionAK; } return μ; diff --git a/src/main/java/gov/usgs/earthquake/nshmp/gmm/ParkerEtAl_2020.java b/src/main/java/gov/usgs/earthquake/nshmp/gmm/ParkerEtAl_2020.java index 7820fa08..73238b62 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/gmm/ParkerEtAl_2020.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/gmm/ParkerEtAl_2020.java @@ -154,6 +154,9 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { final double Ï„, Ï•21, Ï•22, Ï•2v; final double σε1, σε2, t1, t2; + // USGS bias correction coefficient for Gobal interface models in Alaska + final double correctionAK; + // inlined // final double b4, v1, vRef; @@ -162,7 +165,12 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { // final del_None, del_Seattle; // final double vm, Ï•2s2s0, a1, Ï•2ss1, Ï•2ss2, a2; - Coefficients(Imt imt, CoefficientContainer cc, SubductionZone zone, boolean slab) { + Coefficients( + Imt imt, + CoefficientContainer cc, + CoefficientContainer ccBias, + SubductionZone zone, + boolean slab) { this.imt = imt; // Required for σε @@ -243,31 +251,23 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { } else { throw new IllegalArgumentException("Subduction zone [" + zone + "] not supported"); } - } - } - - /* - * Average bias-correction for NGA-Subduction interface models in Alaska nshm. - */ - private static final class CoefficientsAkBias { - final double correction; - final double correctionPGA; - CoefficientsAkBias(Imt imt, CoefficientContainer cc) { - correction = cc.get(imt).get("bias_ak"); - correctionPGA = cc.get(PGA).get("bias_ak"); + /* + * Average bias-correction for NGA-Subduction global interface models in + * Alaska NSHM. + */ + Map<String, Double> coeffsBias = ccBias.get(imt); + correctionAK = coeffsBias.get("bias_ak"); } } private final Coefficients coeffs; private final Coefficients coeffsPGA; - private final CoefficientsAkBias coeffAkBias; ParkerEtAl_2020(Imt imt, SubductionZone zone) { CoefficientContainer cc = slab() ? COEFFS_SLAB : COEFFS_INTERFACE; - coeffs = new Coefficients(imt, cc, zone, slab()); - coeffsPGA = new Coefficients(PGA, cc, zone, slab()); - coeffAkBias = new CoefficientsAkBias(imt, COEFFS_AK_BIAS); + coeffs = new Coefficients(imt, cc, COEFFS_AK_BIAS, zone, slab()); + coeffsPGA = new Coefficients(PGA, cc, COEFFS_AK_BIAS, zone, slab()); } @Override @@ -299,10 +299,10 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { public final LogicTree<GroundMotion> calc(GmmInput in) { double pgaRef = exp(calcMean( - coeffsPGA, coeffAkBias.correctionPGA, slab(), akBiasAdjusted(), in)); + coeffsPGA, slab(), akBiasAdjusted(), in)); double μ = calcMean( - coeffs, coeffAkBias.correction, slab(), basin(), m9(), akBiasAdjusted(), pgaRef, in); + coeffs, slab(), basin(), m9(), akBiasAdjusted(), pgaRef, in); double Ï•Total = phiTotal(coeffs, in.rRup, in.vs30); double σ = Maths.hypot(coeffs.Ï„, Ï•Total); @@ -318,7 +318,6 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { /* Calc median at 760 reference condition */ private static double calcMean( Coefficients c, - double correctionAk, boolean slab, boolean akBiasAdjusted, GmmInput in) { @@ -330,7 +329,7 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { double μ = c.c0 + Fp + Fm + Fd; if (!slab && akBiasAdjusted) { - μ += correctionAk; + μ += c.correctionAK; } return μ; @@ -339,7 +338,6 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { /* Equation 1 */ private static double calcMean( Coefficients c, - double correctionAk, boolean slab, boolean basin, boolean m9, @@ -361,7 +359,7 @@ public abstract class ParkerEtAl_2020 implements GroundMotionModel { double μ = c.c0 + Fp + Fm + Fd + Fs; if (!slab && akBiasAdjusted) { - μ += correctionAk; + μ += c.correctionAK; } return μ; -- GitLab