diff --git a/src/main/java/gov/usgs/earthquake/nshmp/DisaggCalc.java b/src/main/java/gov/usgs/earthquake/nshmp/DisaggCalc.java index b54668199f1745ef42b6b2ac17a116fb8efb7ec7..9d9087042cfb6043df301e903a6f9dd2a9f4f6b8 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/DisaggCalc.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/DisaggCalc.java @@ -52,6 +52,7 @@ import gov.usgs.earthquake.nshmp.data.XySequence; import gov.usgs.earthquake.nshmp.gmm.Imt; import gov.usgs.earthquake.nshmp.internal.Logging; import gov.usgs.earthquake.nshmp.model.HazardModel; +import gov.usgs.earthquake.nshmp.model.SiteData; /** * Disaggregate probabilistic seismic hazard at a return period of interest or @@ -165,7 +166,10 @@ public class DisaggCalc { : OptionalDouble.empty(); /* Sites */ - List<Site> sites = Sites.fromCsv(siteFile, model.siteData(), vs30); + SiteData siteData = config.hazard.useSiteData + ? model.siteData() + : SiteData.EMPTY; + List<Site> sites = Sites.fromCsv(siteFile, siteData, vs30); log.info("Sites: " + sites.size()); Set<Imt> modelImts = model.config().hazard.imts; @@ -288,7 +292,8 @@ public class DisaggCalc { log.info(PROGRAM + " (return period): calculating ..."); - HazardExport handler = HazardExport.create(model, config, sites, out); + boolean namedSites = sites.get(0).name() != Site.NO_NAME; + HazardExport handler = HazardExport.create(model, config, namedSites, out); Path disaggDir = out.resolve("disagg"); Files.createDirectory(disaggDir); diff --git a/src/main/java/gov/usgs/earthquake/nshmp/HazardCalc.java b/src/main/java/gov/usgs/earthquake/nshmp/HazardCalc.java index d893b3a1cde014bdef1c675e5de203311111e237..6b26713efa45c0f9ef41397843d231e1237b7396 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/HazardCalc.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/HazardCalc.java @@ -110,10 +110,13 @@ public class HazardCalc { log.info(""); Path out = createOutputDir(config.output.directory); + SiteData siteData = config.hazard.useSiteData + ? model.siteData() + : SiteData.EMPTY; if (config.hazard.vs30s.isEmpty()) { - List<Site> sites = readSites(args[1], model.siteData(), OptionalDouble.empty(), log); + List<Site> sites = readSites(args[1], siteData, OptionalDouble.empty(), log); log.info("Sites: " + Sites.toString(sites)); calc(model, config, sites, out, log); @@ -121,7 +124,7 @@ public class HazardCalc { for (double vs30 : config.hazard.vs30s) { log.info("Vs30 batch: " + vs30); - List<Site> sites = readSites(args[1], model.siteData(), OptionalDouble.of(vs30), log); + List<Site> sites = readSites(args[1], siteData, OptionalDouble.of(vs30), log); log.info("Sites: " + Sites.toString(sites)); Path vs30dir = out.resolve("vs30-" + ((int) vs30)); Files.createDirectory(vs30dir); @@ -183,7 +186,8 @@ public class HazardCalc { log.info("Threads: " + ((ThreadPoolExecutor) exec).getCorePoolSize()); log.info(PROGRAM + ": calculating ..."); - HazardExport handler = HazardExport.create(model, config, sites, out); + boolean namedSites = sites.get(0).name() != Site.NO_NAME; + HazardExport handler = HazardExport.create(model, config, namedSites, out); Stopwatch stopwatch = Stopwatch.createStarted(); int logInterval = sites.size() < 100 ? 1 : sites.size() < 1000 ? 10 : 100;