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.
Files changed (149) hide show
  1. loopstructural-1.6.23/LICENSE +21 -0
  2. loopstructural-1.6.23/LoopStructural/__init__.py +102 -0
  3. loopstructural-1.6.23/LoopStructural/datasets/__init__.py +24 -0
  4. loopstructural-1.6.23/LoopStructural/datasets/_base.py +342 -0
  5. loopstructural-1.6.23/LoopStructural/datasets/_example_models.py +10 -0
  6. loopstructural-1.6.23/LoopStructural/datasets/data/claudius.csv +21049 -0
  7. loopstructural-1.6.23/LoopStructural/datasets/data/claudiusbb.txt +2 -0
  8. loopstructural-1.6.23/LoopStructural/datasets/data/duplex.csv +126 -0
  9. loopstructural-1.6.23/LoopStructural/datasets/data/duplexbb.txt +2 -0
  10. loopstructural-1.6.23/LoopStructural/datasets/data/fault_trace/fault_trace.cpg +1 -0
  11. loopstructural-1.6.23/LoopStructural/datasets/data/fault_trace/fault_trace.dbf +0 -0
  12. loopstructural-1.6.23/LoopStructural/datasets/data/fault_trace/fault_trace.prj +1 -0
  13. loopstructural-1.6.23/LoopStructural/datasets/data/fault_trace/fault_trace.shp +0 -0
  14. loopstructural-1.6.23/LoopStructural/datasets/data/fault_trace/fault_trace.shx +0 -0
  15. loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/bbox.csv +2 -0
  16. loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/contacts.csv +657 -0
  17. loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/fault_displacement.csv +7 -0
  18. loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/fault_edges.txt +2 -0
  19. loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/fault_locations.csv +79 -0
  20. loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/fault_orientations.csv +19 -0
  21. loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/stratigraphic_order.csv +13 -0
  22. loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/stratigraphic_orientations.csv +207 -0
  23. loopstructural-1.6.23/LoopStructural/datasets/data/geological_map_data/stratigraphic_thickness.csv +13 -0
  24. loopstructural-1.6.23/LoopStructural/datasets/data/intrusion.csv +1017 -0
  25. loopstructural-1.6.23/LoopStructural/datasets/data/intrusionbb.txt +2 -0
  26. loopstructural-1.6.23/LoopStructural/datasets/data/onefoldbb.txt +2 -0
  27. loopstructural-1.6.23/LoopStructural/datasets/data/onefolddata.csv +2226 -0
  28. loopstructural-1.6.23/LoopStructural/datasets/data/refolded_bb.txt +2 -0
  29. loopstructural-1.6.23/LoopStructural/datasets/data/refolded_fold.csv +205 -0
  30. loopstructural-1.6.23/LoopStructural/datasets/data/tabular_intrusion.csv +23 -0
  31. loopstructural-1.6.23/LoopStructural/datatypes/__init__.py +4 -0
  32. loopstructural-1.6.23/LoopStructural/datatypes/_bounding_box.py +690 -0
  33. loopstructural-1.6.23/LoopStructural/datatypes/_point.py +232 -0
  34. loopstructural-1.6.23/LoopStructural/datatypes/_structured_grid.py +192 -0
  35. loopstructural-1.6.23/LoopStructural/datatypes/_surface.py +248 -0
  36. loopstructural-1.6.23/LoopStructural/export/exporters.py +554 -0
  37. loopstructural-1.6.23/LoopStructural/export/file_formats.py +15 -0
  38. loopstructural-1.6.23/LoopStructural/export/geoh5.py +102 -0
  39. loopstructural-1.6.23/LoopStructural/export/gocad.py +126 -0
  40. loopstructural-1.6.23/LoopStructural/export/omf_wrapper.py +116 -0
  41. loopstructural-1.6.23/LoopStructural/interpolators/__init__.py +132 -0
  42. loopstructural-1.6.23/LoopStructural/interpolators/_api.py +211 -0
  43. loopstructural-1.6.23/LoopStructural/interpolators/_builders.py +149 -0
  44. loopstructural-1.6.23/LoopStructural/interpolators/_constant_norm.py +205 -0
  45. loopstructural-1.6.23/LoopStructural/interpolators/_cython/__init__.py +0 -0
  46. loopstructural-1.6.23/LoopStructural/interpolators/_discrete_fold_interpolator.py +190 -0
  47. loopstructural-1.6.23/LoopStructural/interpolators/_discrete_interpolator.py +760 -0
  48. loopstructural-1.6.23/LoopStructural/interpolators/_finite_difference_interpolator.py +519 -0
  49. loopstructural-1.6.23/LoopStructural/interpolators/_geological_interpolator.py +549 -0
  50. loopstructural-1.6.23/LoopStructural/interpolators/_interpolator_builder.py +134 -0
  51. loopstructural-1.6.23/LoopStructural/interpolators/_interpolator_factory.py +77 -0
  52. loopstructural-1.6.23/LoopStructural/interpolators/_interpolatortype.py +22 -0
  53. loopstructural-1.6.23/LoopStructural/interpolators/_operator.py +38 -0
  54. loopstructural-1.6.23/LoopStructural/interpolators/_p1interpolator.py +233 -0
  55. loopstructural-1.6.23/LoopStructural/interpolators/_p2interpolator.py +278 -0
  56. loopstructural-1.6.23/LoopStructural/interpolators/_surfe_wrapper.py +210 -0
  57. loopstructural-1.6.23/LoopStructural/interpolators/supports/_2d_base_unstructured.py +359 -0
  58. loopstructural-1.6.23/LoopStructural/interpolators/supports/_2d_p1_unstructured.py +68 -0
  59. loopstructural-1.6.23/LoopStructural/interpolators/supports/_2d_p2_unstructured.py +288 -0
  60. loopstructural-1.6.23/LoopStructural/interpolators/supports/_2d_structured_grid.py +516 -0
  61. loopstructural-1.6.23/LoopStructural/interpolators/supports/_2d_structured_tetra.py +0 -0
  62. loopstructural-1.6.23/LoopStructural/interpolators/supports/_3d_base_structured.py +527 -0
  63. loopstructural-1.6.23/LoopStructural/interpolators/supports/_3d_p2_tetra.py +331 -0
  64. loopstructural-1.6.23/LoopStructural/interpolators/supports/_3d_structured_grid.py +499 -0
  65. loopstructural-1.6.23/LoopStructural/interpolators/supports/_3d_structured_tetra.py +754 -0
  66. loopstructural-1.6.23/LoopStructural/interpolators/supports/_3d_unstructured_tetra.py +651 -0
  67. loopstructural-1.6.23/LoopStructural/interpolators/supports/__init__.py +62 -0
  68. loopstructural-1.6.23/LoopStructural/interpolators/supports/_aabb.py +77 -0
  69. loopstructural-1.6.23/LoopStructural/interpolators/supports/_base_support.py +125 -0
  70. loopstructural-1.6.23/LoopStructural/interpolators/supports/_face_table.py +70 -0
  71. loopstructural-1.6.23/LoopStructural/interpolators/supports/_support_factory.py +40 -0
  72. loopstructural-1.6.23/LoopStructural/modelling/__init__.py +35 -0
  73. loopstructural-1.6.23/LoopStructural/modelling/core/__init__.py +0 -0
  74. loopstructural-1.6.23/LoopStructural/modelling/core/fault_topology.py +234 -0
  75. loopstructural-1.6.23/LoopStructural/modelling/core/geological_model.py +1824 -0
  76. loopstructural-1.6.23/LoopStructural/modelling/core/stratigraphic_column.py +770 -0
  77. loopstructural-1.6.23/LoopStructural/modelling/features/__init__.py +33 -0
  78. loopstructural-1.6.23/LoopStructural/modelling/features/_analytical_feature.py +109 -0
  79. loopstructural-1.6.23/LoopStructural/modelling/features/_base_geological_feature.py +435 -0
  80. loopstructural-1.6.23/LoopStructural/modelling/features/_cross_product_geological_feature.py +106 -0
  81. loopstructural-1.6.23/LoopStructural/modelling/features/_feature_converters.py +39 -0
  82. loopstructural-1.6.23/LoopStructural/modelling/features/_geological_feature.py +358 -0
  83. loopstructural-1.6.23/LoopStructural/modelling/features/_lambda_geological_feature.py +164 -0
  84. loopstructural-1.6.23/LoopStructural/modelling/features/_projected_vector_feature.py +111 -0
  85. loopstructural-1.6.23/LoopStructural/modelling/features/_region.py +18 -0
  86. loopstructural-1.6.23/LoopStructural/modelling/features/_structural_frame.py +180 -0
  87. loopstructural-1.6.23/LoopStructural/modelling/features/_unconformity_feature.py +82 -0
  88. loopstructural-1.6.23/LoopStructural/modelling/features/builders/__init__.py +6 -0
  89. loopstructural-1.6.23/LoopStructural/modelling/features/builders/_analytical_fold_builder.py +21 -0
  90. loopstructural-1.6.23/LoopStructural/modelling/features/builders/_base_builder.py +121 -0
  91. loopstructural-1.6.23/LoopStructural/modelling/features/builders/_fault_builder.py +585 -0
  92. loopstructural-1.6.23/LoopStructural/modelling/features/builders/_folded_feature_builder.py +178 -0
  93. loopstructural-1.6.23/LoopStructural/modelling/features/builders/_geological_feature_builder.py +565 -0
  94. loopstructural-1.6.23/LoopStructural/modelling/features/builders/_structural_frame_builder.py +281 -0
  95. loopstructural-1.6.23/LoopStructural/modelling/features/fault/__init__.py +3 -0
  96. loopstructural-1.6.23/LoopStructural/modelling/features/fault/_fault_function.py +456 -0
  97. loopstructural-1.6.23/LoopStructural/modelling/features/fault/_fault_function_feature.py +156 -0
  98. loopstructural-1.6.23/LoopStructural/modelling/features/fault/_fault_segment.py +508 -0
  99. loopstructural-1.6.23/LoopStructural/modelling/features/fold/__init__.py +6 -0
  100. loopstructural-1.6.23/LoopStructural/modelling/features/fold/_fold.py +167 -0
  101. loopstructural-1.6.23/LoopStructural/modelling/features/fold/_fold_rotation_angle_feature.py +50 -0
  102. loopstructural-1.6.23/LoopStructural/modelling/features/fold/_foldframe.py +211 -0
  103. loopstructural-1.6.23/LoopStructural/modelling/features/fold/_svariogram.py +226 -0
  104. loopstructural-1.6.23/LoopStructural/modelling/features/fold/fold_function/__init__.py +27 -0
  105. loopstructural-1.6.23/LoopStructural/modelling/features/fold/fold_function/_base_fold_rotation_angle.py +252 -0
  106. loopstructural-1.6.23/LoopStructural/modelling/features/fold/fold_function/_fourier_series_fold_rotation_angle.py +153 -0
  107. loopstructural-1.6.23/LoopStructural/modelling/features/fold/fold_function/_lambda_fold_rotation_angle.py +45 -0
  108. loopstructural-1.6.23/LoopStructural/modelling/features/fold/fold_function/_trigo_fold_rotation_angle.py +190 -0
  109. loopstructural-1.6.23/LoopStructural/modelling/input/__init__.py +2 -0
  110. loopstructural-1.6.23/LoopStructural/modelling/input/fault_network.py +80 -0
  111. loopstructural-1.6.23/LoopStructural/modelling/input/map2loop_processor.py +165 -0
  112. loopstructural-1.6.23/LoopStructural/modelling/input/process_data.py +676 -0
  113. loopstructural-1.6.23/LoopStructural/modelling/input/project_file.py +110 -0
  114. loopstructural-1.6.23/LoopStructural/modelling/intrusions/__init__.py +25 -0
  115. loopstructural-1.6.23/LoopStructural/modelling/intrusions/geom_conceptual_models.py +142 -0
  116. loopstructural-1.6.23/LoopStructural/modelling/intrusions/geometric_scaling_functions.py +123 -0
  117. loopstructural-1.6.23/LoopStructural/modelling/intrusions/intrusion_builder.py +672 -0
  118. loopstructural-1.6.23/LoopStructural/modelling/intrusions/intrusion_feature.py +413 -0
  119. loopstructural-1.6.23/LoopStructural/modelling/intrusions/intrusion_frame_builder.py +971 -0
  120. loopstructural-1.6.23/LoopStructural/modelling/intrusions/intrusion_support_functions.py +460 -0
  121. loopstructural-1.6.23/LoopStructural/utils/__init__.py +41 -0
  122. loopstructural-1.6.23/LoopStructural/utils/_surface.py +164 -0
  123. loopstructural-1.6.23/LoopStructural/utils/_transformation.py +175 -0
  124. loopstructural-1.6.23/LoopStructural/utils/colours.py +51 -0
  125. loopstructural-1.6.23/LoopStructural/utils/config.py +18 -0
  126. loopstructural-1.6.23/LoopStructural/utils/dtm_creator.py +17 -0
  127. loopstructural-1.6.23/LoopStructural/utils/exceptions.py +31 -0
  128. loopstructural-1.6.23/LoopStructural/utils/features.py +5 -0
  129. loopstructural-1.6.23/LoopStructural/utils/helper.py +269 -0
  130. loopstructural-1.6.23/LoopStructural/utils/json_encoder.py +18 -0
  131. loopstructural-1.6.23/LoopStructural/utils/linalg.py +8 -0
  132. loopstructural-1.6.23/LoopStructural/utils/logging.py +79 -0
  133. loopstructural-1.6.23/LoopStructural/utils/maths.py +424 -0
  134. loopstructural-1.6.23/LoopStructural/utils/observer.py +240 -0
  135. loopstructural-1.6.23/LoopStructural/utils/regions.py +107 -0
  136. loopstructural-1.6.23/LoopStructural/utils/typing.py +7 -0
  137. loopstructural-1.6.23/LoopStructural/utils/utils.py +106 -0
  138. loopstructural-1.6.23/LoopStructural/version.py +1 -0
  139. loopstructural-1.6.23/LoopStructural/visualisation/__init__.py +11 -0
  140. loopstructural-1.6.23/LoopStructural.egg-info/PKG-INFO +161 -0
  141. loopstructural-1.6.23/LoopStructural.egg-info/SOURCES.txt +147 -0
  142. loopstructural-1.6.23/LoopStructural.egg-info/dependency_links.txt +1 -0
  143. loopstructural-1.6.23/LoopStructural.egg-info/requires.txt +41 -0
  144. loopstructural-1.6.23/LoopStructural.egg-info/top_level.txt +1 -0
  145. loopstructural-1.6.23/PKG-INFO +161 -0
  146. loopstructural-1.6.23/README.md +99 -0
  147. loopstructural-1.6.23/pyproject.toml +165 -0
  148. loopstructural-1.6.23/setup.cfg +4 -0
  149. 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
@@ -0,0 +1,10 @@
1
+ vis = True
2
+ try:
3
+ pass
4
+ except:
5
+ print("No visualisation")
6
+ vis = False
7
+
8
+
9
+ def _build_claudius():
10
+ pass