Skip to content

Commit

Permalink
Merge pull request #265 from pmpowers-usgs/gmm-id-naming-260
Browse files Browse the repository at this point in the history
Gmm id naming 260
  • Loading branch information
pmpowers-usgs authored Nov 15, 2017
2 parents 072f57f + 493ea09 commit 6786c25
Show file tree
Hide file tree
Showing 10 changed files with 2,158 additions and 2,154 deletions.
34 changes: 19 additions & 15 deletions src/gov/usgs/earthquake/nshmp/gmm/AtkinsonBoore_2003.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
* <p><b>Component:</b> horizontal (not clear from publication)
*
* @author Peter Powers
* @see Gmm#AB_03_CASC_INTER
* @see Gmm#AB_03_CASC_SLAB
* @see Gmm#AB_03_CASC_SLAB_LOW_SAT
* @see Gmm#AB_03_GLOB_INTER
* @see Gmm#AB_03_GLOB_SLAB
* @see Gmm#AB_03_GLOB_SLAB_LOW_SAT
* @see Gmm#AB_03_CASCADIA_INTERFACE
* @see Gmm#AB_03_CASCADIA_SLAB
* @see Gmm#AB_03_CASCADIA_SLAB_LOW_SAT
* @see Gmm#AB_03_GLOBAL_INTERFACE
* @see Gmm#AB_03_GLOBAL_SLAB
* @see Gmm#AB_03_GLOBAL_SLAB_LOW_SAT
*/
public abstract class AtkinsonBoore_2003 implements GroundMotionModel {

Expand All @@ -63,14 +63,14 @@ public abstract class AtkinsonBoore_2003 implements GroundMotionModel {
.set(VS30, Range.closed(150.0, 1500.0))
.build();

static final CoefficientContainer COEFFS_CASC_SLAB,
COEFFS_CASC_INTERFACE,
COEFFS_GLOBAL_SLAB,
COEFFS_GLOBAL_INTERFACE;
static final CoefficientContainer COEFFS_CASCADIA_SLAB;
static final CoefficientContainer COEFFS_CASCADIA_INTERFACE;
static final CoefficientContainer COEFFS_GLOBAL_SLAB;
static final CoefficientContainer COEFFS_GLOBAL_INTERFACE;

static {
COEFFS_CASC_SLAB = new CoefficientContainer("AB03_cascadia_slab.csv");
COEFFS_CASC_INTERFACE = new CoefficientContainer("AB03_cascadia_interface.csv");
COEFFS_CASCADIA_SLAB = new CoefficientContainer("AB03_cascadia_slab.csv");
COEFFS_CASCADIA_INTERFACE = new CoefficientContainer("AB03_cascadia_interface.csv");
COEFFS_GLOBAL_SLAB = new CoefficientContainer("AB03_global_slab.csv");
COEFFS_GLOBAL_INTERFACE = new CoefficientContainer("AB03_global_interface.csv");
}
Expand Down Expand Up @@ -104,10 +104,14 @@ private static final class Coefficients {
mMax = saturationMw();
}

private static Coefficients initCoeffs(final Imt imt, final boolean slab,
private static Coefficients initCoeffs(
final Imt imt,
final boolean slab,
final boolean global) {
CoefficientContainer coeffs = slab && global ? COEFFS_GLOBAL_SLAB : slab ? COEFFS_CASC_SLAB
: global ? COEFFS_GLOBAL_INTERFACE : COEFFS_CASC_INTERFACE;

CoefficientContainer coeffs =
slab && global ? COEFFS_GLOBAL_SLAB : slab ? COEFFS_CASCADIA_SLAB
: global ? COEFFS_GLOBAL_INTERFACE : COEFFS_CASCADIA_INTERFACE;
return new Coefficients(imt, coeffs);
}

Expand Down
2 changes: 1 addition & 1 deletion src/gov/usgs/earthquake/nshmp/gmm/AtkinsonMacias_2009.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* <p><b>Component:</b> geometric mean of two horizontal components
*
* @author Peter Powers
* @see Gmm#AM_09_INTER
* @see Gmm#AM_09_INTERFACE
* @see Gmm#AM_09_BASIN_INTERFACE
*/
public class AtkinsonMacias_2009 implements GroundMotionModel {
Expand Down
2 changes: 1 addition & 1 deletion src/gov/usgs/earthquake/nshmp/gmm/BcHydro_2012.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* <p><b>Component:</b> Geometric mean of two horizontal components
*
* @author Peter Powers
* @see Gmm#BCHYDRO_12_INTER
* @see Gmm#BCHYDRO_12_INTERFACE
* @see Gmm#BCHYDRO_12_SLAB
* @see Gmm#BCHYDRO_12_BASIN_INTERFACE
* @see Gmm#BCHYDRO_12_BASIN_SLAB
Expand Down
54 changes: 27 additions & 27 deletions src/gov/usgs/earthquake/nshmp/gmm/Gmm.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,49 +165,49 @@ public enum Gmm {
/* Subduction Interface and Slab WUS 2008 2014 2018, AK 2007 */

/** @see AtkinsonBoore_2003 */
AB_03_GLOB_INTER(
AB_03_GLOBAL_INTERFACE(
AtkinsonBoore_2003.GlobalInterface.class,
AtkinsonBoore_2003.GlobalInterface.NAME,
AtkinsonBoore_2003.COEFFS_GLOBAL_INTERFACE,
AtkinsonBoore_2003.CONSTRAINTS),

/** @see AtkinsonBoore_2003 */
AB_03_GLOB_SLAB(
AB_03_GLOBAL_SLAB(
AtkinsonBoore_2003.GlobalSlab.class,
AtkinsonBoore_2003.GlobalSlab.NAME,
AtkinsonBoore_2003.COEFFS_GLOBAL_SLAB,
AtkinsonBoore_2003.CONSTRAINTS),

/** @see AtkinsonBoore_2003 */
AB_03_GLOB_SLAB_LOW_SAT(
AB_03_GLOBAL_SLAB_LOW_SAT(
AtkinsonBoore_2003.GlobalSlabLowMagSaturation.class,
AtkinsonBoore_2003.GlobalSlabLowMagSaturation.NAME,
AtkinsonBoore_2003.COEFFS_GLOBAL_SLAB,
AtkinsonBoore_2003.CONSTRAINTS),

/** @see AtkinsonBoore_2003 */
AB_03_CASC_INTER(
AB_03_CASCADIA_INTERFACE(
AtkinsonBoore_2003.CascadiaInterface.class,
AtkinsonBoore_2003.CascadiaInterface.NAME,
AtkinsonBoore_2003.COEFFS_CASC_INTERFACE,
AtkinsonBoore_2003.COEFFS_CASCADIA_INTERFACE,
AtkinsonBoore_2003.CONSTRAINTS),

/** @see AtkinsonBoore_2003 */
AB_03_CASC_SLAB(
AB_03_CASCADIA_SLAB(
AtkinsonBoore_2003.CascadiaSlab.class,
AtkinsonBoore_2003.CascadiaSlab.NAME,
AtkinsonBoore_2003.COEFFS_CASC_SLAB,
AtkinsonBoore_2003.COEFFS_CASCADIA_SLAB,
AtkinsonBoore_2003.CONSTRAINTS),

/** @see AtkinsonBoore_2003 */
AB_03_CASC_SLAB_LOW_SAT(
AB_03_CASCADIA_SLAB_LOW_SAT(
AtkinsonBoore_2003.CascadiaSlabLowMagSaturation.class,
AtkinsonBoore_2003.CascadiaSlabLowMagSaturation.NAME,
AtkinsonBoore_2003.COEFFS_CASC_SLAB,
AtkinsonBoore_2003.COEFFS_CASCADIA_SLAB,
AtkinsonBoore_2003.CONSTRAINTS),

/** @see AtkinsonMacias_2009 */
AM_09_INTER(
AM_09_INTERFACE(
AtkinsonMacias_2009.class,
AtkinsonMacias_2009.NAME,
AtkinsonMacias_2009.COEFFS,
Expand All @@ -221,7 +221,7 @@ public enum Gmm {
AtkinsonMacias_2009.CONSTRAINTS),

/** @see BcHydro_2012 */
BCHYDRO_12_INTER(
BCHYDRO_12_INTERFACE(
BcHydro_2012.Interface.class,
BcHydro_2012.Interface.NAME,
BcHydro_2012.COEFFS,
Expand Down Expand Up @@ -249,7 +249,7 @@ public enum Gmm {
BcHydro_2012.CONSTRAINTS),

/** @see YoungsEtAl_1997 */
YOUNGS_97_INTER(
YOUNGS_97_INTERFACE(
YoungsEtAl_1997.Interface.class,
YoungsEtAl_1997.Interface.NAME,
YoungsEtAl_1997.COEFFS,
Expand All @@ -263,7 +263,7 @@ public enum Gmm {
YoungsEtAl_1997.CONSTRAINTS),

/** @see ZhaoEtAl_2006 */
ZHAO_06_INTER(
ZHAO_06_INTERFACE(
ZhaoEtAl_2006.Interface.class,
ZhaoEtAl_2006.Interface.NAME,
ZhaoEtAl_2006.COEFFS,
Expand Down Expand Up @@ -1004,10 +1004,10 @@ public enum Group {
WUS_14_INTERFACE(
"2014 Subduction Interface (WUS)",
ImmutableList.of(
AB_03_GLOB_INTER,
AM_09_INTER,
BCHYDRO_12_INTER,
ZHAO_06_INTER)),
AB_03_GLOBAL_INTERFACE,
AM_09_INTERFACE,
BCHYDRO_12_INTERFACE,
ZHAO_06_INTERFACE)),

WUS_18_INTERFACE(
"2018 Subduction Interface (WUS) beta",
Expand All @@ -1019,8 +1019,8 @@ public enum Group {
WUS_14_SLAB(
"2014 Subduction Intraslab (WUS)",
ImmutableList.of(
AB_03_CASC_SLAB_LOW_SAT,
AB_03_GLOB_SLAB_LOW_SAT,
AB_03_CASCADIA_SLAB_LOW_SAT,
AB_03_GLOBAL_SLAB_LOW_SAT,
BCHYDRO_12_SLAB,
ZHAO_06_SLAB)),

Expand Down Expand Up @@ -1052,15 +1052,15 @@ public enum Group {
WUS_08_INTERFACE(
"2008 Subduction Interface (WUS)",
ImmutableList.of(
AB_03_GLOB_INTER,
YOUNGS_97_INTER,
ZHAO_06_INTER)),
AB_03_GLOBAL_INTERFACE,
YOUNGS_97_INTERFACE,
ZHAO_06_INTERFACE)),

WUS_08_SLAB(
"2008 Subduction Intraslab (WUS)",
ImmutableList.of(
AB_03_CASC_SLAB,
AB_03_GLOB_SLAB,
AB_03_CASCADIA_SLAB,
AB_03_GLOBAL_SLAB,
YOUNGS_97_SLAB)),

AK_07_ACTIVE_CRUST(
Expand All @@ -1074,14 +1074,14 @@ public enum Group {
AK_07_INTERFACE(
"2007 Subduction Interface (AK)",
ImmutableList.of(
YOUNGS_97_INTER,
YOUNGS_97_INTERFACE,
SADIGH_97)),

AK_07_SLAB(
"2007 Subduction Intraslab (AK)",
ImmutableList.of(
YOUNGS_97_SLAB,
AB_03_GLOB_SLAB)),
AB_03_GLOBAL_SLAB)),

HI_98(
"1998 Active Volcanic (HI)",
Expand All @@ -1103,7 +1103,7 @@ public enum Group {
ZHAO_16_SLAB,
ATKINSON_10,
ATKINSON_15,
AB_03_CASC_INTER,
AB_03_CASCADIA_INTERFACE,
MCVERRY_00_CRUSTAL,
MCVERRY_00_INTERFACE,
MCVERRY_00_SLAB,
Expand Down
2 changes: 1 addition & 1 deletion src/gov/usgs/earthquake/nshmp/gmm/YoungsEtAl_1997.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* <p><b>Component:</b> Geometric mean of two horizontal components
*
* @author Peter Powers
* @see Gmm#YOUNGS_97_INTER
* @see Gmm#YOUNGS_97_INTERFACE
* @see Gmm#YOUNGS_97_SLAB
*/
public abstract class YoungsEtAl_1997 implements GroundMotionModel {
Expand Down
2 changes: 1 addition & 1 deletion src/gov/usgs/earthquake/nshmp/gmm/ZhaoEtAl_2006.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
* <p><b>Component:</b> Geometric mean of two horizontal components
*
* @author Peter Powers
* @see Gmm#ZHAO_06_INTER
* @see Gmm#ZHAO_06_INTERFACE
* @see Gmm#ZHAO_06_SLAB
* @see Gmm#ZHAO_06_BASIN_INTERFACE
* @see Gmm#ZHAO_06_BASIN_SLAB
Expand Down
24 changes: 12 additions & 12 deletions test/gov/usgs/earthquake/nshmp/gmm/SubInterface.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package gov.usgs.earthquake.nshmp.gmm;

import static gov.usgs.earthquake.nshmp.gmm.Gmm.AB_03_CASC_INTER;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.AB_03_GLOB_INTER;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.AM_09_INTER;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.BCHYDRO_12_INTER;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.YOUNGS_97_INTER;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.ZHAO_06_INTER;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.AB_03_CASCADIA_INTERFACE;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.AB_03_GLOBAL_INTERFACE;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.AM_09_INTERFACE;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.BCHYDRO_12_INTERFACE;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.YOUNGS_97_INTERFACE;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.ZHAO_06_INTERFACE;
import static gov.usgs.earthquake.nshmp.gmm.Imt.PGA;
import static gov.usgs.earthquake.nshmp.gmm.Imt.SA0P2;
import static gov.usgs.earthquake.nshmp.gmm.Imt.SA1P0;
Expand Down Expand Up @@ -51,12 +51,12 @@ public SubInterface(int index, Gmm gmm, Imt imt, double exMedian, double exSigma

/* Result generation sets */
private static Set<Gmm> gmms = EnumSet.of(
AB_03_GLOB_INTER,
AB_03_CASC_INTER,
AM_09_INTER,
BCHYDRO_12_INTER,
YOUNGS_97_INTER,
ZHAO_06_INTER);
AB_03_GLOBAL_INTERFACE,
AB_03_CASCADIA_INTERFACE,
AM_09_INTERFACE,
BCHYDRO_12_INTERFACE,
YOUNGS_97_INTERFACE,
ZHAO_06_INTERFACE);

private static Set<Imt> imts = EnumSet.of(
PGA,
Expand Down
16 changes: 8 additions & 8 deletions test/gov/usgs/earthquake/nshmp/gmm/SubSlab.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package gov.usgs.earthquake.nshmp.gmm;

import static gov.usgs.earthquake.nshmp.gmm.Gmm.AB_03_CASC_SLAB;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.AB_03_CASC_SLAB_LOW_SAT;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.AB_03_GLOB_SLAB;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.AB_03_GLOB_SLAB_LOW_SAT;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.AB_03_CASCADIA_SLAB;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.AB_03_CASCADIA_SLAB_LOW_SAT;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.AB_03_GLOBAL_SLAB;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.AB_03_GLOBAL_SLAB_LOW_SAT;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.BCHYDRO_12_SLAB;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.YOUNGS_97_SLAB;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.ZHAO_06_SLAB;
Expand Down Expand Up @@ -52,10 +52,10 @@ public SubSlab(int index, Gmm gmm, Imt imt, double exMedian, double exSigma) {

/* Result generation sets */
private static Set<Gmm> gmms = EnumSet.of(
AB_03_GLOB_SLAB,
AB_03_GLOB_SLAB_LOW_SAT,
AB_03_CASC_SLAB,
AB_03_CASC_SLAB_LOW_SAT,
AB_03_GLOBAL_SLAB,
AB_03_GLOBAL_SLAB_LOW_SAT,
AB_03_CASCADIA_SLAB,
AB_03_CASCADIA_SLAB_LOW_SAT,
BCHYDRO_12_SLAB,
YOUNGS_97_SLAB,
ZHAO_06_SLAB);
Expand Down
Loading

0 comments on commit 6786c25

Please sign in to comment.