LoopStructural 1.0.1__zip → 1.0.3__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.
Potentially problematic release.
This version of LoopStructural might be problematic. Click here for more details.
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/__init__.py +1 -1
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/__pycache__/{__init__.cpython-37.pyc → __init__.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/datasets/__pycache__/{__init__.cpython-37.pyc → __init__.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/datasets/__pycache__/{_base.cpython-37.pyc → _base.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/{__init__.cpython-37.pyc → __init__.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/{discrete_fold_interpolator.cpython-37.pyc → discrete_fold_interpolator.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/{discrete_interpolator.cpython-37.pyc → 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-37.pyc → 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-37.pyc → piecewiselinear_interpolator.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/{structured_grid.cpython-37.pyc → 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-37.pyc → surfe_wrapper.cpython-36.pyc} +0 -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.cp36-win_amd64.pyd +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/discrete_interpolator.py +1 -1
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/finite_difference_interpolator.py +2 -2
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/piecewiselinear_interpolator.py +11 -13
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/__pycache__/{__init__.cpython-37.pyc → __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/geological_model.py +15 -8
- 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_function.cpython-37.pyc → fault_function.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fault/__pycache__/{fault_function_feature.cpython-37.pyc → fault_function_feature.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fault/__pycache__/{fault_segment.cpython-37.pyc → fault_segment.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/__pycache__/{__init__.cpython-37.pyc → __init__.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/__pycache__/{cross_product_geological_feature.cpython-37.pyc → cross_product_geological_feature.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/__pycache__/{geological_feature.cpython-37.pyc → 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__/{region_feature.cpython-37.pyc → region_feature.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/__pycache__/{structural_frame.cpython-37.pyc → structural_frame.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/__pycache__/{structural_frame_builder.cpython-37.pyc → structural_frame_builder.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/__pycache__/{unconformity_feature.cpython-37.pyc → unconformity_feature.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/geological_feature.py +3 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fold/__pycache__/{__init__.cpython-37.pyc → __init__.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fold/__pycache__/{fold.cpython-37.pyc → fold.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fold/__pycache__/{fold_rotation_angle.cpython-37.pyc → fold_rotation_angle.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fold/__pycache__/{fold_rotation_angle_feature.cpython-37.pyc → fold_rotation_angle_feature.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fold/__pycache__/{foldframe.cpython-37.pyc → foldframe.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fold/__pycache__/{svariogram.cpython-37.pyc → svariogram.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/__pycache__/{__init__.cpython-37.pyc → __init__.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/__pycache__/{exceptions.cpython-37.pyc → 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__/map2loop.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/__pycache__/{utils.cpython-37.pyc → utils.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/helper.py +3 -2
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/map2loop.py +38 -16
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/__pycache__/{__init__.cpython-37.pyc → __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-37.pyc → model_visualisation.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/__pycache__/{rotation_angle_plotter.cpython-37.pyc → rotation_angle_plotter.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/__pycache__/{sphinx_scraper.cpython-37.pyc → sphinx_scraper.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/model_visualisation.py +31 -3
- Miniconda/envs/loop/Lib/site-packages/{LoopStructural-1.0.1-py3.7.egg-info → LoopStructural-1.0.3-py3.6.egg-info}/PKG-INFO +1 -1
- Miniconda/envs/loop/Lib/site-packages/tests/__pycache__/__init__.cpython-36.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/tests/__pycache__/{test_faults.cpython-37.pyc → 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-37.pyc → test_interpolator.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/tests/__pycache__/{test_refolded.cpython-37.pyc → test_refolded.cpython-36.pyc} +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/finite_difference_interpolator.cpython-37.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/operator.cpython-37.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/__pycache__/structured_tetra.cpython-37.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/cython/__pycache__/__init__.cpython-37.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/cython/dsi_helper.cp37-win_amd64.pyd +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/core/__pycache__/__init__.cpython-37.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/core/__pycache__/geological_model.cpython-37.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/fault/__pycache__/__init__.cpython-37.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/__pycache__/geological_feature_builder.cpython-37.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/__pycache__/helper.cpython-37.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/__pycache__/map2loop.cpython-37.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/__pycache__/map_viewer.cpython-37.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/LoopStructural/visualisation/__pycache__/model_plotter.cpython-37.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/tests/__pycache__/__init__.cpython-37.pyc +0 -0
- Miniconda/envs/loop/Lib/site-packages/tests/__pycache__/test_fold.cpython-37.pyc +0 -0
- /Miniconda/envs/loop/Lib/site-packages/{LoopStructural-1.0.1-py3.7.egg-info → LoopStructural-1.0.3-py3.6.egg-info}/SOURCES.txt +0 -0
- /Miniconda/envs/loop/Lib/site-packages/{LoopStructural-1.0.1-py3.7.egg-info → LoopStructural-1.0.3-py3.6.egg-info}/dependency_links.txt +0 -0
- /Miniconda/envs/loop/Lib/site-packages/{LoopStructural-1.0.1-py3.7.egg-info → LoopStructural-1.0.3-py3.6.egg-info}/requires.txt +0 -0
- /Miniconda/envs/loop/Lib/site-packages/{LoopStructural-1.0.1-py3.7.egg-info → LoopStructural-1.0.3-py3.6.egg-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -148,7 +148,7 @@ class DiscreteInterpolator(GeologicalInterpolator):
|
|
|
148
148
|
B = np.array(B)
|
|
149
149
|
idc = np.array(idc)
|
|
150
150
|
if np.any(np.isnan(idc)) or np.any(np.isnan(A)) or np.any(np.isnan(B)):
|
|
151
|
-
logger.warning("Constraints contain nan not adding constraints")
|
|
151
|
+
logger.warning("Constraints contain nan not adding constraints: {}".format(name))
|
|
152
152
|
return
|
|
153
153
|
nr = A.shape[0]
|
|
154
154
|
if len(A.shape) > 2:
|
Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/finite_difference_interpolator.py
CHANGED
|
@@ -203,8 +203,8 @@ class FiniteDifferenceInterpolator(DiscreteInterpolator):
|
|
|
203
203
|
A = np.einsum('ij,ijk->ik', strike_vector.T, T)
|
|
204
204
|
|
|
205
205
|
B = np.zeros(points[inside, :].shape[0])
|
|
206
|
-
|
|
207
|
-
A
|
|
206
|
+
self.add_constraints_to_least_squares(A * w, B, idc[inside, :])
|
|
207
|
+
A = np.einsum('ij,ijk->ik', dip_vector.T, T)
|
|
208
208
|
self.add_constraints_to_least_squares(A * w, B, idc[inside, :])
|
|
209
209
|
|
|
210
210
|
def add_norm_constraint(self, w=1.):
|
Miniconda/envs/loop/Lib/site-packages/LoopStructural/interpolators/piecewiselinear_interpolator.py
CHANGED
|
@@ -154,12 +154,12 @@ class PiecewiseLinearInterpolator(DiscreteInterpolator):
|
|
|
154
154
|
idc = gi[tetras]
|
|
155
155
|
B = np.zeros(idc.shape[0])
|
|
156
156
|
outside = ~np.any(idc == -1, axis=1)
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
A+=A2
|
|
157
|
+
self.add_constraints_to_least_squares(A[outside, :] * w,
|
|
158
|
+
B[outside], idc[outside, :],
|
|
159
|
+
name = 'gradient')
|
|
160
|
+
A = np.einsum('ji,ijk->ik', dip_vector, element_gradients)
|
|
161
|
+
A *= vol[:, None]
|
|
162
|
+
# A+=A2
|
|
163
163
|
self.add_constraints_to_least_squares(A[outside, :] * w,
|
|
164
164
|
B[outside], idc[outside, :],
|
|
165
165
|
name='gradient')
|
|
@@ -192,8 +192,8 @@ class PiecewiseLinearInterpolator(DiscreteInterpolator):
|
|
|
192
192
|
# e, inside = self.support.elements_for_array(points[:, :3])
|
|
193
193
|
# nodes = self.support.nodes[self.support.elements[e]]
|
|
194
194
|
vol = np.zeros(element_gradients.shape[0])
|
|
195
|
-
vecs = vertices[
|
|
196
|
-
vol
|
|
195
|
+
vecs = vertices[:, 1:, :] - vertices[:, 0, None, :]
|
|
196
|
+
vol = np.abs(np.linalg.det(vecs)) # / 6
|
|
197
197
|
# d_t = self.support.get_elements_gradients(e)
|
|
198
198
|
norm = np.zeros((element_gradients.shape[0],element_gradients.shape[1]))
|
|
199
199
|
norm[inside,:] = np.linalg.norm(element_gradients[inside,:,:], axis=2)
|
|
@@ -201,10 +201,8 @@ class PiecewiseLinearInterpolator(DiscreteInterpolator):
|
|
|
201
201
|
|
|
202
202
|
d_t = element_gradients
|
|
203
203
|
d_t[inside,:,:] *= vol[inside, None, None]
|
|
204
|
-
# w*=10^11
|
|
205
|
-
|
|
206
204
|
# add in the element gradient matrix into the inte
|
|
207
|
-
idc = np.tile(tetras[
|
|
205
|
+
idc = np.tile(tetras[:,:], (3, 1, 1))
|
|
208
206
|
idc = idc.swapaxes(0,1)
|
|
209
207
|
# idc = self.support.elements[e]
|
|
210
208
|
gi = np.zeros(self.support.n_nodes).astype(int)
|
|
@@ -216,8 +214,8 @@ class PiecewiseLinearInterpolator(DiscreteInterpolator):
|
|
|
216
214
|
outside = outside[:, 0]
|
|
217
215
|
w /= 3
|
|
218
216
|
|
|
219
|
-
self.add_constraints_to_least_squares(d_t[
|
|
220
|
-
points[
|
|
217
|
+
self.add_constraints_to_least_squares(d_t[outside, :, :] * w,
|
|
218
|
+
points[outside, 3:6] * w *
|
|
221
219
|
vol[outside, None],
|
|
222
220
|
idc[outside],
|
|
223
221
|
name='norm')
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -230,7 +230,10 @@ class GeologicalModel:
|
|
|
230
230
|
self.data.loc[mask, 'strike'], self.data.loc[mask, 'dip'])
|
|
231
231
|
self.data.drop(['strike', 'dip'], axis=1, inplace=True)
|
|
232
232
|
# self.data.loc
|
|
233
|
-
|
|
233
|
+
# if 'nx' in self.data and 'ny' in self.data and 'nz' in self.data:
|
|
234
|
+
# mask = np.all(~np.isnan(self.data.loc[:, ['nx', 'ny','nz']]),
|
|
235
|
+
# axis=1)
|
|
236
|
+
# self.data.loc[mask,['nx', 'ny','nz']] /= self.scale_factor
|
|
234
237
|
def extend_model_data(self, newdata):
|
|
235
238
|
"""
|
|
236
239
|
Extends the data frame
|
|
@@ -314,16 +317,20 @@ class GeologicalModel:
|
|
|
314
317
|
# add a buffer to the interpolation domain, this is necessary for
|
|
315
318
|
# faults but also generally a good
|
|
316
319
|
# idea to avoid boundary problems
|
|
320
|
+
# buffer = bb[1, :]
|
|
321
|
+
buffer = (bb[1,:]-bb[0,:])*buffer
|
|
317
322
|
bb[0, :] -= buffer # *(bb[1,:]-bb[0,:])
|
|
318
323
|
bb[1, :] += buffer # *(bb[1,:]-bb[0,:])
|
|
324
|
+
box_vol = (bb[1, 0]-bb[0, 0]) * (bb[1, 1]-bb[0, 1]) * (bb[1, 2]-bb[0, 2])
|
|
319
325
|
if interpolatortype == "PLI":
|
|
320
326
|
nelements /= 5
|
|
321
|
-
ele_vol =
|
|
327
|
+
ele_vol = box_vol / nelements
|
|
322
328
|
# calculate the step vector of a regular cube
|
|
323
329
|
step_vector = np.zeros(3)
|
|
324
330
|
step_vector[:] = ele_vol ** (1. / 3.)
|
|
331
|
+
# step_vector /= np.array([1,1,2])
|
|
325
332
|
# number of steps is the length of the box / step vector
|
|
326
|
-
nsteps = ((bb[1, :] - bb[0, :]) / step_vector).astype(int)
|
|
333
|
+
nsteps = np.ceil((bb[1, :] - bb[0, :]) / step_vector).astype(int)
|
|
327
334
|
# create a structured grid using the origin and number of steps
|
|
328
335
|
mesh_id = 'mesh_{}'.format(nelements)
|
|
329
336
|
mesh = self.support.get(mesh_id,
|
|
@@ -338,12 +345,12 @@ class GeologicalModel:
|
|
|
338
345
|
|
|
339
346
|
if interpolatortype == 'FDI':
|
|
340
347
|
# find the volume of one element
|
|
341
|
-
ele_vol =
|
|
348
|
+
ele_vol = box_vol / nelements
|
|
342
349
|
# calculate the step vector of a regular cube
|
|
343
350
|
step_vector = np.zeros(3)
|
|
344
351
|
step_vector[:] = ele_vol ** (1. / 3.)
|
|
345
352
|
# number of steps is the length of the box / step vector
|
|
346
|
-
nsteps = ((bb[1, :] - bb[0, :]) / step_vector).astype(int)
|
|
353
|
+
nsteps = np.ceil((bb[1, :] - bb[0, :]) / step_vector).astype(int)
|
|
347
354
|
# create a structured grid using the origin and number of steps
|
|
348
355
|
grid_id = 'grid_{}'.format(nelements)
|
|
349
356
|
grid = self.support.get(grid_id, StructuredGrid(origin=bb[0, :],
|
|
@@ -357,12 +364,12 @@ class GeologicalModel:
|
|
|
357
364
|
|
|
358
365
|
if interpolatortype == "DFI": # "fold" in kwargs:
|
|
359
366
|
nelements /= 5
|
|
360
|
-
ele_vol =
|
|
367
|
+
ele_vol = box_vol / nelements
|
|
361
368
|
# calculate the step vector of a regular cube
|
|
362
369
|
step_vector = np.zeros(3)
|
|
363
370
|
step_vector[:] = ele_vol ** (1. / 3.)
|
|
364
371
|
# number of steps is the length of the box / step vector
|
|
365
|
-
nsteps = ((bb[1, :] - bb[0, :]) / step_vector).astype(int)
|
|
372
|
+
nsteps = np.ceil((bb[1, :] - bb[0, :]) / step_vector).astype(int)
|
|
366
373
|
# create a structured grid using the origin and number of steps
|
|
367
374
|
mesh = kwargs.get('mesh', TetMesh(origin=bb[0, :], nsteps=nsteps,
|
|
368
375
|
step_vector=step_vector))
|
|
@@ -1020,7 +1027,7 @@ class GeologicalModel:
|
|
|
1020
1027
|
"""
|
|
1021
1028
|
return {'bounding_box': self.bounding_box, 'nsteps': nsteps}
|
|
1022
1029
|
|
|
1023
|
-
def regular_grid(self, nsteps=(50, 50, 25), shuffle = True, rescale=
|
|
1030
|
+
def regular_grid(self, nsteps=(50, 50, 25), shuffle = True, rescale=False):
|
|
1024
1031
|
"""
|
|
1025
1032
|
Return a regular grid within the model bounding box
|
|
1026
1033
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
Miniconda/envs/loop/Lib/site-packages/LoopStructural/modelling/features/geological_feature.py
CHANGED
|
@@ -186,12 +186,15 @@ class GeologicalFeature:
|
|
|
186
186
|
"""
|
|
187
187
|
grad = self.interpolator.get_gradient_constraints()
|
|
188
188
|
norm = self.interpolator.get_norm_constraints()
|
|
189
|
+
|
|
189
190
|
dot = []
|
|
190
191
|
if grad.shape[0] > 0:
|
|
192
|
+
grad /=np.linalg.norm(grad,axis=1)[:,None]
|
|
191
193
|
model_grad = self.evaluate_gradient(grad[:,:3])
|
|
192
194
|
dot.append(np.einsum('ij,ij->i',model_grad,grad[:,:3:6]).tolist())
|
|
193
195
|
|
|
194
196
|
if norm.shape[0] > 0:
|
|
197
|
+
norm /=np.linalg.norm(norm,axis=1)[:,None]
|
|
195
198
|
model_norm = self.evaluate_gradient(norm[:, :3])
|
|
196
199
|
dot.append(np.einsum('ij,ij->i', model_norm, norm[:,:3:6]))
|
|
197
200
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/__pycache__/map2loop.cpython-36.pyc
ADDED
|
Binary file
|
|
Binary file
|
|
@@ -251,13 +251,14 @@ def create_box(bounding_box, nsteps):
|
|
|
251
251
|
return points, tri
|
|
252
252
|
|
|
253
253
|
def get_vectors(normal):
|
|
254
|
-
|
|
254
|
+
length = np.linalg.norm(normal,axis=1)[:,None]
|
|
255
|
+
normal /= length#np.linalg.norm(normal,axis=1)[:,None]
|
|
255
256
|
strikedip = normal_vector_to_strike_and_dip(normal)
|
|
256
257
|
strike_vec = get_strike_vector(strikedip[:, 0])
|
|
257
258
|
strike_vec /= np.linalg.norm(strike_vec,axis=0)[None,:]
|
|
258
259
|
dip_vec = np.cross(strike_vec, normal, axisa=0, axisb=1).T # (strikedip[:, 0], strikedip[:, 1])
|
|
259
260
|
dip_vec /= np.linalg.norm(dip_vec,axis=0)[None,:]
|
|
260
|
-
return strike_vec, dip_vec
|
|
261
|
+
return strike_vec*length.T, dip_vec*length.T
|
|
261
262
|
|
|
262
263
|
|
|
263
264
|
def get_strike_vector(strike):
|
|
@@ -20,7 +20,7 @@ def process_map2loop(m2l_directory, flags={}):
|
|
|
20
20
|
tangents = pd.read_csv(m2l_directory + '/tmp/raw_contacts.csv')
|
|
21
21
|
groups = pd.read_csv(m2l_directory + '/tmp/all_sorts.csv', index_col=0)
|
|
22
22
|
contact_orientations = pd.read_csv(m2l_directory + '/output/orientations.csv')
|
|
23
|
-
formation_thickness = pd.read_csv
|
|
23
|
+
# formation_thickness = pd.read_csv)
|
|
24
24
|
contacts = pd.read_csv(m2l_directory + '/output/contacts4.csv')
|
|
25
25
|
displacements = pd.read_csv(m2l_directory + '/output/fault_displacements3.csv')
|
|
26
26
|
fault_orientations = pd.read_csv(m2l_directory + '/output/fault_orientations.csv')
|
|
@@ -43,8 +43,10 @@ def process_map2loop(m2l_directory, flags={}):
|
|
|
43
43
|
except:
|
|
44
44
|
for g in groups['group'].unique():
|
|
45
45
|
supergroups[g] = g
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
try:
|
|
47
|
+
supergroups.pop('\n')
|
|
48
|
+
except KeyError:
|
|
49
|
+
pass
|
|
48
50
|
|
|
49
51
|
|
|
50
52
|
bb = pd.read_csv(m2l_directory+'/tmp/bbox.csv')
|
|
@@ -56,19 +58,38 @@ def process_map2loop(m2l_directory, flags={}):
|
|
|
56
58
|
tangents.drop(['angle', 'lsx', 'lsy'], inplace=True, axis=1)
|
|
57
59
|
|
|
58
60
|
# convert azimuth and dip to gx, gy, gz
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
# calculate scalar field values
|
|
64
|
+
i = 0
|
|
65
|
+
thickness = {}
|
|
66
|
+
max_thickness = 0
|
|
67
|
+
with open(m2l_directory + '/output/formation_summary_thicknesses.csv') as file:
|
|
68
|
+
for l in file:
|
|
69
|
+
if i>1:
|
|
70
|
+
linesplit = l.split(',')
|
|
71
|
+
thickness[linesplit[0]] = float(linesplit[1])
|
|
72
|
+
# normalise the thicknesses
|
|
73
|
+
if float(linesplit[1]) > max_thickness:
|
|
74
|
+
max_thickness=float(linesplit[1])
|
|
75
|
+
# print(l.split(',')[1])
|
|
76
|
+
i+=1
|
|
77
|
+
# for k in thickness.keys():
|
|
78
|
+
# thickness[k] /= max_thickness
|
|
79
|
+
|
|
59
80
|
from LoopStructural.utils.helper import strike_dip_vector
|
|
60
81
|
contact_orientations['strike'] = contact_orientations['azimuth'] - 90
|
|
61
|
-
contact_orientations['
|
|
62
|
-
contact_orientations['
|
|
63
|
-
contact_orientations['
|
|
64
|
-
contact_orientations[['
|
|
65
|
-
contact_orientations['dip'])
|
|
82
|
+
contact_orientations['nx'] = np.nan
|
|
83
|
+
contact_orientations['ny'] = np.nan
|
|
84
|
+
contact_orientations['nz'] = np.nan
|
|
85
|
+
contact_orientations[['nx', 'ny', 'nz']] = strike_dip_vector(contact_orientations['strike'],
|
|
86
|
+
contact_orientations['dip'])*max_thickness
|
|
66
87
|
contact_orientations.drop(['strike', 'dip', 'azimuth'], inplace=True, axis=1)
|
|
88
|
+
# with open(m2l_directory + '/output/formation_summary_thicknesses.csv') as file:
|
|
67
89
|
|
|
68
|
-
#
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
thickness[f] = np.mean(formation_thickness[formation_thickness['formation'] == f]['thickness'])
|
|
90
|
+
# thickness = {}
|
|
91
|
+
# for f in formation_thickness['formation'].unique():
|
|
92
|
+
# thickness[f] = formation_thickness[formation_thickness['formation'] == f]['thickness'])
|
|
72
93
|
|
|
73
94
|
strat_val = {}
|
|
74
95
|
stratigraphic_column = {}
|
|
@@ -83,10 +104,10 @@ def process_map2loop(m2l_directory, flags={}):
|
|
|
83
104
|
for c in groups.loc[groups['group number'] == i, 'code']:
|
|
84
105
|
strat_val[c] = np.nan
|
|
85
106
|
if c in thickness:
|
|
86
|
-
stratigraphic_column[g][c] = {'
|
|
107
|
+
stratigraphic_column[g][c] = {'max': val[g], 'min': val[g] - thickness[c], 'id': unit_id}
|
|
87
108
|
unit_id += 1
|
|
88
109
|
strat_val[c] = val[g]
|
|
89
|
-
val[g]
|
|
110
|
+
val[g] -= thickness[c]
|
|
90
111
|
group_name = None
|
|
91
112
|
for g, i in stratigraphic_column.items():
|
|
92
113
|
if len(i) ==0:
|
|
@@ -159,7 +180,7 @@ def process_map2loop(m2l_directory, flags={}):
|
|
|
159
180
|
'bounding_box':bb,
|
|
160
181
|
'strat_va':strat_val}
|
|
161
182
|
|
|
162
|
-
def build_model(m2l_data, skip_faults = False, unconformities=False, fault_params = None, foliation_params=None):
|
|
183
|
+
def build_model(m2l_data, skip_faults = False, unconformities=False, fault_params = None, foliation_params=None, rescale = True):
|
|
163
184
|
"""[summary]
|
|
164
185
|
|
|
165
186
|
[extended_summary]
|
|
@@ -191,7 +212,8 @@ def build_model(m2l_data, skip_faults = False, unconformities=False, fault_param
|
|
|
191
212
|
boundary_points[1, 1] = m2l_data['bounding_box']['maxy']
|
|
192
213
|
boundary_points[1, 2] = m2l_data['bounding_box']['upper']
|
|
193
214
|
|
|
194
|
-
model = GeologicalModel(boundary_points[0, :], boundary_points[1, :])
|
|
215
|
+
model = GeologicalModel(boundary_points[0, :], boundary_points[1, :], rescale=rescale)
|
|
216
|
+
# m2l_data['data']['val'] /= model.scale_factor
|
|
195
217
|
model.set_model_data(m2l_data['data'])
|
|
196
218
|
if not skip_faults:
|
|
197
219
|
faults = []
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -74,6 +74,8 @@ class LavaVuModelViewer:
|
|
|
74
74
|
|
|
75
75
|
[extended_summary]
|
|
76
76
|
"""
|
|
77
|
+
self.lv.clear()
|
|
78
|
+
self.lv.cleardata()
|
|
77
79
|
pass
|
|
78
80
|
|
|
79
81
|
def add_section(self, geological_feature=None, axis='x', value=None, **kwargs):
|
|
@@ -191,7 +193,7 @@ class LavaVuModelViewer:
|
|
|
191
193
|
# do isosurfacing of support using marching tetras/cubes
|
|
192
194
|
x = np.linspace(self.bounding_box[0, 0], self.bounding_box[1, 0], self.nsteps[0])
|
|
193
195
|
y = np.linspace(self.bounding_box[0, 1], self.bounding_box[1, 1], self.nsteps[1])
|
|
194
|
-
z = np.linspace(self.bounding_box[
|
|
196
|
+
z = np.linspace(self.bounding_box[1, 2], self.bounding_box[0, 2], self.nsteps[2])
|
|
195
197
|
xx, yy, zz = np.meshgrid(x, y, z, indexing='ij')
|
|
196
198
|
points = np.array([xx.flatten(), yy.flatten(), zz.flatten()]).T
|
|
197
199
|
val = geological_feature.evaluate_value(points)
|
|
@@ -521,7 +523,7 @@ class LavaVuModelViewer:
|
|
|
521
523
|
if "pointsize" not in kwargs:
|
|
522
524
|
kwargs["pointsize"] = 4
|
|
523
525
|
# set the colour map to diverge unless user decides otherwise
|
|
524
|
-
cmap = kwargs.get('cmap', "
|
|
526
|
+
cmap = kwargs.get('cmap', "spot")
|
|
525
527
|
p = self.lv.points(name, **kwargs)
|
|
526
528
|
p.vertices(position)
|
|
527
529
|
p.values(value, "v")
|
|
@@ -576,6 +578,7 @@ class LavaVuModelViewer:
|
|
|
576
578
|
self.lv.control.ObjectList()
|
|
577
579
|
self.lv.interactive()
|
|
578
580
|
|
|
581
|
+
|
|
579
582
|
def set_zscale(self,zscale):
|
|
580
583
|
""" Set the vertical scale for lavavu
|
|
581
584
|
|
|
@@ -617,7 +620,7 @@ class LavaVuModelViewer:
|
|
|
617
620
|
"""
|
|
618
621
|
self.lv.image(fname, **kwargs)
|
|
619
622
|
|
|
620
|
-
def display(self):
|
|
623
|
+
def display(self, fname=None, **kwargs):
|
|
621
624
|
"""
|
|
622
625
|
Calls the lv object display function. Shows a static image of the viewer inline.
|
|
623
626
|
|
|
@@ -625,6 +628,9 @@ class LavaVuModelViewer:
|
|
|
625
628
|
-------
|
|
626
629
|
|
|
627
630
|
"""
|
|
631
|
+
if fname:
|
|
632
|
+
self.lv.image(fname, **kwargs)
|
|
633
|
+
|
|
628
634
|
self.lv.display()
|
|
629
635
|
|
|
630
636
|
def image(self, name, **kwargs):
|
|
@@ -702,3 +708,25 @@ class LavaVuModelViewer:
|
|
|
702
708
|
|
|
703
709
|
"""
|
|
704
710
|
self.lv.rotate(r)
|
|
711
|
+
|
|
712
|
+
@property
|
|
713
|
+
def rotation(self):
|
|
714
|
+
"""Accessor for the viewer rotation
|
|
715
|
+
Returns
|
|
716
|
+
-------
|
|
717
|
+
list
|
|
718
|
+
x,y,z rotations
|
|
719
|
+
"""
|
|
720
|
+
return self.lv['xyzrotate']
|
|
721
|
+
|
|
722
|
+
@rotation.setter
|
|
723
|
+
def rotation(self,xyz):
|
|
724
|
+
"""Set the rotation of the viewer
|
|
725
|
+
|
|
726
|
+
Parameters
|
|
727
|
+
----------
|
|
728
|
+
xyz : list like
|
|
729
|
+
x y z rotations
|
|
730
|
+
"""
|
|
731
|
+
self.lv.rotation(xyz)
|
|
732
|
+
|
|
index e984d0f..8c05a73 100644
|
|
|
Binary file
|
|
index 6f155c8..273fecb 100644
|
|
|
Binary file
|
|
index 06d9eff..762fb23 100644
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/__pycache__/helper.cpython-37.pyc
DELETED
|
Binary file
|
Miniconda/envs/loop/Lib/site-packages/LoopStructural/utils/__pycache__/map2loop.cpython-37.pyc
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|