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 90260a12d31f96041b6d4d593f7d1937c71f5b61..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; @@ -197,14 +198,24 @@ public final class CalcConfig { */ public final Set<SourceType> sourceTypes; + /** + * The set of Vs30s (average shear-wave velocity down to 30 meters depth) + * for which calculations should be performed. If empty or {@code null} in a + * config file, then Vs30 will be derived from a users site file or the + * {@link SiteDefaults#vs30} value. + * + * <p><b>Default:</b> [] + */ + public final Set<Double> vs30s; + /** * Viscous damping ratio. The default value is consistent with that used in * {@link GroundMotionModel} most (GMM) development. Values other than 5% * will apply a damping scale factor (DSF) to adjust the 5% damped spectral * ordinates predicted by GMMs. * - * <p><b>Default:</b> {@code 5.0%}<br><b>Range:</b> {@code 0.5%} to - * {@code 30.0%} + * <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 @@ -216,11 +227,13 @@ public final class CalcConfig { public final double gmmDampingRatio; /** - * Whether or not {@link GroundMotionModel} (GMM) sigmas are also modified - * according to the Rezaeian et al. (2014) model when applying damping - * scaling factors (DSF). + * 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 boolean gmmDampingSigma; + public final double gmmSigmaScaling; /** * The value format for hazard curves. @@ -241,8 +254,9 @@ public final class CalcConfig { this.imts = b.imts; this.tectonicSettings = b.tectonicSettings; this.sourceTypes = b.sourceTypes; + this.vs30s = b.vs30s; this.gmmDampingRatio = b.gmmDampingRatio; - this.gmmDampingSigma = b.gmmDampingSigma; + this.gmmSigmaScaling = b.gmmSigmaScaling; this.valueFormat = b.valueFormat; this.customImls = b.customImls; @@ -282,8 +296,9 @@ public final class CalcConfig { Set<Imt> imts; Set<TectonicSetting> tectonicSettings; Set<SourceType> sourceTypes; + Set<Double> vs30s; Double gmmDampingRatio; - Boolean gmmDampingSigma; + Double gmmSigmaScaling; ValueFormat valueFormat; Map<Imt, double[]> customImls; Map<Imt, XySequence> curveMap; @@ -296,12 +311,17 @@ public final class CalcConfig { checkNotNull(imts); checkNotNull(tectonicSettings); checkNotNull(sourceTypes); + checkNotNull(vs30s); checkNotNull(gmmDampingRatio); checkInRange( RezaeianDamping_2014.DAMPING_RATIO_RANGE, "gmmDampingRatio", gmmDampingRatio); - checkNotNull(gmmDampingSigma); + checkNotNull(gmmSigmaScaling); + checkInRange( + Range.closed(0.5, 1.0), + "gmmSigmaScaling", + gmmSigmaScaling); checkNotNull(valueFormat); checkNotNull(customImls); return new Hazard(this); @@ -313,8 +333,9 @@ public final class CalcConfig { this.imts = that.imts; this.tectonicSettings = that.tectonicSettings; this.sourceTypes = that.sourceTypes; + this.vs30s = that.vs30s; this.gmmDampingRatio = that.gmmDampingRatio; - this.gmmDampingSigma = that.gmmDampingSigma; + this.gmmSigmaScaling = that.gmmSigmaScaling; this.valueFormat = that.valueFormat; this.customImls = that.customImls; } @@ -335,12 +356,15 @@ public final class CalcConfig { if (that.sourceTypes != null) { this.sourceTypes = that.sourceTypes; } - if (that.gmmDampingSigma != null) { - this.gmmDampingSigma = that.gmmDampingSigma; + if (that.vs30s != null) { + this.vs30s = that.vs30s; } 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/java/gov/usgs/earthquake/nshmp/gmm/RezaeianDamping_2014.java b/src/main/java/gov/usgs/earthquake/nshmp/gmm/RezaeianDamping_2014.java index bc12518c60a9fc68d65c66671749c0288da1f123..ef95722585f2c2f5299ab2311ad69764dbec9c22 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/gmm/RezaeianDamping_2014.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/gmm/RezaeianDamping_2014.java @@ -82,11 +82,11 @@ public class RezaeianDamping_2014 { } /** - * The range of damping ratios supported by this model: {@code [0.5..30.0]}. + * The range of damping ratios supported by this model: {@code [0.05..0.3]}. */ public static final Range<Double> DAMPING_RATIO_RANGE = Range.closed( - CORR_COEFF_DSFS.get(0), - CORR_COEFF_DSFS.get(CORR_COEFF_DSFS.size() - 1)); + 0.005, // CORR_COEFF_DSFS.get(0), + 0.3); // CORR_COEFF_DSFS.get(CORR_COEFF_DSFS.size() - 1)); /** * The GMMs supported by this model. Currently the Rezaien et al. (2014) model @@ -144,8 +144,8 @@ public class RezaeianDamping_2014 { private final boolean updateSigma; RezaeianDamping_2014(CalcConfig config) { - dampingRatio = config.hazard.gmmDampingRatio; - updateSigma = config.hazard.gmmDampingSigma; + dampingRatio = config.hazard.gmmDampingRatio * 100.0; + updateSigma = false; // config.hazard.gmmDampingSigma; } /** diff --git a/src/main/resources/calc/calc-config-defaults.json b/src/main/resources/calc/calc-config-defaults.json index 3e729803a604502d9c7824c73125536c78cdc767..2de807379fd6a2b2c1b9d511d23ac232028539a3 100644 --- a/src/main/resources/calc/calc-config-defaults.json +++ b/src/main/resources/calc/calc-config-defaults.json @@ -11,8 +11,9 @@ ], "tectonicSettings": [], "sourceTypes": [], - "gmmDampingRatio": 5.0, - "gmmDampingSigma": false, + "vs30s": [], + "gmmDampingRatio": 0.05, + "gmmSigmaScaling": 1.0, "valueFormat": "ANNUAL_RATE", "customImls": {} }, @@ -57,7 +58,7 @@ "TOTAL", "MAP" ], - "returnPeriods": [475, 975, 2475] + "returnPeriods": [475, 975, 2475, 10000] }, "performance": { "optimizeGrids": true, 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 079bab5e9cc6fb78352f90037d18f212cf3f5614..91bafd901a32df139f352a673a5dd73cfb67eb7d 100644 --- a/src/test/java/gov/usgs/earthquake/nshmp/calc/CalcConfigTests.java +++ b/src/test/java/gov/usgs/earthquake/nshmp/calc/CalcConfigTests.java @@ -127,8 +127,7 @@ class CalcConfigTests { assertEquals(IMTS, def.imts); assertEquals(EnumSet.noneOf(TectonicSetting.class), def.tectonicSettings); assertEquals(EnumSet.noneOf(SourceType.class), def.tectonicSettings); - assertEquals(5.0, def.gmmDampingRatio); - assertEquals(false, def.gmmDampingSigma); + assertEquals(0.05, def.gmmDampingRatio); assertEquals(ValueFormat.ANNUAL_RATE, def.valueFormat); Map<Imt, XySequence> imlMap = def.modelCurves(); @@ -248,8 +247,9 @@ class CalcConfigTests { assertEquals(IMTS_EXTENDS, def.imts); assertEquals(EnumSet.of(ACTIVE_CRUST, SUBDUCTION), def.tectonicSettings); assertEquals(EnumSet.of(FAULT, ZONE, SLAB), def.sourceTypes); - assertEquals(3.0, def.gmmDampingRatio); - assertEquals(true, def.gmmDampingSigma); + 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( @@ -262,8 +262,9 @@ class CalcConfigTests { assertEquals(IMTS, def.imts); assertEquals(EnumSet.noneOf(TectonicSetting.class), def.tectonicSettings); assertEquals(EnumSet.noneOf(SourceType.class), def.tectonicSettings); - assertEquals(5.0, def.gmmDampingRatio); - assertEquals(false, def.gmmDampingSigma); + assertEquals(Set.of(), def.vs30s); + assertEquals(0.05, def.gmmDampingRatio); + assertEquals(1.0, def.gmmSigmaScaling); assertEquals(ValueFormat.ANNUAL_RATE, def.valueFormat); } @@ -352,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 af22fd3d95c59699bd99e1e0a004d1d995a7557c..63a1758e405c11b2bd3c2997d1815c4c60bcea57 100644 --- a/src/test/resources/calc/calc-config-extends.json +++ b/src/test/resources/calc/calc-config-extends.json @@ -7,8 +7,9 @@ ], "tectonicSettings": [ "ACTIVE_CRUST", "SUBDUCTION" ], "sourceTypes": [ "FAULT", "ZONE", "SLAB" ], - "gmmDampingRatio": 3.0, - "gmmDampingSigma": true, + "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]