From f58a191847fd61af4a0a791528d710a0c9364a52 Mon Sep 17 00:00:00 2001
From: Peter Powers <pmpowers@usgs.gov>
Date: Wed, 27 Mar 2024 11:11:08 -0600
Subject: [PATCH] updated bias values; added hi vs30 taper

---
 .../usgs/earthquake/nshmp/gmm/NgaEast.java    | 14 +++++-
 .../earthquake/nshmp/model/ModelLoader.java   |  5 +-
 .../gmm/coeffs/nga-east-usgs-adj-2023.csv     | 48 +++++++++----------
 3 files changed, 39 insertions(+), 28 deletions(-)

diff --git a/src/main/java/gov/usgs/earthquake/nshmp/gmm/NgaEast.java b/src/main/java/gov/usgs/earthquake/nshmp/gmm/NgaEast.java
index 2b7bedf7..0873f55f 100644
--- a/src/main/java/gov/usgs/earthquake/nshmp/gmm/NgaEast.java
+++ b/src/main/java/gov/usgs/earthquake/nshmp/gmm/NgaEast.java
@@ -260,10 +260,12 @@ public abstract class NgaEast implements GroundMotionModel {
   private static final class CoefficientsNgaAdj2023 {
 
     final double nga_adj;
+    final double vs30_b;
 
     CoefficientsNgaAdj2023(Imt imt, CoefficientContainer cc) {
       Map<String, Double> coeffs = cc.get(imt);
       nga_adj = coeffs.get("nga_adj");
+      vs30_b = coeffs.get("vs30_b");
     }
   }
 
@@ -485,8 +487,12 @@ public abstract class NgaEast implements GroundMotionModel {
     @Override
     public LogicTree<GroundMotion> calc(GmmInput in) {
       double zScale = zSiteScale(in.zSed);
+      double ngsAdj = coeffsNgaAdj.nga_adj;
+      if (in.vs30 > 1000.0) {
+        ngsAdj += coeffsNgaAdj.vs30_b * log(min(in.vs30, 2000.0) / 1000.0);
+      }
       double μAdj = adjusted()
-          ? (1.0 - zScale) * coeffsNgaAdj.nga_adj
+          ? (1.0 - zScale) * ngsAdj
           : 0.0;
       boolean cpa = cpa() && zScale > 0.0;
       double fCpa = cpa
@@ -687,8 +693,12 @@ public abstract class NgaEast implements GroundMotionModel {
     public LogicTree<GroundMotion> calc(GmmInput in) {
       GmmInput inRock = GmmInput.builder().fromCopy(in).vs30(3000).build();
       double zScale = zSiteScale(in.zSed);
+      double ngsAdj = coeffsNgaAdj.nga_adj;
+      if (in.vs30 > 1000.0) {
+        ngsAdj += coeffsNgaAdj.vs30_b * log(min(in.vs30, 2000.0) / 1000.0);
+      }
       double μAdj = adjusted()
-          ? (1.0 - zScale) * coeffsNgaAdj.nga_adj
+          ? (1.0 - zScale) * ngsAdj
           : 0.0;
       boolean cpa = cpa() && zScale > 0.0;
       double fCpa = cpa
diff --git a/src/main/java/gov/usgs/earthquake/nshmp/model/ModelLoader.java b/src/main/java/gov/usgs/earthquake/nshmp/model/ModelLoader.java
index 1a6f9e79..256962ed 100644
--- a/src/main/java/gov/usgs/earthquake/nshmp/model/ModelLoader.java
+++ b/src/main/java/gov/usgs/earthquake/nshmp/model/ModelLoader.java
@@ -103,9 +103,9 @@ abstract class ModelLoader {
 
   public static void main(String[] args) throws IOException {
 
-    // Path testModel = Paths.get("../nshm-conus-2018-5.2.x-maint");
+    Path testModel = Paths.get("../nshm-conus-2018-5.2.x-maint");
     // Path testModel = Paths.get("../nshm-conus");
-    Path testModel = Paths.get("../nshm-alaska");
+    // Path testModel = Paths.get("../nshm-alaska");
     // Path testModel = Paths.get("../nshm-alaska-2007-2.2.x-maint");
     // Path testModel = Paths.get("../nshm-hawaii");
 
@@ -128,6 +128,7 @@ abstract class ModelLoader {
     System.out.println(model.types());
     // System.out.println(model.features().keySet());
 
+    System.out.println(model.config());
     System.out.println("ModelLoader Done");
 
     // todo for AK need this for Shaw width limited
diff --git a/src/main/resources/gmm/coeffs/nga-east-usgs-adj-2023.csv b/src/main/resources/gmm/coeffs/nga-east-usgs-adj-2023.csv
index 1824e65c..479bf861 100644
--- a/src/main/resources/gmm/coeffs/nga-east-usgs-adj-2023.csv
+++ b/src/main/resources/gmm/coeffs/nga-east-usgs-adj-2023.csv
@@ -1,24 +1,24 @@
-  T,    nga_adj
-  PGV,   -0.031
-  PGA,   -0.089
-  0.01,  -0.089
-  0.02,  -0.230
-  0.03,  -0.320
-  0.05,  -0.340
-  0.075, -0.310
-  0.1,   -0.280
-  0.15,  -0.238
-  0.2,   -0.195
-  0.25,  -0.160
-  0.3,   -0.134
-  0.4,   -0.095
-  0.5,   -0.070
-  0.75,  -0.019
-  1.0,    0.020
-  1.5,    0.065
-  2.0,    0.100
-  3.0,    0.240
-  4.0,    0.330
-  5.0,    0.395
-  7.5,    0.500
-  10.0,   0.440
+  T,    nga_adj, vs30_b
+  PGV,   -0.085, -0.250
+  PGA,   -0.040, -0.346
+  0.01,  -0.070, -0.352
+  0.02,  -0.210, -0.305
+  0.03,  -0.211, -0.261
+  0.05,  -0.212, -0.220
+  0.075, -0.205, -0.220
+  0.1,   -0.205, -0.220
+  0.15,  -0.192, -0.220
+  0.2,   -0.149, -0.220
+  0.25,  -0.132, -0.220
+  0.3,   -0.121, -0.220
+  0.4,   -0.097, -0.220
+  0.5,   -0.090, -0.220
+  0.75,  -0.040, -0.205
+  1.0,   -0.010, -0.175
+  1.5,    0.045, -0.173
+  2.0,    0.140, -0.173
+  3.0,    0.270, -0.173
+  4.0,    0.315, -0.173
+  5.0,    0.377, -0.173
+  7.5,    0.448, -0.173
+  10.0,   0.401, -0.173
-- 
GitLab