|
| 1 | +""" |
| 2 | +============================ |
| 3 | +1f. Unconformities |
| 4 | +============================ |
| 5 | +This tutorial will demonstrate how to add unconformities to a mode using LoopStructural. |
| 6 | +
|
| 7 | +""" |
| 8 | + |
| 9 | +from LoopStructural import GeologicalModel |
| 10 | +import pandas as pd |
| 11 | +import numpy as np |
| 12 | +from LoopStructural.visualisation import LavaVuModelViewer |
| 13 | + |
| 14 | +################################################################################################## |
| 15 | +# Generate synthetic data |
| 16 | +# ~~~~~~~~~~~~~~~~~~~~~~~~ |
| 17 | +# Model 3 scalar fields where the top is horizontal, the middle is dipping and the bottom is horizontal. |
| 18 | +data = pd.DataFrame( |
| 19 | + [ |
| 20 | + [0, 0, 3, 0, 0, 0, 1, "unit_a"], |
| 21 | + [0, 0, 1, 1, 0, 0.7, 0.7, "unit_b"], |
| 22 | + [0, 0, 0, 0, 0, 0.7, 0.7, "unit_b"], |
| 23 | + [0, 0, -3, 0, 0, 0, -1, "unit_c"], |
| 24 | + ], |
| 25 | + columns=["X", "Y", "Z", "val", "nx", "ny", "nz", "feature_name"], |
| 26 | +) |
| 27 | + |
| 28 | +model = GeologicalModel(np.ones(3) * -5, np.ones(3) * 7) |
| 29 | +model.data = data |
| 30 | +model.create_and_add_foliation("unit_a") |
| 31 | +model.create_and_add_foliation("unit_b") |
| 32 | +model.create_and_add_foliation("unit_c") |
| 33 | + |
| 34 | +model.update() |
| 35 | +################################################################################################## |
| 36 | +# Visualise the model without unconformities |
| 37 | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 38 | +# |
| 39 | + |
| 40 | +view = LavaVuModelViewer(model) |
| 41 | +view.add_isosurface(model["unit_a"], nslices=5) |
| 42 | +view.add_isosurface(model["unit_b"], nslices=5) |
| 43 | +view.add_isosurface(model["unit_c"], nslices=5) |
| 44 | +view.camera = { |
| 45 | + "translate": [0.0, 0.0, -20.67], |
| 46 | + "rotate": [-0.562, -0.438, -0.442, 0.544], |
| 47 | + "xyzrotate": [-94.021, -77.018, 2.784], |
| 48 | + "fov": 45.0, |
| 49 | +} |
| 50 | +view.display() |
| 51 | + |
| 52 | +################################################################################################## |
| 53 | +# Add unconformities |
| 54 | +# ~~~~~~~~~~~~~~~~~~ |
| 55 | +# We add two unconformities to the model |
| 56 | +# 1. the isovalue of 0 of unit_a is an unconformity |
| 57 | +# 2. the isovalue of 0 of unit_b is an unconformity |
| 58 | +# |
| 59 | +# This means unit_a should not occur below isovalue of 0, |
| 60 | +# unit_b should truncate at unit_a isovalue 0 and |
| 61 | +# unit_b should not occur below isovalue of 0 |
| 62 | +# and unit_c should not occur below unit_b isovalue of 0 |
| 63 | + |
| 64 | +model = GeologicalModel(np.ones(3) * -5, np.ones(3) * 7) |
| 65 | +model.data = data |
| 66 | +model.create_and_add_foliation("unit_a") |
| 67 | +model.add_unconformity(model["unit_a"], 0) |
| 68 | +model.create_and_add_foliation("unit_b") |
| 69 | +model.add_unconformity(model["unit_b"], 0) |
| 70 | +model.create_and_add_foliation("unit_c") |
| 71 | + |
| 72 | +################################################################################################## |
| 73 | +# We can examine the model by printing the object |
| 74 | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 75 | + |
| 76 | +print(model) |
| 77 | + |
| 78 | +model.update() |
| 79 | + |
| 80 | +################################################################################################## |
| 81 | +# Visualise the model without unconformities |
| 82 | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 83 | +# |
| 84 | + |
| 85 | +view = LavaVuModelViewer(model) |
| 86 | +view.add_isosurface(model["unit_a"], nslices=5) |
| 87 | +view.add_isosurface(model["unit_b"], nslices=5) |
| 88 | +view.add_isosurface(model["unit_c"], nslices=5) |
| 89 | +view.camera = { |
| 90 | + "translate": [0.0, 0.0, -20.67], |
| 91 | + "rotate": [-0.562, -0.438, -0.442, 0.544], |
| 92 | + "xyzrotate": [-94.021, -77.018, 2.784], |
| 93 | + "fov": 45.0, |
| 94 | +} |
| 95 | +view.display() |
| 96 | + |
| 97 | + |
| 98 | +################################################################################################## |
| 99 | +# Adding onlap unconformity |
| 100 | +# ~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 101 | +# We can also add onlap unconformities to the model, using the previous example lets change the unconformity |
| 102 | +# between b and c to be an onlap. This means the geometry of c truncates b |
| 103 | + |
| 104 | + |
| 105 | +model = GeologicalModel(np.ones(3) * -5, np.ones(3) * 7) |
| 106 | +model.data = data |
| 107 | +model.create_and_add_foliation("unit_a") |
| 108 | +model.add_unconformity(model["unit_a"], 0) |
| 109 | +model.create_and_add_foliation("unit_b") |
| 110 | +model.create_and_add_foliation("unit_c") |
| 111 | +model.add_onlap_unconformity(model["unit_c"], 0) |
| 112 | + |
| 113 | +model.update() |
| 114 | + |
| 115 | +################################################################################################## |
| 116 | +# Visualise the model with onlap |
| 117 | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 118 | + |
| 119 | +view = LavaVuModelViewer(model) |
| 120 | +view.add_isosurface(model["unit_a"], nslices=5) |
| 121 | +view.add_isosurface(model["unit_b"], nslices=5) |
| 122 | +view.add_isosurface(model["unit_c"], nslices=5) |
| 123 | + |
| 124 | +view.camera = { |
| 125 | + "translate": [0.0, 0.0, -20.67], |
| 126 | + "rotate": [-0.562, -0.438, -0.442, 0.544], |
| 127 | + "xyzrotate": [-94.021, -77.018, 2.784], |
| 128 | + "fov": 45.0, |
| 129 | +} |
| 130 | + |
| 131 | +view.display() |
0 commit comments