Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #23 from gem/gmpe-bug

[r=arbeit][f=1023419]

fixes bug in toro et al 2002 for periods equal to 3 and 4 s
  • Loading branch information...
commit 8d8988135f77a4444c5b1d55caf31ef89d193dc4 2 parents 5c0c714 + 76da55a
@arbeit arbeit authored
View
6 java/org/opensha/sha/imr/attenRelImpl/Campbell_2003_SHARE_AttenRel.java
@@ -126,7 +126,7 @@ public double getMean(int iper, double mag, double rRup, double rake) {
f[0] = 1.0;
f[1] = 0.0;
f[2] = f[0]
- * Math.pow(AdjustFactorsSHARE.Frss[iper],
+ * Math.pow(AdjustFactorsSHARE.Frss_CAMPBELL2003[iper],
(1 - AdjustFactorsSHARE.pR))
* Math.pow(AdjustFactorsSHARE.Fnss, -AdjustFactorsSHARE.pN);
} else if (rake > AdjustFactorsSHARE.FLT_TYPE_REVERSE_RAKE_LOWER
@@ -134,14 +134,14 @@ public double getMean(int iper, double mag, double rRup, double rake) {
f[0] = 0.0;
f[1] = 1.0;
f[2] = f[1]
- * Math.pow(AdjustFactorsSHARE.Frss[iper],
+ * Math.pow(AdjustFactorsSHARE.Frss_CAMPBELL2003[iper],
-AdjustFactorsSHARE.pR)
* Math.pow(AdjustFactorsSHARE.Fnss,
(1 - AdjustFactorsSHARE.pN));
} else {
f[0] = 0.0;
f[1] = 0.0;
- f[2] = Math.pow(AdjustFactorsSHARE.Frss[iper],
+ f[2] = Math.pow(AdjustFactorsSHARE.Frss_CAMPBELL2003[iper],
-AdjustFactorsSHARE.pR)
* Math.pow(AdjustFactorsSHARE.Fnss, -AdjustFactorsSHARE.pN);
}
View
6 java/org/opensha/sha/imr/attenRelImpl/ToroEtAl_2002_SHARE_AttenRel.java
@@ -133,7 +133,7 @@ public double getMean(int iper, double mag, double rJB, double rake) {
f[0] = 1.0;
f[1] = 0.0;
f[2] = f[0]
- * Math.pow(AdjustFactorsSHARE.Frss[iper],
+ * Math.pow(AdjustFactorsSHARE.Frss_TORO2002[iper],
(1 - AdjustFactorsSHARE.pR))
* Math.pow(AdjustFactorsSHARE.Fnss,
-AdjustFactorsSHARE.pN);
@@ -142,14 +142,14 @@ public double getMean(int iper, double mag, double rJB, double rake) {
f[0] = 0.0;
f[1] = 1.0;
f[2] = f[1]
- * Math.pow(AdjustFactorsSHARE.Frss[iper],
+ * Math.pow(AdjustFactorsSHARE.Frss_TORO2002[iper],
-AdjustFactorsSHARE.pR)
* Math.pow(AdjustFactorsSHARE.Fnss,
(1 - AdjustFactorsSHARE.pN));
} else {
f[0] = 0.0;
f[1] = 0.0;
- f[2] = Math.pow(AdjustFactorsSHARE.Frss[iper],
+ f[2] = Math.pow(AdjustFactorsSHARE.Frss_TORO2002[iper],
-AdjustFactorsSHARE.pR)
* Math.pow(AdjustFactorsSHARE.Fnss,
-AdjustFactorsSHARE.pN);
View
12 java/org/opensha/sha/imr/attenRelImpl/constants/AdjustFactorsSHARE.java
@@ -10,7 +10,7 @@
*/
public static final double[] AFrock_TORO2002 = { 0.735106, 0.419632,
0.477379, 0.888509, 1.197291, 1.308267, 1.30118, 1.265762,
- 1.215779};
+ 1.215779, 1.215779, 1.215779};
public static final double[] AFrock_CAMPBELL2003 = { 0.735106, 0.474275,
0.423049, 0.550323, 0.730061, 0.888509, 1.094622, 1.197291,
@@ -25,7 +25,7 @@
*/
public static final double[] sig_AFrock_TORO2002 = { 0.338916, 0.289785,
0.320650, 0.352442, 0.281552, 0.198424, 0.1910745, 0.154327,
- 0.155520};
+ 0.155520, 0.155520, 0.155520};
public static final double[] sig_AFrock_CAMBPELL2003 = { 0.338916,
0.283461, 0.289785, 0.345375, 0.365490, 0.352442, 0.315477,
@@ -35,7 +35,11 @@
* Style-of-faulting adjustment coefficients, obtained from Table 7 (Drouet
* et al 2010) and using a cubic spline interpolation
*/
- public static final double[] Frss = { 1.220000, 1.080745, 0.986646,
+ public static final double[] Frss_TORO2002 = {1.220000, 0.935198, 0.907936,
+ 1.080000, 1.190000, 1.230000, 1.230000, 1.177500, 1.140000, 1.140000,
+ 1.140000};
+
+ public static final double[] Frss_CAMPBELL2003 = { 1.220000, 1.080745, 0.986646,
0.931209, 0.910332, 0.985998, 1.080000, 1.150000, 1.190000,
1.230000, 1.191702, 1.177500, 1.194705, 1.140000, 1.140000,
1.140000 };
@@ -66,7 +70,7 @@
public static void main(String[] args) {
System.out.println(AFrock_TORO2002.length);
System.out.println(sig_AFrock_TORO2002.length);
- System.out.println(Frss.length);
+ System.out.println(Frss_CAMPBELL2003.length);
}
}
View
42 java_tests/org/opensha/sha/imr/attenRelImpl/test/ToroEtAl_2002_SHARE_test.java
@@ -140,6 +140,48 @@ public void checkSetPeriodIndexGetStd(){
assertTrue(toro2002SHARE.getStdDev()==
toro2002SHARE.getStdDev(iper, mag, rJB, stdDevType));
}
+
+ /**
+ * Check SA at T = 3 s
+ */
+ @Test
+ public final void sa3s(){
+ double mag = 5.0;
+ double rJB = 10.0;
+ double rake = 0.0;
+ double period = 3.0;
+ String stdDevType = StdDevTypeParam.STD_DEV_TYPE_TOTAL;
+ int iper = ArrayUtils.indexOf(ToroEtAl2002Constants.PERIOD,period);
+ toro2002SHARE.getParameter(MagParam.NAME).setValue(mag);
+ toro2002SHARE.getParameter(DistanceJBParameter.NAME).setValue(rJB);
+ toro2002SHARE.getParameter(RakeParam.NAME).setValue(rake);
+ toro2002SHARE.getParameter(PeriodParam.NAME).setValue(period);
+ toro2002SHARE.getParameter(StdDevTypeParam.NAME).setValue(stdDevType);
+ toro2002SHARE.setIntensityMeasure(SA_Param.NAME);
+ assertTrue(toro2002SHARE.getStdDev()==
+ toro2002SHARE.getStdDev(iper, mag, rJB, stdDevType));
+ }
+
+ /**
+ * Check SA at T = 4 s
+ */
+ @Test
+ public final void sa4s(){
+ double mag = 5.0;
+ double rJB = 10.0;
+ double rake = 0.0;
+ double period = 4.0;
+ String stdDevType = StdDevTypeParam.STD_DEV_TYPE_TOTAL;
+ int iper = ArrayUtils.indexOf(ToroEtAl2002Constants.PERIOD,period);
+ toro2002SHARE.getParameter(MagParam.NAME).setValue(mag);
+ toro2002SHARE.getParameter(DistanceJBParameter.NAME).setValue(rJB);
+ toro2002SHARE.getParameter(RakeParam.NAME).setValue(rake);
+ toro2002SHARE.getParameter(PeriodParam.NAME).setValue(period);
+ toro2002SHARE.getParameter(StdDevTypeParam.NAME).setValue(stdDevType);
+ toro2002SHARE.setIntensityMeasure(SA_Param.NAME);
+ assertTrue(toro2002SHARE.getStdDev()==
+ toro2002SHARE.getStdDev(iper, mag, rJB, stdDevType));
+ }
private void validateMedian(double rake, double[][] table) {
String[] columnDescr = TABLE_HEADER_MEDIAN[0].trim().split("\\s+");

0 comments on commit 8d89881

Please sign in to comment.
Something went wrong with that request. Please try again.