Skip to content
Snippets Groups Projects
Commit 9d8a9cbe authored by Powers, Peter M.'s avatar Powers, Peter M.
Browse files

grid edits

parent 5e383283
No related branches found
No related tags found
1 merge request!453Adds support for planar ruptures
...@@ -147,6 +147,7 @@ class GridLoader { ...@@ -147,6 +147,7 @@ class GridLoader {
this.mfdsPath = data.gridRateFile().orElseThrow(); this.mfdsPath = data.gridRateFile().orElseThrow();
this.mfdTreeKey = mfdTreeKey; this.mfdTreeKey = mfdTreeKey;
this.featureData = new FeatureData(); this.featureData = new FeatureData();
processNodes(); processNodes();
} }
......
...@@ -4,6 +4,7 @@ import static gov.usgs.earthquake.nshmp.Maths.PI_BY_2; ...@@ -4,6 +4,7 @@ import static gov.usgs.earthquake.nshmp.Maths.PI_BY_2;
import static gov.usgs.earthquake.nshmp.Maths.TO_RADIANS; import static gov.usgs.earthquake.nshmp.Maths.TO_RADIANS;
import static gov.usgs.earthquake.nshmp.Maths.TWO_PI; import static gov.usgs.earthquake.nshmp.Maths.TWO_PI;
import static gov.usgs.earthquake.nshmp.Maths.hypot; import static gov.usgs.earthquake.nshmp.Maths.hypot;
import static java.lang.Math.abs;
import static java.lang.Math.min; import static java.lang.Math.min;
import static java.lang.Math.sin; import static java.lang.Math.sin;
import static java.lang.Math.sqrt; import static java.lang.Math.sqrt;
...@@ -182,20 +183,22 @@ class GridSourcePlanar extends PointSource { ...@@ -182,20 +183,22 @@ class GridSourcePlanar extends PointSource {
// down-dip and up-dip azimuths // down-dip and up-dip azimuths
double ddAz = (strikeRad + PI_BY_2) % TWO_PI; double ddAz = (strikeRad + PI_BY_2) % TWO_PI;
double udAz = (strikeRad - PI_BY_2) % TWO_PI;
// down-dip // down-dip
double ddΔV = zBor - location.depth; double ddΔV = zBor - location.depth;
double ddΔH = ddΔV / tan(dipRad); double ddΔH = ddΔV / tan(dipRad);
double ddW = ddΔV / sin(dipRad); double ddW = ddΔV / sin(dipRad);
LocationVector ddV = LocationVector.create(ddAz, ddΔH, -ddΔV);
LocationVector ddV = LocationVector.create(ddAz, ddΔH, ddΔV);
Location ddP = Locations.location(location, ddV); Location ddP = Locations.location(location, ddV);
// up-dip // up-dip
double udΔV = location.depth - zTor; double udΔV = zTor - location.depth;
double udΔH = udΔV / tan(dipRad); double udΔH = udΔV / tan(dipRad);
double udW = udΔV / sin(dipRad); double udW = udΔV / sin(dipRad);
LocationVector udV = LocationVector.create(udAz, udΔH, udΔV); // in the updip case, udΔH is negative effectively
// reversing the downdip azimuth
LocationVector udV = LocationVector.create(ddAz, udΔH, udΔV);
Location udP = Locations.location(location, udV); Location udP = Locations.location(location, udV);
this.p1 = Locations.location(udP, svB); this.p1 = Locations.location(udP, svB);
...@@ -203,8 +206,8 @@ class GridSourcePlanar extends PointSource { ...@@ -203,8 +206,8 @@ class GridSourcePlanar extends PointSource {
this.p3 = Locations.location(ddP, svF); this.p3 = Locations.location(ddP, svF);
this.p4 = Locations.location(ddP, svB); this.p4 = Locations.location(ddP, svB);
this.width = ddW + udW; this.width = ddW + abs(udW);
this.widthH = ddΔH + udΔH; this.widthH = ddΔH + abs(udΔH);
} }
@Override @Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment