def test_planar_sliding(self): planar_analysis = kinematic.PlanarSliding(0, 75) pole1 = smath.geographic2pole(np.radians(-70), np.radians(20)) data = [ # Strike, dip main, sec [(0, 45), (True, False)], [pole1, (True, False)], # just at lateral limit [(30, 35), (True, False)], # just at friction cone [(0, 75), (True, False)], # just daylights [(315, 35), (False, True)], # just at friction cone [(45, 35), (False, True)], # just at friction cone [(50, 60), (False, True)], [(0, 20), (False, False)], [(0, 80), (False, False)], [(270, 60), (False, False)], ] for strike_dip, correct in data: results = planar_analysis.check_failure(*strike_dip) assert results == correct
""" Kinematic analysis with straight vs curved limit lines - you can also choose for flexural toppling """ import matplotlib.pyplot as plt import mplstereonet.kinematic_analysis as kinematic P5 = kinematic.PlanarSliding(60, 75) fig = plt.figure(figsize=(12, 6)) # Plot with curved lateral limit lines ax1 = fig.add_subplot(1, 2, 1, projection='stereonet') P5.plot_kinematic(ax=ax1) ax1.set_title('Curved lateral limits', loc='left') # Plot with curved lateral limit lines ax2 = fig.add_subplot(1, 2, 2, projection='stereonet') P5.plot_kinematic(ax=ax2, curved_lateral_limits=False) ax2.set_title('Straight lateral limits', loc='left') plt.show()
""" Demonstrating more control on the parameters (e.g. friction angle and lateral limits) of the analysis and plotting style for planar sliding and toppling failure. Similar for wedge failure. """ import matplotlib.pyplot as plt import mplstereonet import mplstereonet.kinematic_analysis as kinematic # Set up the analysis with friction angle and lateral limits P2 = kinematic.PlanarSliding(strike=0, dip=80, fric_angle=40, latlim=30) T2 = kinematic.FlexuralToppling(strike=0, dip=80, fric_angle=40, latlim=30) # Start plotting fig, (ax1, ax2) = mplstereonet.subplots(ncols=2, figsize=(12, 9)) # Customizing with the kwargs - example with planar sliding failure P2.plot_kinematic(daylight_kws={ 'ec': 'b', 'label': 'Daylight Envelope' }, friction_kws={ 'ec': 'green', 'label': 'Friction Cone (40$^\circ$)', 'ls': '-.' }, lateral_kws={ 'color': 'purple', 'label': 'Lateral Limits ($\pm30^\circ$)', 'ls': '--'