Skip to content

Commit 6a5ee85

Browse files
committed
fix: add horizontal model with change in thickness example
1 parent 89a3c5f commit 6a5ee85

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

LoopStructural/datasets/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@
2121
from ._base import load_geological_map_data
2222
from ._base import load_fault_trace
2323
from ._base import load_horizontal
24+
from ._base import load_horizontal_v

LoopStructural/datasets/_base.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,47 @@ def load_horizontal() -> Tuple[pd.DataFrame, np.ndarray]:
4141
return data, bb
4242

4343

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+
4485
def load_claudius():
4586
"""Model dataset sampled from 3D seismic data
4687

0 commit comments

Comments
 (0)