def line_above_plane(strike, dip, lplunge, lbearing): """ Evaluates if line is above a plane (great circle), such that 1) the line has a smaller plunge compared to that of its vertical projection onto the plane (as rake), and 2) it has the same bearing as that of the rake. Parameters ---------- strike : int or float The strike of the plane in degrees, with dip direction indicated by the azimuth (e.g. 315 vs. 135) specified following the "right hand rule". dip : int or float The dip of the plane in degrees. lplunge, lbearing: integer or float plunge, bearing of a line Returns ------- aboveplane*samebearing: boolean True if line is above the plane """ # project line to plane as rake rake_angle = st.azimuth2rake(strike, dip, lbearing) # convert rake to line defined by plunge and bearing rlon, rlat = st.rake(strike, dip, rake_angle) rplunge, rbearing = st.geographic2plunge_bearing(rlon, rlat) # evaluate if line is above the rake smallerplunge = rplunge > lplunge # evaluate if line has the same bearing as the rake samebearing = np.abs(rbearing - lbearing) < 0.001 return smallerplunge * samebearing
def tangent_lineation_plot(ax, strikes, dips, rakes): """Makes a tangent lineation plot for normal faults with the given strikes, dips, and rakes.""" # Calculate the position of the rake of the lineations, but don't plot yet rake_x, rake_y = mplstereonet.rake(strikes, dips, rakes) # Calculate the direction the arrows should point # These are all normal faults, so the arrows point away from the center # Because we're plotting at the pole location, however, we need to flip this # from what we plotted with the "ball of string" plot. mag = np.hypot(rake_x, rake_y) u, v = -rake_x / mag, -rake_y / mag # Calculate the position of the poles pole_x, pole_y = mplstereonet.pole(strikes, dips) # Plot the arrows centered on the pole locations... arrows = ax.quiver(pole_x, pole_y, u, v, width=1, headwidth=4, units='dots', pivot='middle') return arrows
def plot_polarities(self, ax=None, show: bool = False, label: bool = True) -> plt.Axes: if not ax: fig = plt.figure() ax = fig.add_subplot(111, projection="stereonet") for polarity in self.polarities: toa, baz = polarity.toa, polarity.azimuth assert 0 <= toa <= 180, f"Take off angle ({toa}) does not lie between 0 and 180" if 0. <= toa < 90.: toa = 90. - toa # complement for downward angles elif 90. <= toa <= 180.: toa = 270. - toa # project upward angles baz -= 90 # Calculate strike azi from direct (dip-pointing) azi if polarity.polarity in UPS: plot_kwargs = POLARITY_PROPS["up"] elif polarity.polarity in DOWNS: plot_kwargs = POLARITY_PROPS["down"] else: plot_kwargs = POLARITY_PROPS["unknown"] # Ensure boundedness baz = baz % 360 ax.rake(baz, toa, 90, **plot_kwargs) if label: lon, lat = mplstereonet.rake(baz, toa, 90) ax.text(lon[0], lat[0], polarity.station) plot_kwargs.pop("label", None) # Only label once if show: plt.show(block=True) return ax
def fault_and_striae_plot(ax, strikes, dips, rakes): """Makes a fault-and-striae plot (a.k.a. "Ball of String") for normal faults with the given strikes, dips, and rakes.""" # Plot the planes lines = ax.plane(strikes, dips, 'k-', lw=0.5) # Calculate the position of the rake of the lineations, but don't plot yet x, y = mplstereonet.rake(strikes, dips, rakes) # Calculate the direction the arrows should point # These are all normal faults, so the arrows point away from the center # For thrusts, it would just be u, v = -x/mag, -y/mag mag = np.hypot(x, y) u, v = x / mag, y / mag # Plot the arrows at the rake locations... arrows = ax.quiver(x, y, u, v, width=1, headwidth=4, units='dots') return lines, arrows