Skip to content
Snippets Groups Projects
Commit 0a2facfd authored by Altekruse, Jason Morgan's avatar Altekruse, Jason Morgan
Browse files

added tests with preliminary results (too high)

parent 64f3c357
No related branches found
No related tags found
1 merge request!238Pezeshk18
...@@ -163,11 +163,9 @@ public abstract class PezeshkEtAl_2018 implements GroundMotionModel { ...@@ -163,11 +163,9 @@ public abstract class PezeshkEtAl_2018 implements GroundMotionModel {
} }
private double calcMean(Coefficients c, double Mw, double Rrup) { private double calcMean(Coefficients c, double Mw, double Rrup) {
if (c.imt == Imt.SA1P0) {
System.out.printf("Model %s: Mw = %.1f, Rrup = %.1f\n", c.model, Mw, Rrup);
}
/* Eq. 5 */ /* Eq. 5 */
double R = sqrt(Rrup * Rrup + c.c11 * c.c11); double R = sqrt(Rrup * Rrup + c.c11 * c.c11);
/* Eq. 4 - log10 units */ /* Eq. 4 - log10 units */
double μ = c.c1 + double μ = c.c1 +
(c.c2 * Mw) + (c.c2 * Mw) +
......
package gov.usgs.earthquake.nshmp.gmm;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.PZCT18_1SS;
import static gov.usgs.earthquake.nshmp.gmm.Gmm.PZCT18_2ES;
import java.io.IOException;
import java.util.EnumSet;
import java.util.Set;
import java.util.stream.Stream;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.ArgumentsProvider;
import org.junit.jupiter.params.provider.ArgumentsSource;
public class PezeshkEtAl_2018Tests implements ArgumentsProvider {
private static String GMM_INPUTS = "/gmm/pzct18_inputs.csv";
private static String GMM_RESULTS = "/gmm/pzct18_results.csv";
@ParameterizedTest(name = "({index}) {0} {2} {1}")
@ArgumentsSource(PezeshkEtAl_2018Tests.class)
void test(int index, Gmm gmm, Imt imt, double exMedian, double exSigma, String inputs) {
GmmTest.test(index, gmm, imt, exMedian, exSigma, inputs);
}
@Override
public Stream<? extends Arguments> provideArguments(ExtensionContext context) throws Exception {
return GmmTest.loadResults(GMM_RESULTS, GMM_INPUTS);
}
/* Result generation sets */
private static Set<Gmm> gmms = EnumSet.of(
PZCT18_1SS,
PZCT18_2ES);
private static Set<Imt> imts = PezeshkEtAl_2018.COEFFS_1SS.imts();
public static void main(String[] args) throws IOException {
GmmTest.generateResults(gmms, imts, GMM_INPUTS, GMM_RESULTS);
}
}
#Mw,rjB,rRup,rX,dip,width,zTor,zHyp,rake,vs30,vsInf,z1p0,z2p5
5.0,0,5.0,0,90,0,0,0,0,3000,0,NaN,NaN
6.0,0,5.0,0,90,0,0,0,0,3000,0,NaN,NaN
7.0,0,5.0,0,90,0,0,0,0,3000,0,NaN,NaN
8.0,0,5.0,0,90,0,0,0,0,3000,0,NaN,NaN
5.0,0,10.0,0,90,0,0,0,0,3000,0,NaN,NaN
6.0,0,10.0,0,90,0,0,0,0,3000,0,NaN,NaN
7.0,0,10.0,0,90,0,0,0,0,3000,0,NaN,NaN
8.0,0,10.0,0,90,0,0,0,0,3000,0,NaN,NaN
5.0,0,30.0,0,90,0,0,0,0,3000,0,NaN,NaN
6.0,0,30.0,0,90,0,0,0,0,3000,0,NaN,NaN
7.0,0,30.0,0,90,0,0,0,0,3000,0,NaN,NaN
8.0,0,30.0,0,90,0,0,0,0,3000,0,NaN,NaN
5.0,0,70.0,0,90,0,0,0,0,3000,0,NaN,NaN
6.0,0,70.0,0,90,0,0,0,0,3000,0,NaN,NaN
7.0,0,70.0,0,90,0,0,0,0,3000,0,NaN,NaN
8.0,0,70.0,0,90,0,0,0,0,3000,0,NaN,NaN
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment