diff --git a/src/main/java/gov/usgs/earthquake/nshmp/calc/CalcConfig.java b/src/main/java/gov/usgs/earthquake/nshmp/calc/CalcConfig.java index 39e0b3e1a85ba1b1d23eb9d96f52597950641143..7ec631bf64bdfeee00cdf4741225004daa35db5a 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/calc/CalcConfig.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/calc/CalcConfig.java @@ -32,6 +32,7 @@ import java.util.Set; import java.util.TreeMap; import com.google.common.collect.Maps; +import com.google.common.collect.Range; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonDeserializationContext; @@ -213,8 +214,8 @@ public final class CalcConfig { * will apply a damping scale factor (DSF) to adjust the 5% damped spectral * ordinates predicted by GMMs. * - * <p><b>Default:</b> {@code 0.05} (5.0%)<br><b>Range:</b> {@code 0.5%} to - * {@code 30.0%} (0.005 to 0.3) + * <p><b>Default:</b> {@code 0.05} (5.0%)<br><b>Range:</b> {@code 0.005} to + * {@code 0.3} (0.5% to 30.0%) * * <p><b>Note:</b> At this time, the damping scaling factor (DSF) model * (Rezaeian et al., 2014) is only applicable to active continental crust @@ -225,6 +226,15 @@ public final class CalcConfig { */ public final double gmmDampingRatio; + /** + * Factor by which the aleatory variability (sigma) for all GMMs should be + * scaled. + * + * <p><b>Default:</b> 1.0<br><b>Range:</b> {@code 0.5} to {@code 1.0} (50% + * to 100%, no scaling) + */ + public final double gmmSigmaScaling; + /** * The value format for hazard curves. * @@ -246,6 +256,7 @@ public final class CalcConfig { this.sourceTypes = b.sourceTypes; this.vs30s = b.vs30s; this.gmmDampingRatio = b.gmmDampingRatio; + this.gmmSigmaScaling = b.gmmSigmaScaling; this.valueFormat = b.valueFormat; this.customImls = b.customImls; @@ -287,6 +298,7 @@ public final class CalcConfig { Set<SourceType> sourceTypes; Set<Double> vs30s; Double gmmDampingRatio; + Double gmmSigmaScaling; ValueFormat valueFormat; Map<Imt, double[]> customImls; Map<Imt, XySequence> curveMap; @@ -305,6 +317,11 @@ public final class CalcConfig { RezaeianDamping_2014.DAMPING_RATIO_RANGE, "gmmDampingRatio", gmmDampingRatio); + checkNotNull(gmmSigmaScaling); + checkInRange( + Range.closed(0.5, 1.0), + "gmmSigmaScaling", + gmmSigmaScaling); checkNotNull(valueFormat); checkNotNull(customImls); return new Hazard(this); @@ -318,6 +335,7 @@ public final class CalcConfig { this.sourceTypes = that.sourceTypes; this.vs30s = that.vs30s; this.gmmDampingRatio = that.gmmDampingRatio; + this.gmmSigmaScaling = that.gmmSigmaScaling; this.valueFormat = that.valueFormat; this.customImls = that.customImls; } @@ -344,6 +362,9 @@ public final class CalcConfig { if (that.gmmDampingRatio != null) { this.gmmDampingRatio = that.gmmDampingRatio; } + if (that.gmmSigmaScaling != null) { + this.gmmSigmaScaling = that.gmmSigmaScaling; + } if (that.valueFormat != null) { this.valueFormat = that.valueFormat; } diff --git a/src/main/resources/calc/calc-config-defaults.json b/src/main/resources/calc/calc-config-defaults.json index 7e3ace29cc17d1a6ac8c8412cef328fc62ab5e67..2de807379fd6a2b2c1b9d511d23ac232028539a3 100644 --- a/src/main/resources/calc/calc-config-defaults.json +++ b/src/main/resources/calc/calc-config-defaults.json @@ -13,7 +13,7 @@ "sourceTypes": [], "vs30s": [], "gmmDampingRatio": 0.05, - "gmmSigmaReduction": 0.15, + "gmmSigmaScaling": 1.0, "valueFormat": "ANNUAL_RATE", "customImls": {} }, diff --git a/src/test/java/gov/usgs/earthquake/nshmp/calc/CalcConfigTests.java b/src/test/java/gov/usgs/earthquake/nshmp/calc/CalcConfigTests.java index 9886fdeff0b6caa1ca52b1122ecf785618b632fc..91bafd901a32df139f352a673a5dd73cfb67eb7d 100644 --- a/src/test/java/gov/usgs/earthquake/nshmp/calc/CalcConfigTests.java +++ b/src/test/java/gov/usgs/earthquake/nshmp/calc/CalcConfigTests.java @@ -249,6 +249,7 @@ class CalcConfigTests { assertEquals(EnumSet.of(FAULT, ZONE, SLAB), def.sourceTypes); assertEquals(Set.of(260.0, 760.0), def.vs30s); assertEquals(0.03, def.gmmDampingRatio); + assertEquals(0.85, def.gmmSigmaScaling); assertEquals(ValueFormat.POISSON_PROBABILITY, def.valueFormat); assertArrayEquals( @@ -263,6 +264,7 @@ class CalcConfigTests { assertEquals(EnumSet.noneOf(SourceType.class), def.tectonicSettings); assertEquals(Set.of(), def.vs30s); assertEquals(0.05, def.gmmDampingRatio); + assertEquals(1.0, def.gmmSigmaScaling); assertEquals(ValueFormat.ANNUAL_RATE, def.valueFormat); } @@ -351,7 +353,7 @@ class CalcConfigTests { @Test void testOutputMember() { - List<Integer> defaultReturnPeroiods = List.of(475, 975, 2475); + List<Integer> defaultReturnPeroiods = List.of(475, 975, 2475, 10000); CalcConfig.Output def = DEFAULTS.output; assertEquals(Path.of("hazout"), def.directory); diff --git a/src/test/resources/calc/calc-config-extends.json b/src/test/resources/calc/calc-config-extends.json index f1f535f80947c972b714f97ef9831fc2006392a9..63a1758e405c11b2bd3c2997d1815c4c60bcea57 100644 --- a/src/test/resources/calc/calc-config-extends.json +++ b/src/test/resources/calc/calc-config-extends.json @@ -9,6 +9,7 @@ "sourceTypes": [ "FAULT", "ZONE", "SLAB" ], "vs30s": [ 260, 760 ], "gmmDampingRatio": 0.03, + "gmmSigmaScaling": 0.85, "valueFormat": "POISSON_PROBABILITY", "customImls": { "PGA": [0.0025, 0.0075, 0.0169, 0.0380, 0.0854, 0.192, 0.432, 0.973, 2.19, 4.92]