Skip to content

Commit 08d62ae

Browse files
committed
[DOC] Tut1 updated
1 parent c3096d5 commit 08d62ae

File tree

1 file changed

+59
-18
lines changed

1 file changed

+59
-18
lines changed

examples/tutorials/ch1_fundamentals/ch1_1_basics.py

Lines changed: 59 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
geo_model: gp.data.GeoModel = gp.create_geomodel(
5353
project_name='Tutorial_ch1_1_Basics',
5454
extent=[0, 2000, 0, 2000, 0, 750],
55-
refinement=4, # * Here we define the number of octree levels. If octree levels are defined, the resolution is ignored.
55+
refinement=6, # * Here we define the number of octree levels. If octree levels are defined, the resolution is ignored.
5656
importer_helper=gp.data.ImporterHelper(
5757
path_to_orientations=data_path + "/data/input_data/getting_started/simple_fault_model_orientations.csv",
5858
path_to_surface_points=data_path + "/data/input_data/getting_started/simple_fault_model_points.csv",
@@ -68,10 +68,14 @@
6868
# simplifies the process of passing multiple arguments needed for importing data and will likely see further
6969
# extensions in the future. Currently, one of its uses is to handle `pooch` arguments for downloading data from the internet.
7070
#
71-
#
71+
#
72+
#
73+
# ### Reviewing the Imported Data
74+
#
75+
# Now that the `geo_model` object is set up and the data imported from the CSV files, we review the data imported using the properties `surface_points_copy` and `orientations_copy`.
76+
#
77+
# Using `structural_frame.element_id_name_map`, we can see which ID corresponds to which structural element name in the data.
7278

73-
# The input data can be reviewed using the properties `surface_points` and `orientations`. However, note that at this point,
74-
# the sequence of formations and their assignment to series are still arbitrary. We will rectify this in the subsequent steps.
7579

7680
# %%
7781
geo_model.surface_points_copy
@@ -107,7 +111,13 @@
107111
# "newer" series.
108112
#
109113
# By default, we create a simple sequence inferred from the data:
110-
#
114+
#
115+
#
116+
# ## Setting Up the Structural Framework
117+
#
118+
# Each data entry includes an ID that corresponds to a formation name, which GemPy uses to create a base structural framework.
119+
# However, the sequence of these formations is still arbitrary, as they have all automatically been assigned to the default
120+
# structural group in our `geo_model` object. We will fix this in the subsequent steps.
111121

112122
# %%
113123
geo_model.structural_frame
@@ -124,6 +134,35 @@
124134
# input data.
125135
#
126136

137+
# ### Declaring the Sequential Order of Structural Elements (Geological Formations)
138+
#
139+
# In our model, we want the geological units to appear in the correct chronological order. This order could be determined by a sequence
140+
# of stratigraphic deposition, unconformities due to erosion, or other lithological genesis events like igneous intrusions. A similar
141+
# age-related order is declared for faults in our model. In GemPy, we use the function `gempy.map_stack_to_surfaces` to assign formations
142+
# or faults to different sequential series by declaring them in a Python dictionary.
143+
144+
#
145+
# The correct ordering of series is crucial for model construction! It's possible to assign several surfaces to one series. The order of
146+
# units within a series only affects the color code, so we recommend maintaining consistency. The order can be defined by simply changing
147+
# the order of the lists within the `gempy.core.data.StructuralFrame.structural_groups` and `gempy.core.data.StructuralGroups.elements` attributes.
148+
#
149+
# Faults are treated as independent groups and must be younger than the groups they affect. The relative order between different faults
150+
# defines their tectonic relationship (the first entry is the youngest).
151+
#
152+
# For a model with simple sequential stratigraphy, all layer formations can be assigned to one series without an issue. All unit
153+
# boundaries and their order would then be determined by interface points. However, to model more complex lithostratigraphical
154+
# relations and interactions, separate series definitions become important. For example, modeling an unconformity or an intrusion
155+
# that disrupts older stratigraphy would require declaring a younger series.
156+
#
157+
# By default, a simple sequence/group is created inferred from the data as shown above.
158+
#
159+
# Our example model comprises four main layers (plus an underlying basement that is automatically generated by GemPy) and one main
160+
# normal fault displacing those layers. Assuming a simple stratigraphy where each younger unit was deposited onto the underlying
161+
# older one, we can assign these layer formations to one structural group called "Strat_Series". For the fault, we declare a
162+
# respective "Fault_Series" as the first key entry in the mapping dictionary. We could give any other names to these series;
163+
# the formations, however, have to be referred to as named in the input data.
164+
#
165+
# In the following, we map the "Main Fault" to the "Fault Series" and the individual formations to the "Strat Series".
127166

128167
# %%
129168
gp.map_stack_to_surfaces(
@@ -135,6 +174,10 @@
135174
}
136175
)
137176

177+
# %%
178+
# Note how the structural frame still indicates the "Fault Series" group to have a relation type "erode".
179+
# We still need to tell GemPy that we want this group to be a fault. We do this using the function `set_is_fault`.
180+
138181
geo_model.structural_frame # Display the resulting structural frame
139182

140183
# %%
@@ -162,31 +205,29 @@
162205
# Visualizing input data
163206
# ~~~~~~~~~~~~~~~~~~~~~~
164207
#
165-
# We can also visualize our input data. This might for example be useful
166-
# to check if all points and measurements are defined the way we want them
167-
# to. Using the function :obj:`gempy_viewer.plot2d`, we attain a 2D projection of our
168-
# data points onto a plane of chosen *direction* (we can choose this
169-
# attribute to be either :math:`x`, :math:`y` or :math:`z`).
170-
#
208+
# Since we have already imported our input data, we can go ahead and visualize it in 2D and 3D. This can be useful to check if all points
209+
# and orientations are defined the way we want them to be. Using the function `gempy_viewer.plot2d`, we obtain a 2D projection of our
210+
# data points onto a plane of the chosen *direction* (we can choose this attribute to be either $x$, $y$ or $z$, with the default being $y$).
211+
# Below, we can freely switch the direction and check out the projection from different sides to get a good idea.
212+
171213

172214
# %%
173215
plot = gpv.plot_2d(geo_model, show_lith=False, show_boundaries=False)
174216

175217
# %%
176-
# Using :obj:`gempy_viewer.plot_3d`, # we can also visualize this data in 3D. Note that
177-
# direct 3D visualization in GemPy requires `the Visualization
178-
# Toolkit <https://www.vtk.org/>`__ (VTK) to be installed.
179-
#
218+
#Beyond 2D, however, we can also visualize our input data in full 3D using `gempy_viewer.plot_3d`. Note that direct 3D visualization
219+
# in GemPy requires [the Visualization Toolkit](https://www.vtk.org/) (VTK) to be installed.
220+
180221

181222
# %%
182223
gpv.plot_3d(geo_model, image=False, plotter_type='basic')
183224

184225
# %%
185226
# Model Generation
186227
# ~~~~~~~~~~~~~~~~
187-
# Once we've correctly defined all our primary information in our
188-
# `gempy.core.data.GeoModel` object (referred to as `geo_model` in these tutorials),
189-
# we can proceed to the next step: preparing the input data for interpolation.
228+
# Once we've correctly defined all our primary information in our `gempy.core.data.GeoModel` object (referred to as `geo_model`
229+
# in these tutorials), we can proceed with the model computation step. We can go ahead and save the solution of a specific computation
230+
# as we do below, but solutions are also stored within the `gempy.core.data.GeoModel` object for future reference.
190231
#
191232
#
192233
# .. admonition:: New in GemPy 3! Numpy and TensorFlow backend

0 commit comments

Comments
 (0)