Skip to content

Commit b33c65c

Browse files
Merge pull request opensha#54 from pmpowers-usgs/prvi-debug
PRVI debug
2 parents e394bfe + df62c35 commit b33c65c

File tree

4 files changed

+30
-13
lines changed

4 files changed

+30
-13
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ apply from: '../opensha/build-common.gradle'
1212

1313
dependencies {
1414

15-
api "ghsc:nshmp-lib:1.7.10"
15+
api "ghsc:nshmp-lib:1.7.14"
1616

1717
implementation 'org.apache.pdfbox:pdfbox:2.0.6'
1818
implementation 'org.apache.commons:commons-collections4:4.1'

src/main/java/gov/usgs/earthquake/nshmp/model/NshmErf.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,18 @@ private List<NshmSource> sourcesFromBranch(
190190
? ruptureSetToSources(ruptureSet, weight, duration)
191191
: List.of();
192192

193+
case INTERFACE_CLUSTER:
194+
ClusterRuptureSet icrs = (ClusterRuptureSet) ruptureSet;
195+
return (subInterface && faults)
196+
? clusterRuptureSetToSources(icrs, weight, duration)
197+
: List.of();
198+
199+
case INTERFACE_SYSTEM:
200+
SystemRuptureSet isrs = (SystemRuptureSet) ruptureSet;
201+
return (faults)
202+
? systemRuptureSetToSources(isrs, weight, duration)
203+
: List.of();
204+
193205
case SLAB:
194206
return (subSlab && faults)
195207
? ruptureSetToSources(ruptureSet, weight, duration)

src/main/java/gov/usgs/earthquake/nshmp/model/NshmErfTest.java

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,24 @@ public class NshmErfTest {
2828
// private static final Path MODEL =
2929
// Path.of("../nshmp-lib/src/test/resources/model/test-model");
3030
// private static final Path MODEL = Path.of("../nshm-conus-2018-5.x-maint");
31-
private static final Path MODEL = Path.of("../nshm-conus");
31+
private static final Path MODEL = Path.of("../nshm-prvi");
3232

33-
// static gov.usgs.earthquake.nshmp.geo.Location testLoc =
34-
// gov.usgs.earthquake.nshmp.geo.Location.create(-122, 39.0);
35-
static gov.usgs.earthquake.nshmp.geo.Location testLoc =
36-
gov.usgs.earthquake.nshmp.geo.Location.create(-80, 33.2);
33+
static gov.usgs.earthquake.nshmp.geo.Location testLoc =
34+
gov.usgs.earthquake.nshmp.geo.Location.create(-66.117, 18.465);
35+
// static gov.usgs.earthquake.nshmp.geo.Location testLoc =
36+
// gov.usgs.earthquake.nshmp.geo.Location.create(-80, 33.2);
3737

3838
// static gov.usgs.earthquake.nshmp.geo.Location testLoc =
3939
// gov.usgs.earthquake.nshmp.geo.Location.create(-110, 37.5);
4040

4141
public static void main(String[] args) {
4242

43-
Set<TectonicRegionType> trts =
44-
EnumSet.of(TectonicRegionType.STABLE_SHALLOW);
45-
// Set<TectonicRegionType> trts = EnumSet.noneOf(TectonicRegionType.class);
43+
// Set<TectonicRegionType> trts =
44+
// EnumSet.of(TectonicRegionType.STABLE_SHALLOW);
45+
Set<TectonicRegionType> trts = EnumSet.noneOf(TectonicRegionType.class);
4646

4747
HazardModel model = HazardModel.load(MODEL);
48-
NshmErf erf = new NshmErf(model, trts, IncludeBackgroundOption.EXCLUDE);
48+
NshmErf erf = new NshmErf(model, trts, IncludeBackgroundOption.INCLUDE);
4949
System.out.println("NSHM ERF size: " + erf.getNumSources());
5050
erf.getTimeSpan().setDuration(1.0);
5151
erf.updateForecast();
@@ -125,16 +125,18 @@ public static void main(String[] args) {
125125
}
126126
}
127127

128-
// calcHazard(erf);
128+
calcHazard(erf);
129129
}
130130

131131
private static void calcHazard(NshmErf erf) {
132132
ScalarIMR gmpe = new ASK_2014_Wrapper();
133133
gmpe.setParamDefaults();
134134
gmpe.setIntensityMeasure(PGA_Param.NAME);
135135

136-
Site site = new Site(new Location(34, -118)); // Los Angeles
136+
Site site = new Site(new Location(18.465, -66.117)); // San Juan
137+
// Site site = new Site(new Location(34, -118)); // Los Angeles
137138
// Site site = new Site(new Location(40.75, -111.90)); // Salt lake City
139+
138140

139141
for (Parameter<?> param : gmpe.getSiteParams()) {
140142
site.addParameter((Parameter<?>) param.clone());

src/main/java/gov/usgs/earthquake/nshmp/model/NshmSurface.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ public LocationList getEvenlyDiscritizedListOfLocsOnSurface() {
156156
public double getAveLength() {
157157
return delegate.length();
158158
}
159+
160+
@Override public double getQuickDistance(Location siteLoc) {
161+
return calcQuickDistance(siteLoc);
162+
}
159163

160164
// Unnecessary methods for hazard calculations
161165

@@ -168,7 +172,6 @@ public double getAveLength() {
168172
@Override public FaultTrace getEvenlyDiscritizedUpperEdge() { throw new UnsupportedOperationException(); }
169173
@Override public LocationList getEvenlyDiscritizedLowerEdge() { throw new UnsupportedOperationException(); }
170174
@Override public double getAveGridSpacing() { throw new UnsupportedOperationException(); }
171-
@Override public double getQuickDistance(Location siteLoc) { throw new UnsupportedOperationException(); }
172175
@Override public double getAveDipDirection() { throw new UnsupportedOperationException(); }
173176
@Override public FaultTrace getUpperEdge() { throw new UnsupportedOperationException(); }
174177
@Override public double getFractionOfSurfaceInRegion(Region region) { throw new UnsupportedOperationException(); }

0 commit comments

Comments
 (0)