LoopStructural 1.6.23__tar.gz
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-1.6.23/LICENSE +21 -0
- loopstructural-1.6.23/LoopStructural/__init__.py +102 -0
- loopstructural-1.6.23/LoopStructural/datasets/__init__.py +24 -0
- loopstructural-1.6.23/LoopStructural/datasets/_base.py +342 -0
- loopstructural-1.6.23/LoopStructural/datasets/_example_models.py +10 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/claudius.csv +21049 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/claudiusbb.txt +2 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/duplex.csv +126 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/duplexbb.txt +2 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/fault_trace/fault_trace.cpg +1 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/fault_trace/fault_trace.dbf +0 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/fault_trace/fault_trace.prj +1 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/fault_trace/fault_trace.shp +0 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/fault_trace/fault_trace.shx +0 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/bbox.csv +2 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/contacts.csv +657 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/fault_displacement.csv +7 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/fault_edges.txt +2 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/fault_locations.csv +79 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/fault_orientations.csv +19 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/stratigraphic_order.csv +13 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/stratigraphic_orientations.csv +207 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/stratigraphic_thickness.csv +13 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/intrusion.csv +1017 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/intrusionbb.txt +2 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/onefoldbb.txt +2 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/onefolddata.csv +2226 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/refolded_bb.txt +2 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/refolded_fold.csv +205 -0
- loopstructural-1.6.23/LoopStructural/datasets/data/tabular_intrusion.csv +23 -0
- loopstructural-1.6.23/LoopStructural/datatypes/__init__.py +4 -0
- loopstructural-1.6.23/LoopStructural/datatypes/_bounding_box.py +690 -0
- loopstructural-1.6.23/LoopStructural/datatypes/_point.py +232 -0
- loopstructural-1.6.23/LoopStructural/datatypes/_structured_grid.py +192 -0
- loopstructural-1.6.23/LoopStructural/datatypes/_surface.py +248 -0
- loopstructural-1.6.23/LoopStructural/export/exporters.py +554 -0
- loopstructural-1.6.23/LoopStructural/export/file_formats.py +15 -0
- loopstructural-1.6.23/LoopStructural/export/geoh5.py +102 -0
- loopstructural-1.6.23/LoopStructural/export/gocad.py +126 -0
- loopstructural-1.6.23/LoopStructural/export/omf_wrapper.py +116 -0
- loopstructural-1.6.23/LoopStructural/interpolators/__init__.py +132 -0
- loopstructural-1.6.23/LoopStructural/interpolators/_api.py +211 -0
- loopstructural-1.6.23/LoopStructural/interpolators/_builders.py +149 -0
- loopstructural-1.6.23/LoopStructural/interpolators/_constant_norm.py +205 -0
- loopstructural-1.6.23/LoopStructural/interpolators/_cython/__init__.py +0 -0
- loopstructural-1.6.23/LoopStructural/interpolators/_discrete_fold_interpolator.py +190 -0
- loopstructural-1.6.23/LoopStructural/interpolators/_discrete_interpolator.py +760 -0
- loopstructural-1.6.23/LoopStructural/interpolators/_finite_difference_interpolator.py +519 -0
- loopstructural-1.6.23/LoopStructural/interpolators/_geological_interpolator.py +549 -0
- loopstructural-1.6.23/LoopStructural/interpolators/_interpolator_builder.py +134 -0
- loopstructural-1.6.23/LoopStructural/interpolators/_interpolator_factory.py +77 -0
- loopstructural-1.6.23/LoopStructural/interpolators/_interpolatortype.py +22 -0
- loopstructural-1.6.23/LoopStructural/interpolators/_operator.py +38 -0
- loopstructural-1.6.23/LoopStructural/interpolators/_p1interpolator.py +233 -0
- loopstructural-1.6.23/LoopStructural/interpolators/_p2interpolator.py +278 -0
- loopstructural-1.6.23/LoopStructural/interpolators/_surfe_wrapper.py +210 -0
- loopstructural-1.6.23/LoopStructural/interpolators/supports/_2d_base_unstructured.py +359 -0
- loopstructural-1.6.23/LoopStructural/interpolators/supports/_2d_p1_unstructured.py +68 -0
- loopstructural-1.6.23/LoopStructural/interpolators/supports/_2d_p2_unstructured.py +288 -0
- loopstructural-1.6.23/LoopStructural/interpolators/supports/_2d_structured_grid.py +516 -0
- loopstructural-1.6.23/LoopStructural/interpolators/supports/_2d_structured_tetra.py +0 -0
- loopstructural-1.6.23/LoopStructural/interpolators/supports/_3d_base_structured.py +527 -0
- loopstructural-1.6.23/LoopStructural/interpolators/supports/_3d_p2_tetra.py +331 -0
- loopstructural-1.6.23/LoopStructural/interpolators/supports/_3d_structured_grid.py +499 -0
- loopstructural-1.6.23/LoopStructural/interpolators/supports/_3d_structured_tetra.py +754 -0
- loopstructural-1.6.23/LoopStructural/interpolators/supports/_3d_unstructured_tetra.py +651 -0
- loopstructural-1.6.23/LoopStructural/interpolators/supports/__init__.py +62 -0
- loopstructural-1.6.23/LoopStructural/interpolators/supports/_aabb.py +77 -0
- loopstructural-1.6.23/LoopStructural/interpolators/supports/_base_support.py +125 -0
- loopstructural-1.6.23/LoopStructural/interpolators/supports/_face_table.py +70 -0
- loopstructural-1.6.23/LoopStructural/interpolators/supports/_support_factory.py +40 -0
- loopstructural-1.6.23/LoopStructural/modelling/__init__.py +35 -0
- loopstructural-1.6.23/LoopStructural/modelling/core/__init__.py +0 -0
- loopstructural-1.6.23/LoopStructural/modelling/core/fault_topology.py +234 -0
- loopstructural-1.6.23/LoopStructural/modelling/core/geological_model.py +1824 -0
- loopstructural-1.6.23/LoopStructural/modelling/core/stratigraphic_column.py +770 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/__init__.py +33 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/_analytical_feature.py +109 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/_base_geological_feature.py +435 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/_cross_product_geological_feature.py +106 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/_feature_converters.py +39 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/_geological_feature.py +358 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/_lambda_geological_feature.py +164 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/_projected_vector_feature.py +111 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/_region.py +18 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/_structural_frame.py +180 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/_unconformity_feature.py +82 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/builders/__init__.py +6 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/builders/_analytical_fold_builder.py +21 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/builders/_base_builder.py +121 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/builders/_fault_builder.py +585 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/builders/_folded_feature_builder.py +178 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/builders/_geological_feature_builder.py +565 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/builders/_structural_frame_builder.py +281 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/fault/__init__.py +3 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/fault/_fault_function.py +456 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/fault/_fault_function_feature.py +156 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/fault/_fault_segment.py +508 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/fold/__init__.py +6 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/fold/_fold.py +167 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/fold/_fold_rotation_angle_feature.py +50 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/fold/_foldframe.py +211 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/fold/_svariogram.py +226 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/fold/fold_function/__init__.py +27 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/fold/fold_function/_base_fold_rotation_angle.py +252 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/fold/fold_function/_fourier_series_fold_rotation_angle.py +153 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/fold/fold_function/_lambda_fold_rotation_angle.py +45 -0
- loopstructural-1.6.23/LoopStructural/modelling/features/fold/fold_function/_trigo_fold_rotation_angle.py +190 -0
- loopstructural-1.6.23/LoopStructural/modelling/input/__init__.py +2 -0
- loopstructural-1.6.23/LoopStructural/modelling/input/fault_network.py +80 -0
- loopstructural-1.6.23/LoopStructural/modelling/input/map2loop_processor.py +165 -0
- loopstructural-1.6.23/LoopStructural/modelling/input/process_data.py +676 -0
- loopstructural-1.6.23/LoopStructural/modelling/input/project_file.py +110 -0
- loopstructural-1.6.23/LoopStructural/modelling/intrusions/__init__.py +25 -0
- loopstructural-1.6.23/LoopStructural/modelling/intrusions/geom_conceptual_models.py +142 -0
- loopstructural-1.6.23/LoopStructural/modelling/intrusions/geometric_scaling_functions.py +123 -0
- loopstructural-1.6.23/LoopStructural/modelling/intrusions/intrusion_builder.py +672 -0
- loopstructural-1.6.23/LoopStructural/modelling/intrusions/intrusion_feature.py +413 -0
- loopstructural-1.6.23/LoopStructural/modelling/intrusions/intrusion_frame_builder.py +971 -0
- loopstructural-1.6.23/LoopStructural/modelling/intrusions/intrusion_support_functions.py +460 -0
- loopstructural-1.6.23/LoopStructural/utils/__init__.py +41 -0
- loopstructural-1.6.23/LoopStructural/utils/_surface.py +164 -0
- loopstructural-1.6.23/LoopStructural/utils/_transformation.py +175 -0
- loopstructural-1.6.23/LoopStructural/utils/colours.py +51 -0
- loopstructural-1.6.23/LoopStructural/utils/config.py +18 -0
- loopstructural-1.6.23/LoopStructural/utils/dtm_creator.py +17 -0
- loopstructural-1.6.23/LoopStructural/utils/exceptions.py +31 -0
- loopstructural-1.6.23/LoopStructural/utils/features.py +5 -0
- loopstructural-1.6.23/LoopStructural/utils/helper.py +269 -0
- loopstructural-1.6.23/LoopStructural/utils/json_encoder.py +18 -0
- loopstructural-1.6.23/LoopStructural/utils/linalg.py +8 -0
- loopstructural-1.6.23/LoopStructural/utils/logging.py +79 -0
- loopstructural-1.6.23/LoopStructural/utils/maths.py +424 -0
- loopstructural-1.6.23/LoopStructural/utils/observer.py +240 -0
- loopstructural-1.6.23/LoopStructural/utils/regions.py +107 -0
- loopstructural-1.6.23/LoopStructural/utils/typing.py +7 -0
- loopstructural-1.6.23/LoopStructural/utils/utils.py +106 -0
- loopstructural-1.6.23/LoopStructural/version.py +1 -0
- loopstructural-1.6.23/LoopStructural/visualisation/__init__.py +11 -0
- loopstructural-1.6.23/LoopStructural.egg-info/PKG-INFO +161 -0
- loopstructural-1.6.23/LoopStructural.egg-info/SOURCES.txt +147 -0
- loopstructural-1.6.23/LoopStructural.egg-info/dependency_links.txt +1 -0
- loopstructural-1.6.23/LoopStructural.egg-info/requires.txt +41 -0
- loopstructural-1.6.23/LoopStructural.egg-info/top_level.txt +1 -0
- loopstructural-1.6.23/PKG-INFO +161 -0
- loopstructural-1.6.23/README.md +99 -0
- loopstructural-1.6.23/pyproject.toml +165 -0
- loopstructural-1.6.23/setup.cfg +4 -0
- loopstructural-1.6.23/setup.py +12 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Lachlan Grose
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"""
|
|
2
|
+
LoopStructural
|
|
3
|
+
==============
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import logging
|
|
8
|
+
from logging.config import dictConfig
|
|
9
|
+
|
|
10
|
+
from dataclasses import dataclass
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
__all__ = ["GeologicalModel"]
|
|
14
|
+
import tempfile
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
from .version import __version__
|
|
17
|
+
|
|
18
|
+
experimental = False
|
|
19
|
+
ch = logging.StreamHandler()
|
|
20
|
+
formatter = logging.Formatter("%(levelname)s: %(asctime)s: %(filename)s:%(lineno)d -- %(message)s")
|
|
21
|
+
ch.setFormatter(formatter)
|
|
22
|
+
ch.setLevel(logging.WARNING)
|
|
23
|
+
loggers = {}
|
|
24
|
+
@dataclass
|
|
25
|
+
class LoopStructuralConfig:
|
|
26
|
+
"""Configuration for LoopStructural package.
|
|
27
|
+
|
|
28
|
+
This dataclass holds configuration parameters for the LoopStructural
|
|
29
|
+
geological modelling package.
|
|
30
|
+
|
|
31
|
+
Parameters
|
|
32
|
+
----------
|
|
33
|
+
nelements : int, optional
|
|
34
|
+
The default number of elements to use in interpolation, by default 10_000
|
|
35
|
+
|
|
36
|
+
Examples
|
|
37
|
+
--------
|
|
38
|
+
>>> config = LoopStructuralConfig(nelements=50000)
|
|
39
|
+
>>> config.nelements
|
|
40
|
+
50000
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
nelements: int = 10_000
|
|
44
|
+
|
|
45
|
+
from .modelling.core.geological_model import GeologicalModel
|
|
46
|
+
from .modelling.core.stratigraphic_column import StratigraphicColumn
|
|
47
|
+
from .modelling.core.fault_topology import FaultTopology
|
|
48
|
+
from .interpolators._api import LoopInterpolator
|
|
49
|
+
from .interpolators import InterpolatorBuilder
|
|
50
|
+
from .datatypes import BoundingBox
|
|
51
|
+
from .utils import log_to_console, log_to_file, getLogger, rng, get_levels
|
|
52
|
+
|
|
53
|
+
logger = getLogger(__name__)
|
|
54
|
+
logger.info("Imported LoopStructural")
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def setLogging(level="info", handler=None):
|
|
58
|
+
"""Set the logging parameters for log file or custom handler.
|
|
59
|
+
|
|
60
|
+
Parameters
|
|
61
|
+
----------
|
|
62
|
+
level : str, optional
|
|
63
|
+
Logging level to set, by default "info"
|
|
64
|
+
Valid options: 'info', 'warning', 'error', 'debug'
|
|
65
|
+
handler : logging.Handler, optional
|
|
66
|
+
A logging handler to use instead of the default StreamHandler, by default None
|
|
67
|
+
|
|
68
|
+
Examples
|
|
69
|
+
--------
|
|
70
|
+
>>> import LoopStructural
|
|
71
|
+
>>> LoopStructural.setLogging('debug')
|
|
72
|
+
>>> LoopStructural.setLogging('info', logging.FileHandler('loop.log'))
|
|
73
|
+
"""
|
|
74
|
+
import LoopStructural
|
|
75
|
+
|
|
76
|
+
levels = get_levels()
|
|
77
|
+
level_value = levels.get(level, logging.WARNING)
|
|
78
|
+
|
|
79
|
+
# Create default handler if none provided
|
|
80
|
+
if handler is None:
|
|
81
|
+
handler = logging.StreamHandler()
|
|
82
|
+
|
|
83
|
+
formatter = logging.Formatter(
|
|
84
|
+
"%(levelname)s: %(asctime)s: %(filename)s:%(lineno)d -- %(message)s"
|
|
85
|
+
)
|
|
86
|
+
handler.setFormatter(formatter)
|
|
87
|
+
handler.setLevel(level_value)
|
|
88
|
+
|
|
89
|
+
# Replace handlers in all known loggers
|
|
90
|
+
for name in LoopStructural.loggers:
|
|
91
|
+
logger = logging.getLogger(name)
|
|
92
|
+
logger.handlers = []
|
|
93
|
+
logger.addHandler(handler)
|
|
94
|
+
logger.setLevel(level_value)
|
|
95
|
+
|
|
96
|
+
# Also apply to main module logger
|
|
97
|
+
main_logger = logging.getLogger(__name__)
|
|
98
|
+
main_logger.handlers = []
|
|
99
|
+
main_logger.addHandler(handler)
|
|
100
|
+
main_logger.setLevel(level_value)
|
|
101
|
+
|
|
102
|
+
main_logger.info(f"Set logging to {level}")
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Demo Datasets
|
|
3
|
+
=============
|
|
4
|
+
|
|
5
|
+
Various datasets used for documentation and tutorials.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from ._base import load_claudius
|
|
9
|
+
from ._base import load_grose2017
|
|
10
|
+
from ._base import load_grose2018
|
|
11
|
+
from ._base import load_grose2019
|
|
12
|
+
from ._base import load_laurent2016
|
|
13
|
+
from ._base import load_noddy_single_fold
|
|
14
|
+
from ._base import load_intrusion
|
|
15
|
+
from ._base import normal_vector_headers
|
|
16
|
+
from ._base import strike_dip_headers
|
|
17
|
+
from ._base import value_headers
|
|
18
|
+
from ._base import load_unconformity
|
|
19
|
+
from ._base import load_duplex
|
|
20
|
+
from ._base import load_tabular_intrusion
|
|
21
|
+
from ._base import load_geological_map_data
|
|
22
|
+
from ._base import load_fault_trace
|
|
23
|
+
from ._base import load_horizontal
|
|
24
|
+
from ._base import load_horizontal_v
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
from os.path import dirname, join
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from typing import Tuple
|
|
4
|
+
import numpy as np
|
|
5
|
+
import pandas as pd
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def load_horizontal() -> Tuple[pd.DataFrame, np.ndarray]:
|
|
9
|
+
"""Synthetic model for horizontal layers
|
|
10
|
+
|
|
11
|
+
Returns
|
|
12
|
+
-------
|
|
13
|
+
Tuple[pd.DataFrame, np.ndarray]
|
|
14
|
+
dataframe with feature_name 'strati', bounding box array
|
|
15
|
+
"""
|
|
16
|
+
bb = np.array([[0, 0, 0], [10, 10, 10]])
|
|
17
|
+
xy = np.mgrid[0:10, 0:10].reshape(2, -1).T
|
|
18
|
+
data = pd.DataFrame(
|
|
19
|
+
np.vstack(
|
|
20
|
+
[
|
|
21
|
+
np.hstack(
|
|
22
|
+
[
|
|
23
|
+
xy,
|
|
24
|
+
np.zeros(xy.shape[0])[:, None] + 2,
|
|
25
|
+
np.zeros(xy.shape[0])[:, None] + 2,
|
|
26
|
+
]
|
|
27
|
+
),
|
|
28
|
+
np.hstack(
|
|
29
|
+
[
|
|
30
|
+
xy,
|
|
31
|
+
np.zeros(xy.shape[0])[:, None] + 3,
|
|
32
|
+
np.zeros(xy.shape[0])[:, None] + 3,
|
|
33
|
+
]
|
|
34
|
+
),
|
|
35
|
+
]
|
|
36
|
+
),
|
|
37
|
+
columns=["X", "Y", "Z", "val"],
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
data["feature_name"] = "strati"
|
|
41
|
+
return data, bb
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def load_horizontal_v(v=0.5) -> Tuple[pd.DataFrame, np.ndarray]:
|
|
45
|
+
"""Synthetic model for horizontal layers
|
|
46
|
+
|
|
47
|
+
Returns
|
|
48
|
+
-------
|
|
49
|
+
Tuple[pd.DataFrame, np.ndarray]
|
|
50
|
+
dataframe with feature_name 'strati', bounding box array
|
|
51
|
+
"""
|
|
52
|
+
import numpy as np
|
|
53
|
+
import pandas as pd
|
|
54
|
+
|
|
55
|
+
bb = np.array([[0, 0, 0], [10, 10, 10]])
|
|
56
|
+
xy = np.mgrid[0:10, 0:10].reshape(2, -1).T
|
|
57
|
+
data = pd.DataFrame(
|
|
58
|
+
np.vstack(
|
|
59
|
+
[
|
|
60
|
+
np.hstack(
|
|
61
|
+
[
|
|
62
|
+
xy,
|
|
63
|
+
np.zeros(xy.shape[0])[:, None] + 2,
|
|
64
|
+
np.zeros(xy.shape[0])[:, None] + 2,
|
|
65
|
+
]
|
|
66
|
+
),
|
|
67
|
+
np.hstack(
|
|
68
|
+
[
|
|
69
|
+
xy,
|
|
70
|
+
np.zeros(xy.shape[0])[:, None]
|
|
71
|
+
+ 3 + v +
|
|
72
|
+
+ np.sin(np.pi / 6 * xy[:, [0]] + np.pi / 2) * v,
|
|
73
|
+
np.zeros(xy.shape[0])[:, None] + 3,
|
|
74
|
+
]
|
|
75
|
+
),
|
|
76
|
+
]
|
|
77
|
+
),
|
|
78
|
+
columns=["X", "Y", "Z", "val"],
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
data["feature_name"] = "strati"
|
|
82
|
+
return data, bb
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def load_claudius():
|
|
86
|
+
"""Model dataset sampled from 3D seismic data
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
Returns
|
|
90
|
+
-------
|
|
91
|
+
tuple
|
|
92
|
+
pandas data frame with loopstructural dataset and numpy array for bounding box
|
|
93
|
+
"""
|
|
94
|
+
module_path = dirname(__file__)
|
|
95
|
+
data = pd.read_csv(join(module_path, Path("data/claudius.csv")))
|
|
96
|
+
bb = np.loadtxt(join(module_path, Path("data/claudiusbb.txt")))
|
|
97
|
+
return data, bb
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def load_noddy_single_fold():
|
|
101
|
+
"""Model dataset for plunging cylindrical fold
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
Returns
|
|
105
|
+
-------
|
|
106
|
+
tuple
|
|
107
|
+
pandas data frame with loopstructural dataset and numpy array for bounding box
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
module_path = dirname(__file__)
|
|
111
|
+
data = pd.read_csv(join(module_path, Path("data/onefolddata.csv")))
|
|
112
|
+
bb = np.loadtxt(join(module_path, Path("data/onefoldbb.txt")))
|
|
113
|
+
return data, bb
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def load_laurent2016():
|
|
117
|
+
"""Model dataset for refolded fold
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
Returns
|
|
121
|
+
-------
|
|
122
|
+
tuple
|
|
123
|
+
pandas data frame with loopstructural dataset and numpy array for bounding box
|
|
124
|
+
"""
|
|
125
|
+
module_path = dirname(__file__)
|
|
126
|
+
data = pd.read_csv(join(module_path, Path("data/refolded_fold.csv")))
|
|
127
|
+
bb = np.loadtxt(join(module_path, Path("data/refolded_bb.txt")))
|
|
128
|
+
return data, bb
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def load_duplex():
|
|
132
|
+
"""Model dataset for synthetic duplex example
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
Returns
|
|
136
|
+
-------
|
|
137
|
+
tuple
|
|
138
|
+
pandas data frame with loopstructural dataset and numpy array for bounding box
|
|
139
|
+
"""
|
|
140
|
+
module_path = dirname(__file__)
|
|
141
|
+
data = pd.read_csv(join(module_path, Path("data/duplex.csv")))
|
|
142
|
+
bb = np.loadtxt(join(module_path, Path("data/duplexbb.txt")))
|
|
143
|
+
return data, bb
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def load_grose2017():
|
|
147
|
+
"""Model dataset for Cape Conran
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
Returns
|
|
151
|
+
-------
|
|
152
|
+
tuple
|
|
153
|
+
pandas data frame with loopstructural dataset and numpy array for bounding box
|
|
154
|
+
"""
|
|
155
|
+
pass
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
def load_grose2018():
|
|
159
|
+
"""Model dataset for synthetic parasitic fold series
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
Returns
|
|
163
|
+
-------
|
|
164
|
+
tuple
|
|
165
|
+
pandas data frame with loopstructural dataset and numpy array for bounding box
|
|
166
|
+
"""
|
|
167
|
+
pass
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def load_grose2019():
|
|
171
|
+
"""Model dataset for Davenport ranges
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
Returns
|
|
175
|
+
-------
|
|
176
|
+
tuple
|
|
177
|
+
pandas data frame with loopstructural dataset and numpy array for bounding box
|
|
178
|
+
"""
|
|
179
|
+
pass
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def load_intrusion():
|
|
183
|
+
"""Model dataset for a faulted intrusion
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
Returns
|
|
187
|
+
-------
|
|
188
|
+
tuple
|
|
189
|
+
pandas data frame with loopstructural dataset and numpy array for bounding box
|
|
190
|
+
"""
|
|
191
|
+
module_path = dirname(__file__)
|
|
192
|
+
data = pd.read_csv(join(module_path, Path("data/intrusion.csv")))
|
|
193
|
+
bb = np.loadtxt(join(module_path, Path("data/intrusionbb.txt")))
|
|
194
|
+
return data, bb
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def load_unconformity():
|
|
198
|
+
"""Model dataset sampled for a model containing an unconformity
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
Returns
|
|
202
|
+
-------
|
|
203
|
+
tuple
|
|
204
|
+
pandas data frame with loopstructural dataset and numpy array for bounding box
|
|
205
|
+
"""
|
|
206
|
+
module_path = dirname(__file__)
|
|
207
|
+
data = pd.read_csv(join(module_path, Path("data/unconformity.csv")))
|
|
208
|
+
bb = np.array([[0, 0, 0], [4, 6, 4]])
|
|
209
|
+
return data, bb
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
def value_headers():
|
|
213
|
+
"""Default pandas column names for location and value
|
|
214
|
+
|
|
215
|
+
Returns
|
|
216
|
+
-------
|
|
217
|
+
list
|
|
218
|
+
X,Y,Z,val
|
|
219
|
+
"""
|
|
220
|
+
|
|
221
|
+
return ["X", "Y", "Z", "val"]
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
def strike_dip_headers():
|
|
225
|
+
"""Default pandas column names for location and strike and dip
|
|
226
|
+
|
|
227
|
+
Returns
|
|
228
|
+
-------
|
|
229
|
+
list
|
|
230
|
+
X,Y,Z,strike,dip
|
|
231
|
+
"""
|
|
232
|
+
return ["X", "Y", "Z", "strike", "dip"]
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
def normal_vector_headers():
|
|
236
|
+
"""Default pandas column names for location and normal vector
|
|
237
|
+
|
|
238
|
+
Returns
|
|
239
|
+
-------
|
|
240
|
+
list
|
|
241
|
+
X,Y,Z,nx,ny,nz
|
|
242
|
+
"""
|
|
243
|
+
return ["X", "Y", "Z", "nx", "ny", "nz"]
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
def load_tabular_intrusion():
|
|
247
|
+
"""Model dataset sampled for a model of a tabular intrusion
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
Returns
|
|
251
|
+
-------
|
|
252
|
+
tuple
|
|
253
|
+
pandas data frame with loopstructural dataset and numpy array for bounding box
|
|
254
|
+
"""
|
|
255
|
+
module_path = dirname(__file__)
|
|
256
|
+
data = pd.read_csv(join(module_path, Path("data/tabular_intrusion.csv")))
|
|
257
|
+
bb = np.array([[0, 0, 0], [5, 5, 5]])
|
|
258
|
+
return data, bb
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
def load_geological_map_data():
|
|
262
|
+
"""An example dataset to use the processinput data class
|
|
263
|
+
|
|
264
|
+
Returns
|
|
265
|
+
-------
|
|
266
|
+
tuple
|
|
267
|
+
(
|
|
268
|
+
contacts,
|
|
269
|
+
stratigraphic_orientations,
|
|
270
|
+
stratigraphic_thickness,
|
|
271
|
+
stratigraphic_order,
|
|
272
|
+
bbox,
|
|
273
|
+
fault_locations,
|
|
274
|
+
fault_orientations,
|
|
275
|
+
fault_properties,
|
|
276
|
+
fault_edges,
|
|
277
|
+
)
|
|
278
|
+
"""
|
|
279
|
+
module_path = dirname(__file__)
|
|
280
|
+
contacts = pd.read_csv(join(module_path, Path("data/geological_map_data/contacts.csv")))
|
|
281
|
+
stratigraphic_orientations = pd.read_csv(
|
|
282
|
+
join(module_path, Path("data/geological_map_data/stratigraphic_orientations.csv"))
|
|
283
|
+
)
|
|
284
|
+
stratigraphic_thickness = pd.read_csv(
|
|
285
|
+
join(module_path, Path("data/geological_map_data/stratigraphic_thickness.csv")),
|
|
286
|
+
skiprows=1,
|
|
287
|
+
names=["name", "thickness"],
|
|
288
|
+
)
|
|
289
|
+
stratigraphic_order = pd.read_csv(
|
|
290
|
+
join(module_path, Path("data/geological_map_data/stratigraphic_order.csv")),
|
|
291
|
+
skiprows=1,
|
|
292
|
+
names=["order", "unit name"],
|
|
293
|
+
)
|
|
294
|
+
bbox = pd.read_csv(
|
|
295
|
+
join(module_path, Path("data/geological_map_data/bbox.csv")),
|
|
296
|
+
index_col=0,
|
|
297
|
+
header=None,
|
|
298
|
+
names=["X", "Y", "Z"],
|
|
299
|
+
)
|
|
300
|
+
fault_properties = pd.read_csv(
|
|
301
|
+
join(module_path, Path("data/geological_map_data/fault_displacement.csv")),
|
|
302
|
+
index_col=0,
|
|
303
|
+
)
|
|
304
|
+
fault_edges = []
|
|
305
|
+
with open(join(module_path, Path("data/geological_map_data/fault_edges.txt")), "r") as f:
|
|
306
|
+
for l in f.read().split("\n"):
|
|
307
|
+
faults = l.split(",")
|
|
308
|
+
if len(faults) == 2:
|
|
309
|
+
fault_edges.append((faults[0], faults[1]))
|
|
310
|
+
fault_locations = pd.read_csv(
|
|
311
|
+
join(module_path, Path("data/geological_map_data/fault_locations.csv"))
|
|
312
|
+
)
|
|
313
|
+
fault_orientations = pd.read_csv(
|
|
314
|
+
join(module_path, Path("data/geological_map_data/fault_orientations.csv"))
|
|
315
|
+
)
|
|
316
|
+
return (
|
|
317
|
+
contacts,
|
|
318
|
+
stratigraphic_orientations,
|
|
319
|
+
stratigraphic_thickness,
|
|
320
|
+
stratigraphic_order,
|
|
321
|
+
bbox,
|
|
322
|
+
fault_locations,
|
|
323
|
+
fault_orientations,
|
|
324
|
+
fault_properties,
|
|
325
|
+
fault_edges,
|
|
326
|
+
)
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
def load_fault_trace():
|
|
330
|
+
"""Load the fault trace dataset, requires geopandas
|
|
331
|
+
|
|
332
|
+
Returns
|
|
333
|
+
-------
|
|
334
|
+
GeoDataFrame
|
|
335
|
+
dataframe of a shapefile for two faults
|
|
336
|
+
"""
|
|
337
|
+
import geopandas
|
|
338
|
+
|
|
339
|
+
module_path = dirname(__file__)
|
|
340
|
+
|
|
341
|
+
fault_trace = geopandas.read_file(join(module_path, Path("data/fault_trace/fault_trace.shp")))
|
|
342
|
+
return fault_trace
|