matplotlib立体图
mplstereonet的Python项目详细描述
mplstereonet提供下半球等面积和等角度立体网 对于matplotlib。
新功能
mplsteroNet-v0.5的主要变化是:
- ax.cone绘制小圆的方法
- 将极点和平面拟合到观测分布的各种函数(例如mplstereonet.fit_girdle、mplstereonet.fit_pole和mplstereonet.eigenvectors)
- 平均向量计算和平均向量(mplstereonet.find_mean_vector和mplstereonet.find_fisher_stats)的Fisher统计(多亏了Tobias Schónberg!)
基本用法
在大多数情况下,您需要import mplstereonet,然后生成一个轴 使用projection="stereonet"(默认情况下,这是一个等面积立体网)。 或者,您可以使用mplstereonet.subplots,它的函数相同 到matplotlib.pyplot.subplots,但创建立体网轴
例如:
import matplotlib.pyplot as plt import mplstereonet fig = plt.figure() ax = fig.add_subplot(111, projection='stereonet') strike, dip = 315, 30 ax.plane(strike, dip, 'g-', linewidth=2) ax.pole(strike, dip, 'g^', markersize=18) ax.rake(strike, dip, -25) ax.grid() plt.show()
可以使用轴方法绘制平面、直线、极点和耙(例如 ax.line(plunge, bearing)或ax.rake(strike, dip, rake_angle))。
所有平面测量都应遵循右手法则来指示 倾斜方向。举个例子,315/30s等于135/30 规则。
密度等值线
mplstereonet还提供了几种不同的生成轮廓的方法 定向密度图。
ax.density_contour和ax.density_contourf轴方法提供密度 等高线和填充密度等高线。“原始”密度网格 可以使用mplstereonet.density_grid函数生成。
作为一个基本示例:
import matplotlib.pyplot as plt import numpy as np import mplstereonet fig, ax = mplstereonet.subplots() strike, dip = 90, 80 num = 10 strikes = strike + 10 * np.random.randn(num) dips = dip + 10 * np.random.randn(num) cax = ax.density_contourf(strikes, dips, measurement='poles') ax.pole(strikes, dips) ax.grid(True) fig.colorbar(cax) plt.show()
默认情况下,具有指数平滑[Vollmer1995]的改进kamb方法是 用于估计方向密度分布。其他方法(如 “传统的”Kamb[Kamb1956]和“Schmidt”(又名1%)方法是 也有。方法和预期计数(标准偏差)可以 分别由method和sigma关键字参数控制。
实用程序
mplstereonet还包含许多用于分析结构的实用程序 以象限或方位角形式进行测量,以便它们遵循 右手定则。
例如,请参见parsing_example.py:
Parse quadrant azimuth measurements "N30E" --> 30.0 "E30N" --> 60.0 "W10S" --> 260.0 "N 10 W" --> 350.0 Parse quadrant strike/dip measurements. Note that the output follows the right-hand-rule. "215/10" --> Strike: 215.0, Dip: 10.0 "215/10E" --> Strike: 35.0, Dip: 10.0 "215/10NW" --> Strike: 215.0, Dip: 10.0 "N30E/45NW" --> Strike: 210.0, Dip: 45.0 "E10N 20 N" --> Strike: 260.0, Dip: 20.0 "W30N/46.7 S" --> Strike: 120.0, Dip: 46.7 Similarly, you can parse rake measurements that don't follow the RHR. "N30E/45NW 10NE" --> Strike: 210.0, Dip: 45.0, Rake: 170.0 "210 45 30N" --> Strike: 210.0, Dip: 45.0, Rake: 150.0 "N30E/45NW raking 10SW" --> Strike: 210.0, Dip: 45.0, Rake: 10.0
此外,还可以通过以下方法找到平面交点并进行其他计算: 组合效用函数。见plane_intersection.py和 parse_anglier_data.py例如
参考文献
[Kamb1956] | Kamb, 1959. Ice Petrofabric Observations from Blue Glacier, Washington, in Relation to Theory and Experiment. Journal of Geophysical Research, Vol. 64, No. 11, pp. 1891–1909. |
[Vollmer1995] | Vollmer, 1995. C Program for Automatic Contouring of Spherical Orientation Data Using a Modified Kamb Method. Computers & Geosciences, Vol. 21, No. 1, pp. 31–49. |