diff --git a/src/main/java/gov/usgs/earthquake/nshmp/www/hazard/DisaggService.java b/src/main/java/gov/usgs/earthquake/nshmp/www/hazard/DisaggService.java index ee40597a027167d673b70c0c77f91d49129b4978..cb7d8f65367742447071df1a9b8c0ea0fec0e5ce 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/www/hazard/DisaggService.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/www/hazard/DisaggService.java @@ -40,7 +40,6 @@ import gov.usgs.earthquake.nshmp.www.hazard.HazardService.BaseRequest; import gov.usgs.earthquake.nshmp.www.meta.DoubleParameter; import gov.usgs.earthquake.nshmp.www.meta.Parameter; import gov.usgs.earthquake.nshmp.www.source.SourceService.SourceModel; - import io.micronaut.http.HttpRequest; import io.micronaut.http.HttpResponse; import jakarta.inject.Singleton; @@ -263,7 +262,7 @@ public final class DisaggService { this.returnPeriod = returnPeriod; this.dataTypes = dataTypes; this.imts = imts.isEmpty() - ? ServletUtil.model().config().hazard.imts + ? Gmm.supportedImts(ServletUtil.model().gmms()) : imts; } diff --git a/src/main/java/gov/usgs/earthquake/nshmp/www/hazard/HazardService.java b/src/main/java/gov/usgs/earthquake/nshmp/www/hazard/HazardService.java index d1f40f19947b4e1aaa83872ed4f60f7dc7119770..5560f6889f6a2802c27022b9b9ef22e1faeaae3f 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/www/hazard/HazardService.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/www/hazard/HazardService.java @@ -29,6 +29,7 @@ import gov.usgs.earthquake.nshmp.calc.Site; import gov.usgs.earthquake.nshmp.data.MutableXySequence; import gov.usgs.earthquake.nshmp.data.XySequence; import gov.usgs.earthquake.nshmp.geo.Location; +import gov.usgs.earthquake.nshmp.gmm.Gmm; import gov.usgs.earthquake.nshmp.gmm.Imt; import gov.usgs.earthquake.nshmp.model.HazardModel; import gov.usgs.earthquake.nshmp.model.SourceType; @@ -40,7 +41,6 @@ import gov.usgs.earthquake.nshmp.www.ServletUtil.Server; import gov.usgs.earthquake.nshmp.www.meta.DoubleParameter; import gov.usgs.earthquake.nshmp.www.meta.Parameter; import gov.usgs.earthquake.nshmp.www.source.SourceService.SourceModel; - import io.micronaut.http.HttpRequest; import io.micronaut.http.HttpResponse; import jakarta.inject.Singleton; @@ -217,7 +217,7 @@ public final class HazardService { this.truncate = truncate; this.maxdir = maxdir; this.imts = imts.isEmpty() - ? ServletUtil.model().config().hazard.imts + ? Gmm.supportedImts(ServletUtil.model().gmms()) : imts; } diff --git a/src/main/java/gov/usgs/earthquake/nshmp/www/source/SourceService.java b/src/main/java/gov/usgs/earthquake/nshmp/www/source/SourceService.java index 6534fa804265c160f9f5378d2eea2dc5ef35912e..2f496993237e358596c637f1cd6ec94440e56ce0 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/www/source/SourceService.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/www/source/SourceService.java @@ -2,10 +2,10 @@ package gov.usgs.earthquake.nshmp.www.source; import static java.util.stream.Collectors.toList; +import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.stream.DoubleStream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -18,7 +18,6 @@ import gov.usgs.earthquake.nshmp.www.ResponseBody; import gov.usgs.earthquake.nshmp.www.ResponseMetadata; import gov.usgs.earthquake.nshmp.www.ServletUtil; import gov.usgs.earthquake.nshmp.www.meta.Parameter; - import io.micronaut.http.HttpRequest; import io.micronaut.http.HttpResponse; import jakarta.inject.Singleton; @@ -78,14 +77,14 @@ public class SourceService { name = model.name(); gmms = model.gmms(); siteClasses = model.siteClasses(); - imts = model.gmms().stream() - .map(Gmm::supportedImts) - .flatMap(Set::stream) - .distinct() - .sorted() - .map(imt -> new Parameter(ServletUtil.imtShortLabel(imt), imt.name())) + imts = Gmm.supportedImts(model.gmms()).stream() + .map(imt -> new Parameter( + ServletUtil.imtShortLabel(imt), + imt.name())) + .collect(toList()); + bounds = Arrays.stream(model.bounds().toArray()) + .boxed() .collect(toList()); - bounds = DoubleStream.of(model.bounds().toArray()).boxed().collect(toList()); } public String getName() {