LoopStructural 1.0.3__zip → 1.0.71.dev0__zip
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.
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/__init__.py +12 -7
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/__pycache__/__init__.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/datasets/__pycache__/__init__.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/datasets/__pycache__/_base.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__init__.py +3 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/__init__.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/base_structured_3d_support.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/discrete_fold_interpolator.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/discrete_interpolator.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/finite_difference_interpolator.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/geological_interpolator.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/operator.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/piecewiselinear_interpolator.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/structured_grid.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/structured_tetra.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/surfe_wrapper.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/base_structured_3d_support.py +101 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/cython/__pycache__/__init__.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/cython/dsi_helper.c +4137 -2716
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/cython/dsi_helper.cp36-win_amd64.pyd +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/discrete_fold_interpolator.py +56 -22
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/discrete_interpolator.py +61 -28
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/finite_difference_interpolator.py +71 -11
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/geological_interpolator.py +22 -3
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/operator.py +16 -1
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/piecewiselinear_interpolator.py +150 -11
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/structured_grid.py +31 -69
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/structured_tetra.py +89 -45
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/surfe_wrapper.py +7 -8
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/__pycache__/__init__.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/core/__pycache__/__init__.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/core/__pycache__/geological_model.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/core/__pycache__/geological_model_graph.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/core/__pycache__/stratigraphic_column.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/core/geological_model.py +515 -197
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/core/geological_model_graph.py +881 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/core/stratigraphic_column.py +5 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fault/__init__.py +1 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fault/__pycache__/__init__.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fault/__pycache__/fault_builder.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fault/__pycache__/fault_function.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fault/__pycache__/fault_function_feature.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fault/__pycache__/fault_segment.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fault/fault_builder.py +127 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fault/fault_function.py +2 -1
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fault/fault_function_feature.py +2 -1
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fault/fault_segment.py +30 -3
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/__init__.py +1 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/__pycache__/__init__.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/__pycache__/cross_product_geological_feature.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/__pycache__/geological_feature.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/__pycache__/geological_feature_builder.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/__pycache__/lambda_geological_feature.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/__pycache__/region_feature.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/__pycache__/structural_frame.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/__pycache__/structural_frame_builder.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/__pycache__/unconformity_feature.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/cross_product_geological_feature.py +18 -5
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/geological_feature.py +22 -49
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/geological_feature_builder.py +171 -47
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/lambda_geological_feature.py +31 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/region_feature.py +3 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/structural_frame.py +28 -11
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/structural_frame_builder.py +32 -22
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/unconformity_feature.py +6 -1
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fold/__pycache__/__init__.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fold/__pycache__/fold.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fold/__pycache__/fold_rotation_angle.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fold/__pycache__/fold_rotation_angle_feature.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fold/__pycache__/foldframe.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fold/__pycache__/svariogram.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fold/fold.py +13 -5
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fold/fold_rotation_angle.py +5 -4
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fold/fold_rotation_angle_feature.py +2 -1
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fold/foldframe.py +7 -5
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fold/svariogram.py +2 -1
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/__init__.py +5 -1
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/__pycache__/__init__.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/__pycache__/bounding_box.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/__pycache__/exceptions.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/__pycache__/helper.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/__pycache__/logging.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/__pycache__/map2loop.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/__pycache__/regions.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/__pycache__/utils.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/bounding_box.py +21 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/exceptions.py +2 -1
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/helper.py +10 -2
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/logging.py +60 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/map2loop.py +128 -37
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/regions.py +11 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/utils.py +40 -47
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/__pycache__/__init__.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/__pycache__/map_viewer.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/__pycache__/model_plotter.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/__pycache__/model_visualisation.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/__pycache__/rotation_angle_plotter.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/__pycache__/sphinx_scraper.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/__pycache__/stratigraphic_column.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/map_viewer.py +236 -36
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/model_plotter.py +2 -1
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/model_visualisation.py +427 -79
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/rotation_angle_plotter.py +29 -12
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/stratigraphic_column.py +60 -0
- Miniconda/envs/loop/Lib/site-packages/{LoopStructural-1.0.3-py3.6.egg-info → LoopStructural-1.0.71.dev0-py3.6.egg-info}/PKG-INFO +1 -1
- Miniconda/envs/loop/Lib/site-packages/{LoopStructural-1.0.3-py3.6.egg-info → LoopStructural-1.0.71.dev0-py3.6.egg-info}/SOURCES.txt +10 -5
- Miniconda/envs/loop/Lib/site-packages/LoopStructural-1.0.71.dev0-py3.6.egg-info/requires.txt +8 -0
- Miniconda/envs/loop/Lib/site-packages/tests/__pycache__/__init__.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural-1.0.3-py3.6.egg-info/requires.txt +0 -3
- Miniconda/envs/loop/Lib/site-packages/tests/__pycache__/test_faults.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/tests/__pycache__/test_fold.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/tests/__pycache__/test_interpolator.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/tests/__pycache__/test_refolded.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/tests/test_faults.py +0 -17
- Miniconda/envs/loop/Lib/site-packages/tests/test_fold.py +0 -57
- Miniconda/envs/loop/Lib/site-packages/tests/test_interpolator.py +0 -88
- Miniconda/envs/loop/Lib/site-packages/tests/test_refolded.py +0 -22
- /Miniconda/envs/loop/Lib/site-packages/{LoopStructural-1.0.3-py3.6.egg-info → LoopStructural-1.0.71.dev0-py3.6.egg-info}/dependency_links.txt +0 -0
- /Miniconda/envs/loop/Lib/site-packages/{LoopStructural-1.0.3-py3.6.egg-info → LoopStructural-1.0.71.dev0-py3.6.egg-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
from ..features.structural_frame_builder import StructuralFrameBuilder
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
class FaultBuilder(StructuralFrameBuilder):
|
|
5
|
+
def __init__(self,interpolator=None,interpolators=None,**kwargs):
|
|
6
|
+
"""A specialised structural frame builder for building a fault
|
|
7
|
+
|
|
8
|
+
Parameters
|
|
9
|
+
----------
|
|
10
|
+
interpolator : GeologicalInterpolator, optional
|
|
11
|
+
the interpolator to use for building the fault frame, by default None
|
|
12
|
+
interpolators : [GeologicalInterpolator, GeologicalInterpolator, GeologicalInterpolator], optional
|
|
13
|
+
a list of interpolators to use for building the fault frame, by default None
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
StructuralFrameBuilder.__init__(self,interpolator,interpolators,**kwargs)
|
|
17
|
+
self.origin = np.array([np.nan,np.nan,np.nan])
|
|
18
|
+
self.maximum = np.array([np.nan,np.nan,np.nan])
|
|
19
|
+
|
|
20
|
+
def update_geometry(self,points):
|
|
21
|
+
self.origin = np.nanmin(np.array([np.min(points,axis=0),self.origin]),axis=0)
|
|
22
|
+
self.maximum = np.nanmax(np.array([np.max(points,axis=0),self.maximum]),axis=0)
|
|
23
|
+
|
|
24
|
+
def create_data_from_geometry(self,
|
|
25
|
+
data,
|
|
26
|
+
fault_center,
|
|
27
|
+
normal_vector,
|
|
28
|
+
slip_vector,
|
|
29
|
+
influence_distance = None,
|
|
30
|
+
horizontal_radius = None,
|
|
31
|
+
vertical_radius = None):
|
|
32
|
+
"""Generate the required data for building a fault frame for a fault with the
|
|
33
|
+
specified parameters
|
|
34
|
+
|
|
35
|
+
Parameters
|
|
36
|
+
----------
|
|
37
|
+
data : DataFrame,
|
|
38
|
+
model data
|
|
39
|
+
fault_center : np.array(3)
|
|
40
|
+
x,y,z coordinates of the fault center
|
|
41
|
+
normal_vector : np.array(3)
|
|
42
|
+
x,y,z components of normal vector to fault, single observation usually
|
|
43
|
+
average direction
|
|
44
|
+
slip_vector : np.array(3)
|
|
45
|
+
x,y,z components of slip vector for the fault, single observation usually
|
|
46
|
+
average direction
|
|
47
|
+
influence_distance : double
|
|
48
|
+
distance away from fault for the fault volume
|
|
49
|
+
horizontal_radius : double
|
|
50
|
+
fault extent
|
|
51
|
+
vertical_radius : double
|
|
52
|
+
fault volume radius in the slip direction
|
|
53
|
+
"""
|
|
54
|
+
normal_vector/=np.linalg.norm(normal_vector)
|
|
55
|
+
slip_vector/=np.linalg.norm(slip_vector)
|
|
56
|
+
strike_vector = np.cross(normal_vector,slip_vector)
|
|
57
|
+
fault_edges = np.zeros((2,3))
|
|
58
|
+
fault_tips = np.zeros((2,3))
|
|
59
|
+
fault_depth = np.zeros((2,3))
|
|
60
|
+
if fault_center is not None:
|
|
61
|
+
if influence_distance is not None:
|
|
62
|
+
fault_edges[0,:] = fault_center[:3]+normal_vector*influence_distance
|
|
63
|
+
fault_edges[1,:] = fault_center[:3]-normal_vector*influence_distance
|
|
64
|
+
self.update_geometry(fault_edges)
|
|
65
|
+
data.loc[len(data),['X','Y','Z','feature_name','val','coord']] = \
|
|
66
|
+
[fault_edges[0,0],fault_edges[0,1],fault_edges[0,2],self.name,1,0]
|
|
67
|
+
data.loc[len(data),['X','Y','Z','feature_name','val','coord']] = \
|
|
68
|
+
[fault_edges[1,0],fault_edges[1,1],fault_edges[1,2],self.name,-1,0]
|
|
69
|
+
if horizontal_radius is not None:
|
|
70
|
+
fault_tips[0,:] = fault_center[:3]+strike_vector*horizontal_radius
|
|
71
|
+
fault_tips[1,:] = fault_center[:3]-strike_vector*horizontal_radius
|
|
72
|
+
self.update_geometry(fault_tips)
|
|
73
|
+
data.loc[len(data),['X','Y','Z','feature_name','val','coord']] = \
|
|
74
|
+
[fault_tips[0,0],fault_tips[0,1],fault_tips[0,2],self.name,1,2]
|
|
75
|
+
data.loc[len(data),['X','Y','Z','feature_name','val','coord']] = \
|
|
76
|
+
[fault_tips[1,0],fault_tips[1,1],fault_tips[1,2],self.name,-1,2]
|
|
77
|
+
if vertical_radius is not None:
|
|
78
|
+
fault_depth[0,:] = fault_center[:3]+slip_vector*vertical_radius
|
|
79
|
+
fault_depth[1,:] = fault_center[:3]-slip_vector*vertical_radius
|
|
80
|
+
# data.loc[len(data),['X','Y','Z','feature_name','val','coord']] = \
|
|
81
|
+
# [fault_depth[0,0],fault_depth[0,1],fault_depth[0,2],self.name,1,1]
|
|
82
|
+
# data.loc[len(data),['X','Y','Z','feature_name','val','coord']] = \
|
|
83
|
+
# [fault_depth[1,0],fault_depth[1,1],fault_depth[1,2],self.name,-1,1]
|
|
84
|
+
self.update_geometry(fault_depth)
|
|
85
|
+
#TODO need to add data here
|
|
86
|
+
data.loc[len(data),['X','Y','Z','feature_name','nx','ny','nz','coord']] =\
|
|
87
|
+
[fault_center[0],fault_center[1],fault_center[2],self.name,slip_vector[0],slip_vector[1],slip_vector[2],1]
|
|
88
|
+
# add strike vector to constraint fault extent
|
|
89
|
+
data.loc[len(data),['X','Y','Z','feature_name','gx','gy','gz','coord']] = [fault_center[0],fault_center[1],fault_center[2],\
|
|
90
|
+
self.name, strike_vector[0], strike_vector[1], strike_vector[2], 2]
|
|
91
|
+
self.add_data_from_data_frame(data)
|
|
92
|
+
def set_mesh_geometry(self,buffer):
|
|
93
|
+
"""set the mesh geometry
|
|
94
|
+
|
|
95
|
+
Parameters
|
|
96
|
+
----------
|
|
97
|
+
buffer : double
|
|
98
|
+
percentage of length to add to edges
|
|
99
|
+
"""
|
|
100
|
+
length = self.maximum-self.origin
|
|
101
|
+
# origin = self.builders[0].interpolator.support.origin
|
|
102
|
+
# maximum = self.builders[0].interpolator.support.maximum#set_interpolation_geometry
|
|
103
|
+
# if origin[2]>self.origin[2]:
|
|
104
|
+
# origin[2]=self.origin[2]
|
|
105
|
+
# if maximum[2]<self.maximum[2]:
|
|
106
|
+
# maximum[2]=self.maximum[2]
|
|
107
|
+
# self.builders[0].set_interpolation_geometry(origin,maximum)
|
|
108
|
+
# for builder in self.builders:
|
|
109
|
+
# all three coordinates share the same support
|
|
110
|
+
self.builders[0].set_interpolation_geometry(self.origin-length*buffer,self.maximum+length*buffer)
|
|
111
|
+
|
|
112
|
+
def add_splay(self,splayregion,splay):
|
|
113
|
+
# for i in range(3):
|
|
114
|
+
# # work out the values of the nodes where we want hard
|
|
115
|
+
# # constraints
|
|
116
|
+
# idc = np.arange(0, interpolator.support.n_nodes)[
|
|
117
|
+
# kwargs['splayregion'](interpolator.support.nodes)]
|
|
118
|
+
# val = kwargs['splay'][i].evaluate_value(
|
|
119
|
+
# interpolator.support.nodes[
|
|
120
|
+
# kwargs['splayregion'](interpolator.support.nodes), :])
|
|
121
|
+
# mask = ~np.isnan(val)
|
|
122
|
+
# fault_frame_builder[i].interpolator.add_equality_constraints(
|
|
123
|
+
# idc[mask], val[mask])
|
|
124
|
+
pass
|
|
125
|
+
def update(self):
|
|
126
|
+
for i in range(3):
|
|
127
|
+
self.builders[i].update()
|
|
@@ -2,7 +2,8 @@ import logging
|
|
|
2
2
|
|
|
3
3
|
from LoopStructural.modelling.fault.fault_function_feature import FaultDisplacementFeature
|
|
4
4
|
from LoopStructural.modelling.fault.fault_function import BaseFault
|
|
5
|
-
|
|
5
|
+
from LoopStructural.utils import getLogger
|
|
6
|
+
logger = getLogger(__name__)
|
|
6
7
|
from concurrent.futures import ThreadPoolExecutor
|
|
7
8
|
import numpy as np
|
|
8
9
|
|
|
@@ -45,7 +46,8 @@ class FaultSegment:
|
|
|
45
46
|
if self.faultframe is not None:
|
|
46
47
|
self.displacementfeature = FaultDisplacementFeature(
|
|
47
48
|
self.faultframe, self.faultfunction, name = self.name)
|
|
48
|
-
|
|
49
|
+
self.builder = None
|
|
50
|
+
|
|
49
51
|
def __getitem__(self, item):
|
|
50
52
|
"""
|
|
51
53
|
|
|
@@ -58,7 +60,7 @@ class FaultSegment:
|
|
|
58
60
|
|
|
59
61
|
"""
|
|
60
62
|
return self.faultframe[item]
|
|
61
|
-
|
|
63
|
+
|
|
62
64
|
def set_model(self, model):
|
|
63
65
|
"""
|
|
64
66
|
Link a geological model to the feature
|
|
@@ -138,6 +140,10 @@ class FaultSegment:
|
|
|
138
140
|
|
|
139
141
|
return self.faultframe.features[0].evaluate_value(locations) > 0
|
|
140
142
|
|
|
143
|
+
def inside_volume(self,locations):
|
|
144
|
+
v = self.faultframe.evaluate_value(locations)
|
|
145
|
+
return np.all(np.logical_and(v > -1,v<1),axis=1)
|
|
146
|
+
|
|
141
147
|
def evaluate_value(self, locations):
|
|
142
148
|
"""
|
|
143
149
|
Return the value of the fault surface scalar field
|
|
@@ -192,6 +198,27 @@ class FaultSegment:
|
|
|
192
198
|
# need to scale with fault displacement
|
|
193
199
|
return self.faultframe[1].evaluate_gradient(locations[mask, :])
|
|
194
200
|
|
|
201
|
+
def evaluate_displacement(self, points):
|
|
202
|
+
newp = np.copy(points).astype(float)
|
|
203
|
+
# evaluate fault function for all points then define mask for only points affected by fault
|
|
204
|
+
with ThreadPoolExecutor(max_workers=8) as executor:
|
|
205
|
+
# all of these operations should be independent so just run as different threads
|
|
206
|
+
gx_future = executor.submit(self.faultframe.features[0].evaluate_value, newp)
|
|
207
|
+
gy_future = executor.submit(self.faultframe.features[1].evaluate_value, newp)
|
|
208
|
+
gz_future = executor.submit(self.faultframe.features[2].evaluate_value, newp)
|
|
209
|
+
gx = gx_future.result()
|
|
210
|
+
gy = gy_future.result()
|
|
211
|
+
gz = gz_future.result()
|
|
212
|
+
d = np.zeros(gx.shape)
|
|
213
|
+
mask = np.logical_and(~np.isnan(gx),~np.isnan(gy))
|
|
214
|
+
mask = np.logical_and(mask,~np.isnan(gz))
|
|
215
|
+
d[~mask] = 0
|
|
216
|
+
gx_mask = np.zeros_like(mask,dtype=bool)
|
|
217
|
+
gx_mask[mask] = gx[mask] > 0
|
|
218
|
+
d[gx_mask] = 1.
|
|
219
|
+
if self.faultfunction is not None:
|
|
220
|
+
d[mask] = self.faultfunction(gx[mask], gy[mask], gz[mask])
|
|
221
|
+
return d
|
|
195
222
|
def apply_to_points(self, points):
|
|
196
223
|
"""
|
|
197
224
|
Unfault the array of points
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# from .faulted_geological_feature import FaultedGeologicalFeature
|
|
2
2
|
from .geological_feature import GeologicalFeature
|
|
3
|
+
from .lambda_geological_feature import LambdaGeologicalFeature
|
|
3
4
|
from .geological_feature_builder import GeologicalFeatureInterpolator
|
|
4
5
|
from .region_feature import RegionFeature
|
|
5
6
|
from .structural_frame import StructuralFrame
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -7,7 +7,8 @@ import numpy as np
|
|
|
7
7
|
from LoopStructural.modelling.features.geological_feature import \
|
|
8
8
|
GeologicalFeature
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
from LoopStructural.utils import getLogger
|
|
11
|
+
logger = getLogger(__name__)
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class CrossProductGeologicalFeature(GeologicalFeature):
|
|
@@ -34,7 +35,7 @@ class CrossProductGeologicalFeature(GeologicalFeature):
|
|
|
34
35
|
super().__init__(name, None)
|
|
35
36
|
self.geological_feature_a = geological_feature_a
|
|
36
37
|
self.geological_feature_b = geological_feature_b
|
|
37
|
-
|
|
38
|
+
self.value_feature = None
|
|
38
39
|
def evaluate_gradient(self, locations):
|
|
39
40
|
"""
|
|
40
41
|
Calculate the gradient of the geological feature by using numpy to
|
|
@@ -49,8 +50,11 @@ class CrossProductGeologicalFeature(GeologicalFeature):
|
|
|
49
50
|
-------
|
|
50
51
|
|
|
51
52
|
"""
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
v1 = self.geological_feature_a.evaluate_gradient(locations)
|
|
54
|
+
# v1 /= np.linalg.norm(v1,axis=1)[:,None]
|
|
55
|
+
v2 = self.geological_feature_b.evaluate_gradient(locations)
|
|
56
|
+
# v2 /= np.linalg.norm(v2,axis=1)[:,None]
|
|
57
|
+
return np.cross(v1,v2,
|
|
54
58
|
axisa=1,
|
|
55
59
|
axisb=1)
|
|
56
60
|
|
|
@@ -65,13 +69,22 @@ class CrossProductGeologicalFeature(GeologicalFeature):
|
|
|
65
69
|
-------
|
|
66
70
|
|
|
67
71
|
"""
|
|
68
|
-
|
|
72
|
+
values = np.zeros(evaluation_points.shape[0])
|
|
73
|
+
if self.value_feature is not None:
|
|
74
|
+
values[:] = self.value_feature.evaluate_value(evaluation_points)
|
|
75
|
+
return values
|
|
69
76
|
|
|
70
77
|
def mean(self):
|
|
78
|
+
if self.value_feature:
|
|
79
|
+
return self.value_feature.mean()
|
|
71
80
|
return 0.
|
|
72
81
|
|
|
73
82
|
def min(self):
|
|
83
|
+
if self.value_feature:
|
|
84
|
+
return self.value_feature.min()
|
|
74
85
|
return 0.
|
|
75
86
|
|
|
76
87
|
def max(self):
|
|
88
|
+
if self.value_feature:
|
|
89
|
+
return self.value_feature.max()
|
|
77
90
|
return 0.
|
Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/geological_feature.py
CHANGED
|
@@ -5,7 +5,8 @@ import logging
|
|
|
5
5
|
|
|
6
6
|
import numpy as np
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
from LoopStructural.utils import getLogger
|
|
9
|
+
logger = getLogger(__name__)
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class GeologicalFeature:
|
|
@@ -40,14 +41,13 @@ class GeologicalFeature:
|
|
|
40
41
|
data :
|
|
41
42
|
region :
|
|
42
43
|
type :
|
|
43
|
-
faults :
|
|
44
|
+
faults : list
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
"""
|
|
47
48
|
self.name = name
|
|
48
49
|
self.interpolator = interpolator
|
|
49
50
|
self.ndim = 1
|
|
50
|
-
self.data = data
|
|
51
51
|
self.builder = builder
|
|
52
52
|
self.region = region
|
|
53
53
|
self.regions = []
|
|
@@ -94,7 +94,7 @@ class GeologicalFeature:
|
|
|
94
94
|
Parameters
|
|
95
95
|
----------
|
|
96
96
|
region : boolean function(x,y,z)
|
|
97
|
-
|
|
97
|
+
returns true if inside region, false if outside
|
|
98
98
|
can be passed as a lambda function e.g.
|
|
99
99
|
lambda pos : feature.evaluate_value(pos) > 0
|
|
100
100
|
|
|
@@ -104,19 +104,6 @@ class GeologicalFeature:
|
|
|
104
104
|
"""
|
|
105
105
|
self.regions.append(region)
|
|
106
106
|
|
|
107
|
-
def set_builder(self, builder):
|
|
108
|
-
"""
|
|
109
|
-
|
|
110
|
-
Parameters
|
|
111
|
-
----------
|
|
112
|
-
builder
|
|
113
|
-
|
|
114
|
-
Returns
|
|
115
|
-
-------
|
|
116
|
-
|
|
117
|
-
"""
|
|
118
|
-
self.builder = builder
|
|
119
|
-
|
|
120
107
|
def evaluate_value(self, evaluation_points):
|
|
121
108
|
"""
|
|
122
109
|
Evaluate the scalar field value of the geological feature at the locations
|
|
@@ -133,7 +120,10 @@ class GeologicalFeature:
|
|
|
133
120
|
numpy array containing evaluated values
|
|
134
121
|
|
|
135
122
|
"""
|
|
136
|
-
|
|
123
|
+
#TODO need to add a generic type checker for all methods
|
|
124
|
+
#if evaluation_points is not a numpy array try and convert
|
|
125
|
+
#otherwise error
|
|
126
|
+
self.builder.up_to_date()
|
|
137
127
|
# check if the points are within the display region
|
|
138
128
|
v = np.zeros(evaluation_points.shape[0])
|
|
139
129
|
v[:] = np.nan
|
|
@@ -161,6 +151,7 @@ class GeologicalFeature:
|
|
|
161
151
|
-------
|
|
162
152
|
|
|
163
153
|
"""
|
|
154
|
+
self.builder.up_to_date()
|
|
164
155
|
v = np.zeros(evaluation_points.shape)
|
|
165
156
|
v[:] = np.nan
|
|
166
157
|
mask = np.zeros(evaluation_points.shape[0]).astype(bool)
|
|
@@ -182,8 +173,10 @@ class GeologicalFeature:
|
|
|
182
173
|
|
|
183
174
|
Returns
|
|
184
175
|
-------
|
|
185
|
-
|
|
176
|
+
misfit : np.array(N,dtype=double)
|
|
177
|
+
dot product between interpolated gradient and constraints
|
|
186
178
|
"""
|
|
179
|
+
self.builder.up_to_date()
|
|
187
180
|
grad = self.interpolator.get_gradient_constraints()
|
|
188
181
|
norm = self.interpolator.get_norm_constraints()
|
|
189
182
|
|
|
@@ -205,8 +198,11 @@ class GeologicalFeature:
|
|
|
205
198
|
|
|
206
199
|
Returns
|
|
207
200
|
-------
|
|
208
|
-
|
|
201
|
+
misfit : np.array(N,dtype=double)
|
|
202
|
+
difference between interpolated scalar field and value constraints
|
|
209
203
|
"""
|
|
204
|
+
self.builder.up_to_date()
|
|
205
|
+
|
|
210
206
|
locations = self.interpolator.get_value_constraints()
|
|
211
207
|
diff = np.abs(locations[:, 3] - self.evaluate_value(locations[:, :3]))
|
|
212
208
|
diff/=(self.max()-self.min())
|
|
@@ -218,6 +214,8 @@ class GeologicalFeature:
|
|
|
218
214
|
|
|
219
215
|
Returns
|
|
220
216
|
-------
|
|
217
|
+
mean : double
|
|
218
|
+
average value of the feature evaluated on a (10,10,10) grid in model area
|
|
221
219
|
|
|
222
220
|
"""
|
|
223
221
|
if self.model is None:
|
|
@@ -229,7 +227,8 @@ class GeologicalFeature:
|
|
|
229
227
|
|
|
230
228
|
Returns
|
|
231
229
|
-------
|
|
232
|
-
|
|
230
|
+
min : double
|
|
231
|
+
min value of the feature evaluated on a (10,10,10) grid in model area
|
|
233
232
|
"""
|
|
234
233
|
if self.model is None:
|
|
235
234
|
return 0
|
|
@@ -242,38 +241,12 @@ class GeologicalFeature:
|
|
|
242
241
|
|
|
243
242
|
Returns
|
|
244
243
|
-------
|
|
245
|
-
|
|
244
|
+
max : double
|
|
245
|
+
max value of the feature evaluated on a (10,10,10) grid in model area
|
|
246
246
|
"""
|
|
247
247
|
if self.model is None:
|
|
248
248
|
return 0
|
|
249
249
|
return np.nanmax(
|
|
250
250
|
self.evaluate_value(self.model.regular_grid((10, 10, 10))))
|
|
251
251
|
|
|
252
|
-
def update(self):
|
|
253
|
-
"""
|
|
254
|
-
Calculate average of the support values
|
|
255
|
-
|
|
256
|
-
Returns
|
|
257
|
-
-------
|
|
258
|
-
|
|
259
|
-
"""
|
|
260
|
-
# re-run the interpolator and update the support.
|
|
261
|
-
# this is a bit clumsy and not abstract, i think
|
|
262
|
-
# if evaluating the property doesn't require the dictionary on
|
|
263
|
-
# the nodes and actually just uses the interpolator values this
|
|
264
|
-
# would be
|
|
265
|
-
# much better.
|
|
266
|
-
self.interpolator.up_to_date = False
|
|
267
|
-
self.interpolator.update()
|
|
268
|
-
|
|
269
|
-
def get_interpolator(self):
|
|
270
|
-
"""
|
|
271
|
-
Get the interpolator used to build this feature
|
|
272
|
-
|
|
273
|
-
Returns
|
|
274
|
-
-------
|
|
275
|
-
GeologicalInterpolator
|
|
276
|
-
"""
|
|
277
|
-
return self.interpolator
|
|
278
|
-
|
|
279
252
|
|