Skip to content

Commit 11b0afb

Browse files
committed
Properly translate upper proj angles in plot
1 parent b765912 commit 11b0afb

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

hashpy/plotting/focalmechplotter.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,19 @@ def plot_on_stereonet(self, axis=None, fm=None):
110110
'markeredgewidth' : 2,
111111
}
112112
for ind, a in enumerate(self._orig.arrivals):
113+
p = a.pick_id.getReferredObject()
114+
# Calculate strike azi from direct (dip-pointing) azi
115+
azi = a.azimuth - 90.
113116
#--- HASH takeoffs are 0-180 from vertical UP!!
114117
#--- Stereonet angles 0-90 inward (dip)
115118
#--- Classic FM's are toa from center???
116-
p = a.pick_id.getReferredObject()
117-
azi = a.azimuth - 90.
118-
toa = abs(a.takeoff_angle - 90)
119+
if 90. <= a.takeoff_angle <= 180.:
120+
toa = a.takeoff_angle - 90.
121+
elif 0. <= a.takeoff_angle < 90.:
122+
toa = a.takeoff_angle + 180.
123+
else:
124+
raise ValueError("Takeoff angle ({0}) must be in [0, 180]".format(a.azimuth))
125+
119126
if p.polarity is 'positive':
120127
#plot_specs.update({'markeredgecolor' : 'black', 'markerfacecolor' : 'red' })
121128
h += ax.rake(azi, toa, 90, 'o', markeredgecolor='black', markerfacecolor='red', **plot_specs)

0 commit comments

Comments
 (0)