diff --git a/src/test/java/gov/usgs/earthquake/nshmp/model/NshmTestUtils.java b/src/test/java/gov/usgs/earthquake/nshmp/model/NshmTestUtils.java index 89852afa2adca428b55a8c4d794d7ad655cd53c1..cd30056e83da80158be2505b0940301775e85326 100644 --- a/src/test/java/gov/usgs/earthquake/nshmp/model/NshmTestUtils.java +++ b/src/test/java/gov/usgs/earthquake/nshmp/model/NshmTestUtils.java @@ -15,6 +15,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Optional; +import java.util.OptionalDouble; import java.util.Set; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; @@ -35,6 +36,7 @@ import gov.usgs.earthquake.nshmp.calc.CalcConfig; import gov.usgs.earthquake.nshmp.calc.Hazard; import gov.usgs.earthquake.nshmp.calc.HazardCalcs; import gov.usgs.earthquake.nshmp.calc.Site; +import gov.usgs.earthquake.nshmp.calc.Sites; import gov.usgs.earthquake.nshmp.data.XySequence; import gov.usgs.earthquake.nshmp.geo.Location; import gov.usgs.earthquake.nshmp.gmm.Imt; @@ -220,9 +222,10 @@ class NshmTestUtils { NshmModel nshmModel, NamedLocation location) { - Site site = createSite( + Site site = Sites.locationToSite( location.location(), - nshmModel.model.siteData()); + nshmModel.model.siteData(), + OptionalDouble.empty()); CalcConfig config = CalcConfig.copyOf(nshmModel.model.config()) .imts(nshmModel.nshm.imts()) @@ -279,16 +282,6 @@ class NshmTestUtils { Files.write(resultPath, json.getBytes()); } - private static Site createSite(Location loc, SiteData siteData) { - Site.Builder builder = Site.builder().location(loc); - SiteData.Values values = siteData.get(loc); - values.z1p0.ifPresent(builder::z1p0); - values.z2p5.ifPresent(builder::z2p5); - values.zSed.ifPresent(builder::zSed); - builder.gmmTrees(values.gmmTrees); - return builder.build(); - } - private static class Curve { double[] xs; double[] ys;