Skip to content

Commit df62c35

Browse files
committed
distance calc update
1 parent cbc4c36 commit df62c35

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ public class NshmErfTest {
3030
// private static final Path MODEL = Path.of("../nshm-conus-2018-5.x-maint");
3131
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);
@@ -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)