diff --git a/src/main/java/gov/usgs/earthquake/nshmp/calc/ReturnPeriod.java b/src/main/java/gov/usgs/earthquake/nshmp/calc/ReturnPeriod.java deleted file mode 100644 index 2dfd70da20b4bec05e163bc1600da66678404a0a..0000000000000000000000000000000000000000 --- a/src/main/java/gov/usgs/earthquake/nshmp/calc/ReturnPeriod.java +++ /dev/null @@ -1,89 +0,0 @@ -package gov.usgs.earthquake.nshmp.calc; - -import com.google.common.base.MoreObjects; - -import gov.usgs.earthquake.nshmp.Maths; -import gov.usgs.earthquake.nshmp.mfd.Mfds; - -/** - * Identifiers of common return periods, also referred to in PSHA as - * probabilities of exceedance. - * - * <p>Each identifier is structured as follows, for example {@code PE2IN50}: - * - * <ul><li>Reads as a 2% Poisson probability of exceeding some measure of ground - * motion in a 50 year period.</li> - * - * <li>Is equivalent to an annual rate of occurrence of ~0.000404 (see - * {@link #annualRate()}).</li> - * - * <li>Or once every 2475 years or so (see {@link #duration()} ).</li></ul> - * - * <p>Note that the {@link Mfds} class includes useful static utilities for - * working with Poisson probabilities, rates, and time spans. - * - * @author U.S. Geological Survey - * @see Mfds - */ -public enum ReturnPeriod { - - /** A 1% probability of exceedance in 10,000 years. */ - PE1IN10000(0.000001), - - /** A 1% probability of exceedance in 1,000 years. */ - PE1IN1000(0.00001), - - /** A 1% probability of exceedance in 100 years. */ - PE1IN100(0.000101), - - /** A 1% probability of exceedance in 50 years. */ - PE1IN50(0.000201), - - /** A 2% probability of exceedance in 50 years. */ - PE2IN50(0.000404), - - /** A 5% probability of exceedance in 50 years. */ - PE5IN50(0.001026), - - /** A 10% probability of exceedance in 50 years. */ - PE10IN50(0.002107), - - /** A 40% probability of exceedance in 50 years. */ - PE40IN50(0.010217); - - private double annualRate; - - private ReturnPeriod(double annualRate) { - this.annualRate = nameToAnnRate(name()); - } - - @Override - public String toString() { - return MoreObjects - .toStringHelper(getClass().getSimpleName() + "." + name()) - .add("annualRate", annualRate) - .add("duration", duration()) - .toString(); - } - - /** - * Return the annual rate of occurrence represented by this time period. - */ - public double annualRate() { - return annualRate; - } - - /** - * Return the duration (number of years spanned) by this return period. - */ - public int duration() { - return (int) Math.rint(1.0 / annualRate); - } - - private double nameToAnnRate(String name) { - String[] values = name.substring(2).split("IN"); - double prob = Double.parseDouble(values[0]) / 100.0; - double time = Double.parseDouble(values[1]); - return Maths.probabilityToRate(prob, time); - } -} diff --git a/src/main/java/gov/usgs/earthquake/nshmp/model/ClusterRuptureSet.java b/src/main/java/gov/usgs/earthquake/nshmp/model/ClusterRuptureSet.java index fa5f562c0b4d544b26b46963fc66d5f81256bb10..778b86e4e085b9076d3309fdab270301746caff1 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/model/ClusterRuptureSet.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/model/ClusterRuptureSet.java @@ -97,7 +97,7 @@ public class ClusterRuptureSet extends AbstractRuptureSet<ClusterSource> { private ModelData data; // holds cluster rate-tree private ClusterSource source; - Builder() { + private Builder() { super(SourceType.FAULT_CLUSTER); } diff --git a/src/main/java/gov/usgs/earthquake/nshmp/model/FaultRuptureSet.java b/src/main/java/gov/usgs/earthquake/nshmp/model/FaultRuptureSet.java index b51ca5cced19e967fb32544605ea26162b26e9cf..5d39ab35d8f875952275dce771ce480627ca0b8b 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/model/FaultRuptureSet.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/model/FaultRuptureSet.java @@ -162,7 +162,7 @@ public class FaultRuptureSet extends AbstractRuptureSet<FaultSource> { private List<Integer> sectionIds; private Optional<Map<String, ?>> ruptureProps = Optional.empty(); - Builder() { + private Builder() { super(SourceType.FAULT); } diff --git a/src/main/java/gov/usgs/earthquake/nshmp/model/InterfaceRuptureSet.java b/src/main/java/gov/usgs/earthquake/nshmp/model/InterfaceRuptureSet.java index 052bc3a700d995a6a59ab6a0d37a06af0961c18c..a0211f848e70b0af088ea499179066b2a457373b 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/model/InterfaceRuptureSet.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/model/InterfaceRuptureSet.java @@ -131,7 +131,7 @@ public class InterfaceRuptureSet extends AbstractRuptureSet<InterfaceSource> { private Mfd mfdTotal; private GriddedSurface surface; - Builder() { + private Builder() { super(SourceType.INTERFACE); } diff --git a/src/main/java/gov/usgs/earthquake/nshmp/model/SystemRuptureSet.java b/src/main/java/gov/usgs/earthquake/nshmp/model/SystemRuptureSet.java index 8c49c02879fd4a696f4e3e904b2898780861fd00..4bc773ef16c31e483704cb2765bc12d8e4f34dd3 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/model/SystemRuptureSet.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/model/SystemRuptureSet.java @@ -417,7 +417,7 @@ public class SystemRuptureSet extends AbstractRuptureSet<SystemRuptureSet.System private double mMin = Double.POSITIVE_INFINITY; private double mMax = Double.NEGATIVE_INFINITY; - Builder() { + private Builder() { super(SourceType.FAULT_SYSTEM); }