LoopStructural 1.0.9__cp36-cp36m-win32.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. LoopStructural/__init__.py +36 -0
  2. LoopStructural/analysis/__init__.py +2 -0
  3. LoopStructural/analysis/_fault_displacement.py +67 -0
  4. LoopStructural/analysis/_fault_intersection.py +36 -0
  5. LoopStructural/analysis/_plane_fit.py +43 -0
  6. LoopStructural/datasets/__init__.py +12 -0
  7. LoopStructural/datasets/_base.py +65 -0
  8. LoopStructural/datasets/data/claudius.csv +21049 -0
  9. LoopStructural/datasets/data/claudiusbb.txt +2 -0
  10. LoopStructural/datasets/data/duplex.csv +126 -0
  11. LoopStructural/datasets/data/duplexbb.txt +2 -0
  12. LoopStructural/datasets/data/intrusion.csv +1017 -0
  13. LoopStructural/datasets/data/intrusionbb.txt +2 -0
  14. LoopStructural/datasets/data/onefoldbb.txt +2 -0
  15. LoopStructural/datasets/data/onefolddata.csv +2226 -0
  16. LoopStructural/datasets/data/refolded_bb.txt +2 -0
  17. LoopStructural/datasets/data/refolded_fold.csv +2126 -0
  18. LoopStructural/interpolators/__init__.py +34 -0
  19. LoopStructural/interpolators/base_structured_3d_support.py +101 -0
  20. LoopStructural/interpolators/cython/__init__.py +0 -0
  21. LoopStructural/interpolators/cython/dsi_helper.c +31046 -0
  22. LoopStructural/interpolators/cython/dsi_helper.cp36-win32.pyd +0 -0
  23. LoopStructural/interpolators/discrete_fold_interpolator.py +202 -0
  24. LoopStructural/interpolators/discrete_interpolator.py +584 -0
  25. LoopStructural/interpolators/finite_difference_interpolator.py +399 -0
  26. LoopStructural/interpolators/geological_interpolator.py +197 -0
  27. LoopStructural/interpolators/operator.py +61 -0
  28. LoopStructural/interpolators/piecewiselinear_interpolator.py +437 -0
  29. LoopStructural/interpolators/structured_grid.py +421 -0
  30. LoopStructural/interpolators/structured_tetra.py +681 -0
  31. LoopStructural/interpolators/surfe_wrapper.py +118 -0
  32. LoopStructural/modelling/__init__.py +46 -0
  33. LoopStructural/modelling/core/__init__.py +0 -0
  34. LoopStructural/modelling/core/geological_model.py +1513 -0
  35. LoopStructural/modelling/core/geological_model_graph.py +880 -0
  36. LoopStructural/modelling/core/stratigraphic_column.py +5 -0
  37. LoopStructural/modelling/fault/__init__.py +4 -0
  38. LoopStructural/modelling/fault/fault_builder.py +143 -0
  39. LoopStructural/modelling/fault/fault_function.py +188 -0
  40. LoopStructural/modelling/fault/fault_function_feature.py +76 -0
  41. LoopStructural/modelling/fault/fault_segment.py +298 -0
  42. LoopStructural/modelling/features/__init__.py +8 -0
  43. LoopStructural/modelling/features/cross_product_geological_feature.py +90 -0
  44. LoopStructural/modelling/features/geological_feature.py +252 -0
  45. LoopStructural/modelling/features/geological_feature_builder.py +414 -0
  46. LoopStructural/modelling/features/lambda_geological_feature.py +36 -0
  47. LoopStructural/modelling/features/region_feature.py +34 -0
  48. LoopStructural/modelling/features/structural_frame.py +133 -0
  49. LoopStructural/modelling/features/structural_frame_builder.py +206 -0
  50. LoopStructural/modelling/features/unconformity_feature.py +74 -0
  51. LoopStructural/modelling/fold/__init__.py +8 -0
  52. LoopStructural/modelling/fold/fold.py +143 -0
  53. LoopStructural/modelling/fold/fold_rotation_angle.py +133 -0
  54. LoopStructural/modelling/fold/fold_rotation_angle_feature.py +58 -0
  55. LoopStructural/modelling/fold/foldframe.py +193 -0
  56. LoopStructural/modelling/fold/svariogram.py +180 -0
  57. LoopStructural/utils/__init__.py +18 -0
  58. LoopStructural/utils/bounding_box.py +21 -0
  59. LoopStructural/utils/exceptions.py +10 -0
  60. LoopStructural/utils/helper.py +382 -0
  61. LoopStructural/utils/logging.py +60 -0
  62. LoopStructural/utils/map2loop.py +353 -0
  63. LoopStructural/utils/regions.py +11 -0
  64. LoopStructural/utils/utils.py +69 -0
  65. LoopStructural/visualisation/__init__.py +31 -0
  66. LoopStructural/visualisation/map_viewer.py +322 -0
  67. LoopStructural/visualisation/model_plotter.py +17 -0
  68. LoopStructural/visualisation/model_visualisation.py +1113 -0
  69. LoopStructural/visualisation/rotation_angle_plotter.py +83 -0
  70. LoopStructural/visualisation/sphinx_scraper.py +34 -0
  71. LoopStructural/visualisation/stratigraphic_column.py +60 -0
  72. LoopStructural-1.0.9.dist-info/LICENSE +21 -0
  73. LoopStructural-1.0.9.dist-info/METADATA +19 -0
  74. LoopStructural-1.0.9.dist-info/RECORD +77 -0
  75. LoopStructural-1.0.9.dist-info/WHEEL +5 -0
  76. LoopStructural-1.0.9.dist-info/top_level.txt +2 -0
  77. tests/__init__.py +0 -0
@@ -0,0 +1,118 @@
1
+ """
2
+ Wrapper for using surfepy
3
+ """
4
+ import sys, os
5
+
6
+ from LoopStructural.utils.helper import get_vectors
7
+ from .geological_interpolator import GeologicalInterpolator
8
+
9
+ import logging
10
+ import numpy as np
11
+
12
+ from LoopStructural.utils import getLogger
13
+ logger = getLogger(__name__)
14
+
15
+ import surfepy
16
+
17
+
18
+
19
+ class SurfeRBFInterpolator(GeologicalInterpolator):
20
+ """
21
+
22
+ """
23
+ def __init__(self, method='single_surface'):
24
+ GeologicalInterpolator.__init__(self)
25
+ self.surfe = None
26
+ if method == 'single_surface':
27
+ logger.info("Using single surface interpolator")
28
+ self.surfe = surfepy.Surfe_API(1)
29
+ if method == 'Laujaunie':
30
+ logger.info("Using Laujaunie method")
31
+ self.surfe = surfepy.Surfe_API(2)
32
+ if method == 'horizons':
33
+ logger.info("Using surfe horizon")
34
+ self.surfe = surfepy.Surfe_API(4)
35
+
36
+ def add_gradient_ctr_pts(self):
37
+ points = self.get_gradient_constraints()
38
+ if points.shape[0] > 0:
39
+ logger.info("Adding ")
40
+ strike_vector, dip_vector = get_vectors(points[:, 3:6])
41
+
42
+ strike_vector = np.hstack([points[:, :3], strike_vector.T])
43
+ dip_vector = np.hstack([points[:, :3], dip_vector.T])
44
+ self.surfe.SetTangentConstraints(strike_vector)
45
+ self.surfe.SetTangentConstraints(dip_vector)
46
+
47
+
48
+ def add_norm_ctr_pts(self):
49
+ points = self.get_norm_constraints()
50
+ if points.shape[0]>0:
51
+ self.surfe.SetPlanarConstraints(points[:, :6])
52
+
53
+ def add_ctr_pts(self):
54
+
55
+ points = self.get_value_constraints()
56
+ if points.shape[0]> 0:
57
+ # self.surfe.SetInterfaceConstraints(points[:,:4])
58
+ for i in range(points.shape[0]):
59
+
60
+ self.surfe.AddInterfaceConstraint(points[i, 0], points[i, 1], points[i, 2], points[i, 3], )
61
+
62
+ def add_tangent_ctr_pts(self):
63
+ pass
64
+
65
+ def _solve(self, **kwargs):
66
+ self.surfe.ComputeInterpolant()
67
+
68
+ def _setup_interpolator(self, **kwargs):
69
+ self.add_gradient_ctr_pts()
70
+ self.add_norm_ctr_pts()
71
+ self.add_ctr_pts()
72
+ self.add_tangent_ctr_pts()
73
+
74
+ kernel = kwargs.get("kernel", 'r3')
75
+ logger.info("Setting surfe RBF kernel to %s" % kernel)
76
+ regression = kwargs.get("regression_smoothing", 0.)
77
+ if regression > 0:
78
+ logger.info("Using regression smoothing %f" % regression)
79
+ self.surfe.SetRegressionSmoothing(True,regression)
80
+ greedy = kwargs.get("greedy", (0, 0))
81
+
82
+ if greedy[0] > 0 or greedy[1] > 0:
83
+ logger.info("Using greedy algorithm: inferface %f and angular %f" %
84
+ (greedy[0], greedy[1]))
85
+ self.surfe.SetGreedyAlgorithm(True, greedy[0], greedy[1])
86
+ poly_order = kwargs.get('poly_order',None)
87
+ if poly_order:
88
+ logger.info("Setting poly order to %i"%poly_order)
89
+ self.surfe.SetPolynomialOrder(poly_order)
90
+ global_anisotropy = kwargs.get("anisotropy", False)
91
+ if global_anisotropy:
92
+ logger.info("Using global anisotropy")
93
+ self.surfe.SetGlobalAnisotropy(global_anisotropy)
94
+ radius = kwargs.get("radius",False)
95
+ if radius:
96
+ logger.info("Setting RBF radius to %f"%radius)
97
+ self.surfe.SetRBFShapeParameter(radius)
98
+
99
+ def update(self):
100
+ return self.surfe.InterpolantComputed()
101
+
102
+ def evaluate_value(self, evaluation_points):
103
+ evaluation_points = np.array(evaluation_points)
104
+ evaluated = np.zeros(evaluation_points.shape[0])
105
+ mask = np.any(evaluation_points == np.nan, axis=1)
106
+
107
+ if evaluation_points[~mask, :].shape[0] > 0:
108
+ evaluated[~mask] = self.surfe.EvaluateInterpolantAtPoints(
109
+ evaluation_points[~mask])
110
+ return evaluated
111
+ def evaluate_gradient(self, evaluation_points):
112
+ evaluation_points = np.array(evaluation_points)
113
+ evaluated = np.zeros(evaluation_points.shape)
114
+ mask = np.any(evaluation_points == np.nan, axis=1)
115
+ if evaluation_points[~mask, :].shape[0] > 0:
116
+ evaluated[~mask,:] = self.surfe.EvaluateVectorInterpolantAtPoints(
117
+ evaluation_points[~mask])
118
+ return evaluated
@@ -0,0 +1,46 @@
1
+ """
2
+ Geological modelling classes and functions
3
+
4
+ Main API for creating a GeologicalModel
5
+ =======================================
6
+ .. autosummary::
7
+ :toctree: _autosummary
8
+
9
+ core.geological_model
10
+
11
+ Geological Features
12
+ ===================
13
+ .. autosummary::
14
+ :toctree: _autosummary
15
+
16
+ features.geological_feature
17
+ features.geological_feature_builder
18
+ features.region_feature
19
+ features.unconformity_feature
20
+ features.structural_frame
21
+ features.structural_frame_builder
22
+
23
+ Folding classes
24
+ ===============
25
+ .. autosummary::
26
+ :toctree: _autosummary
27
+
28
+ fold.fold
29
+ fold.fold_rotation_angle
30
+ fold.fold_rotation_angle_feature
31
+ fold.foldframe
32
+ fold.svariogram
33
+
34
+
35
+ Fault classes
36
+ ===============
37
+
38
+ .. autosummary::
39
+ :toctree: _autosummary
40
+
41
+ fault.fault_segment
42
+ fault.fault_function
43
+ fault.fault_function_feature
44
+
45
+ """
46
+
File without changes