From 82fd3a2dabf45aac88264b0c84203dea72a7a58f Mon Sep 17 00:00:00 2001
From: Peter Powers <pmpowers@usgs.gov>
Date: Tue, 20 Feb 2024 12:01:25 -0700
Subject: [PATCH] ASK14 getV1 refactor

---
 .../nshmp/gmm/AbrahamsonEtAl_2014.java        | 23 +++++++++----------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/src/main/java/gov/usgs/earthquake/nshmp/gmm/AbrahamsonEtAl_2014.java b/src/main/java/gov/usgs/earthquake/nshmp/gmm/AbrahamsonEtAl_2014.java
index dee2f964..c72c5f63 100644
--- a/src/main/java/gov/usgs/earthquake/nshmp/gmm/AbrahamsonEtAl_2014.java
+++ b/src/main/java/gov/usgs/earthquake/nshmp/gmm/AbrahamsonEtAl_2014.java
@@ -50,11 +50,11 @@ import gov.usgs.earthquake.nshmp.tree.LogicTree;
  * <p><b>Component:</b> RotD50 (average horizontal)
  *
  * @author U.S. Geological Survey
+ * @see Gmm#ASK_14_BASE
  * @see Gmm#ASK_14
  * @see Gmm#ASK_14_BASIN
  * @see Gmm#ASK_14_CYBERSHAKE
- * @see Gmm#ASK_14_CYBERSHAKE_ON
- *
+ * @see Gmm#ASK_14_VS30_MEASURED
  */
 public class AbrahamsonEtAl_2014 implements GroundMotionModel {
 
@@ -341,17 +341,16 @@ public class AbrahamsonEtAl_2014 implements GroundMotionModel {
 
   // -- Equation 9
   private static final double getV1(Imt imt) {
-    Double T = imt.period();
-    if (T == null) {
-      return 1500.0;
-    }
-    if (T >= 3.0) {
-      return 800.0;
-    }
-    if (T > 0.5) {
-      return exp(-0.35 * log(T / 0.5) + log(1500.0));
+    if (imt.isSA()) {
+      double T = imt.period();
+      if (T >= 3.0) {
+        return 800.0;
+      }
+      if (T > 0.5) {
+        return exp(-0.35 * log(T / 0.5) + log(1500.0));
+      }
     }
-    return 1500.0;
+    return 1500.0; // PGA, PGV and low period SA
   }
 
   // used for interpolation in calcSoilTerm(), below
-- 
GitLab