-
-
Notifications
You must be signed in to change notification settings - Fork 245
/
Copy pathtest_outliers.py
53 lines (44 loc) · 1.77 KB
/
test_outliers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import gempy as gp
from gempy.optional_dependencies import require_gempy_viewer
from gempy.core.data.enumerators import ExampleModel
from gempy.core.data.grid_modules import RegularGrid
import numpy as np
PLOT = True
def test_outliers_model_1():
# Path to input data
data_path = "https://raw.githubusercontent.com/cgre-aachen/gempy_data/master/"
path_to_data = data_path + "/data/input_data/video_tutorials_v3/"
# Create instance of geomodel
model = gp.create_geomodel(
project_name='tutorial_model_onlap_1',
extent=[0, 2000, 0, 1000, 0, 1000],
resolution=[100, 50, 50],
importer_helper=gp.data.ImporterHelper(
path_to_orientations=path_to_data + "tutorial_model_onlap_1_orientations.csv?cache=",
path_to_surface_points=path_to_data + "tutorial_model_onlap_1_surface_points.csv?cache="
)
)
# Map geological series to surfaces
gp.map_stack_to_surfaces(
gempy_model=model,
mapping_object={
"Young_Series": ("basin_fill_2", "basin_fill_1"),
"Old_Series": ("basin_top", "basin_bottom")
}
)
# Set the relation of the youngest group to Onlap
from gempy_engine.core.data.stack_relation_type import StackRelationType
model.structural_frame.structural_groups[0].structural_relation = StackRelationType.ONLAP
# Compute a solution for the model
gp.compute_model(model)
# Assert
arrays = model.solutions.raw_arrays # * arrays is equivalent to gempy v2 solutions
assert arrays.scalar_field_matrix.shape == (2, 250_000) # * 2 groups, 250000 points
if PLOT:
gpv = require_gempy_viewer()
gpv.plot_2d(
model=model,
show_data=False,
show_boundaries=False,
show=True
)