LoopStructural 1.0.9__cp39-cp39-win_amd64.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.
- LoopStructural/__init__.py +36 -0
- LoopStructural/analysis/__init__.py +2 -0
- LoopStructural/analysis/_fault_displacement.py +67 -0
- LoopStructural/analysis/_fault_intersection.py +36 -0
- LoopStructural/analysis/_plane_fit.py +43 -0
- LoopStructural/datasets/__init__.py +12 -0
- LoopStructural/datasets/_base.py +65 -0
- LoopStructural/datasets/data/claudius.csv +21049 -0
- LoopStructural/datasets/data/claudiusbb.txt +2 -0
- LoopStructural/datasets/data/duplex.csv +126 -0
- LoopStructural/datasets/data/duplexbb.txt +2 -0
- LoopStructural/datasets/data/intrusion.csv +1017 -0
- LoopStructural/datasets/data/intrusionbb.txt +2 -0
- LoopStructural/datasets/data/onefoldbb.txt +2 -0
- LoopStructural/datasets/data/onefolddata.csv +2226 -0
- LoopStructural/datasets/data/refolded_bb.txt +2 -0
- LoopStructural/datasets/data/refolded_fold.csv +2126 -0
- LoopStructural/interpolators/__init__.py +34 -0
- LoopStructural/interpolators/base_structured_3d_support.py +101 -0
- LoopStructural/interpolators/cython/__init__.py +0 -0
- LoopStructural/interpolators/cython/dsi_helper.c +31046 -0
- LoopStructural/interpolators/cython/dsi_helper.cp39-win_amd64.pyd +0 -0
- LoopStructural/interpolators/discrete_fold_interpolator.py +202 -0
- LoopStructural/interpolators/discrete_interpolator.py +584 -0
- LoopStructural/interpolators/finite_difference_interpolator.py +399 -0
- LoopStructural/interpolators/geological_interpolator.py +197 -0
- LoopStructural/interpolators/operator.py +61 -0
- LoopStructural/interpolators/piecewiselinear_interpolator.py +437 -0
- LoopStructural/interpolators/structured_grid.py +421 -0
- LoopStructural/interpolators/structured_tetra.py +681 -0
- LoopStructural/interpolators/surfe_wrapper.py +118 -0
- LoopStructural/modelling/__init__.py +46 -0
- LoopStructural/modelling/core/__init__.py +0 -0
- LoopStructural/modelling/core/geological_model.py +1513 -0
- LoopStructural/modelling/core/geological_model_graph.py +880 -0
- LoopStructural/modelling/core/stratigraphic_column.py +5 -0
- LoopStructural/modelling/fault/__init__.py +4 -0
- LoopStructural/modelling/fault/fault_builder.py +143 -0
- LoopStructural/modelling/fault/fault_function.py +188 -0
- LoopStructural/modelling/fault/fault_function_feature.py +76 -0
- LoopStructural/modelling/fault/fault_segment.py +298 -0
- LoopStructural/modelling/features/__init__.py +8 -0
- LoopStructural/modelling/features/cross_product_geological_feature.py +90 -0
- LoopStructural/modelling/features/geological_feature.py +252 -0
- LoopStructural/modelling/features/geological_feature_builder.py +414 -0
- LoopStructural/modelling/features/lambda_geological_feature.py +36 -0
- LoopStructural/modelling/features/region_feature.py +34 -0
- LoopStructural/modelling/features/structural_frame.py +133 -0
- LoopStructural/modelling/features/structural_frame_builder.py +206 -0
- LoopStructural/modelling/features/unconformity_feature.py +74 -0
- LoopStructural/modelling/fold/__init__.py +8 -0
- LoopStructural/modelling/fold/fold.py +143 -0
- LoopStructural/modelling/fold/fold_rotation_angle.py +133 -0
- LoopStructural/modelling/fold/fold_rotation_angle_feature.py +58 -0
- LoopStructural/modelling/fold/foldframe.py +193 -0
- LoopStructural/modelling/fold/svariogram.py +180 -0
- LoopStructural/utils/__init__.py +18 -0
- LoopStructural/utils/bounding_box.py +21 -0
- LoopStructural/utils/exceptions.py +10 -0
- LoopStructural/utils/helper.py +382 -0
- LoopStructural/utils/logging.py +60 -0
- LoopStructural/utils/map2loop.py +353 -0
- LoopStructural/utils/regions.py +11 -0
- LoopStructural/utils/utils.py +69 -0
- LoopStructural/visualisation/__init__.py +31 -0
- LoopStructural/visualisation/map_viewer.py +322 -0
- LoopStructural/visualisation/model_plotter.py +17 -0
- LoopStructural/visualisation/model_visualisation.py +1113 -0
- LoopStructural/visualisation/rotation_angle_plotter.py +83 -0
- LoopStructural/visualisation/sphinx_scraper.py +34 -0
- LoopStructural/visualisation/stratigraphic_column.py +60 -0
- LoopStructural-1.0.9.dist-info/LICENSE +21 -0
- LoopStructural-1.0.9.dist-info/METADATA +19 -0
- LoopStructural-1.0.9.dist-info/RECORD +77 -0
- LoopStructural-1.0.9.dist-info/WHEEL +5 -0
- LoopStructural-1.0.9.dist-info/top_level.txt +2 -0
- 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
|