APSG tutorial - Part 3
[1]:
from apsg import *
StereoNet class
StereoNet allows to visualize features on stereographic projection. Both equal-area Schmidt (default) and equal-angle Wulff projections are supported.
[2]:
s = StereoNet()
s.great_circle(fol(150, 40))
s.point(fol(150, 40))
s.point(lin(112, 30))
s.show()
Small circles (or cones) can be plotted as well
[3]:
s = StereoNet()
l = linset.random_fisher(position=lin(40, 15), kappa=15)
s.point(l, color='k')
s.cone(l.fisher_cone(), color='r') # confidence cone on resultant
s.cone(l.fisher_cone_csd(), color='g') # confidence cone on 63% of data
s.show()
For density contouring a contour method is available
[4]:
s = StereoNet()
s.contour(l, levels=8, colorbar=True)
s.point(l, color='g', marker='.')
s.show()
APSG also provides pairset and faultset classes to store pair or fault datasets. It can be initialized by passing list of pair or fault objects as argument or use class methods from_array or from_csv
[5]:
p = pairset([pair(120, 30, 165, 20),
pair(215, 60, 280,35),
pair(324, 70, 35, 40)])
p.misfit
[5]:
array([2.0650076 , 0.74600727, 0.83154705])
StereoNet has two special methods to visualize fault data. The fault method produces classical Angelier plot
[6]:
f = faultset([fault(170, 60, 182, 59, -1),
fault(210, 55, 195, 53, -1),
fault(10, 60, 15, 59, -1),
fault(355, 48, 22, 45, -1)])
s = StereoNet()
s.fault(f)
s.point(f.p, label='P-axes')
s.point(f.t, label='T-axes')
s.great_circle(f.m, label='M-planes')
s.show()
The hoeppner method produces Hoeppner diagram and must be invoked from StereoNet instance
[7]:
s = StereoNet()
s.hoeppner(f, label=repr(f))
s.show()
StereoNet styles
Stereonets could be created using styles to re-use same styling on different data. Style factory methods use same names as StereoNet plotting method. Firstly we need to create styles to be used to visualize the data:
[8]:
s1 = stereonet_styles.point(color="darkblue", marker="X", ms=8, mec="white", label="Set 1")
s2 = stereonet_styles.point(color="orange", mec="k", label="Set 2")
[9]:
l1a = linset.random_fisher(position=lin(45,50))
l2a = linset.random_fisher(position=lin(250,50))
l1b = linset.random_fisher(position=lin(112,40))
l2b = linset.random_fisher(position=lin(320,50))
With styles, we can simply use StereoNet method plot:
[10]:
s = StereoNet()
s.plot(s1, l1a)
s.plot(s2, l2a)
s.show()
Another data with same style
[11]:
s = StereoNet()
s.plot(s1, l1b)
s.plot(s2, l2b)
s.show()
StereoGrid class
StereoGrid class allows to visualize any scalar field on StereoNet. It is used for plotting contour diagrams, but it exposes apply_func method to calculate scalar field by any user-defined function. Function must accept three element numpy.array as first argument passed from grid points of StereoGrid.
Following example defines function to calculate resolved shear stress on plane from given stress tensor. StereoGrid is accessed via the .grid property to calculate this value over all directions and finally values are plotted by StereoNet
[12]:
S = stress([[-10, 2, -3],[2, -5, 1], [-3, 1, 2]])
s = StereoNet()
s.grid.apply_func(S.shear_stress)
s.contour(levels=10)
s.show()
The StereoGrid also provides angmech (Angelier dihedra) method for paleostress analysis. Results are stored in StereoGrid. Default behavior is to calculate counts (positive in extension, negative in compression)
[13]:
f = faultset.from_csv('mele.csv')
s = StereoNet()
s.grid.angmech(f)
s.contour()
s.show()
Setting method to probability, maximum likelihood estimate is calculated.
[14]:
f = faultset.from_csv('mele.csv')
s = StereoNet()
s.grid.angmech(f, method='probability')
s.contour()
s.show()
[15]:
s.grid
[15]:
StereoGrid EqualAreaProj 3000 points.
Maximum: 48.3587 at L:250/11
Minimum: -36.1316 at L:158/14
Multiple stereonets in figure
[16]:
import matplotlib.pyplot as plt
fig = plt.figure(constrained_layout=True, figsize=(10, 4))
subfigs = fig.subfigures(1, 3)
f = folset.random_fisher(position=fol(130, 60))
l = linset.random_fisher(position=fol(230, 30))
# panel 1
s1 = StereoNet()
s1.great_circle(f)
# panel 2
s2 = StereoNet()
s2.contour(l)
s2.point(l, ms=4, color='green')
# panel 3
s3 = StereoNet()
s3.point(f, color='orange')
# render2fig
s1.render2fig(subfigs[0])
s2.render2fig(subfigs[1])
s3.render2fig(subfigs[2])
plt.show()
[ ]: