@@ -75,74 +75,22 @@ def test_structural_elements(self, borehole_set: BoreholeSet):
75
75
)
76
76
pv_plot ([s ], image_2d = False , cmap = "tab20c" )
77
77
78
- vertex_attributes : pd .DataFrame = borehole_trajectory .data .points_attributes
79
- unique_lith_codes = vertex_attributes ['component lith' ].unique ()
80
-
81
- component_lith = borehole_set .compute_tops ()
82
-
83
- pleistozen = gp .data .StructuralElement (
84
- name = "Pleistozen" ,
85
- id = 10_000 ,
86
- color = "#f9f97f" ,
87
- surface_points = gp .data .SurfacePointsTable (np .empty (0 , dtype = gp .data .SurfacePointsTable .dt )),
88
- orientations = gp .data .OrientationsTable (np .zeros (0 , dtype = gp .data .OrientationsTable .dt ))
89
- )
90
-
91
- kreide = gp .data .StructuralElement (
92
- name = "Kreide" ,
93
- id = 30_000 ,
94
- color = "#a6d84a" ,
95
- surface_points = gp .data .SurfacePointsTable (np .empty (0 , dtype = gp .data .SurfacePointsTable .dt )),
96
- orientations = gp .data .OrientationsTable (np .zeros (0 , dtype = gp .data .OrientationsTable .dt ))
97
- )
98
-
99
- trias = gp .data .StructuralElement (
100
- name = "Trias" ,
101
- id = 50_000 ,
102
- color = "#a4469f" ,
103
- surface_points = gp .data .SurfacePointsTable (np .empty (0 , dtype = gp .data .SurfacePointsTable .dt )),
104
- orientations = gp .data .OrientationsTable (np .zeros (0 , dtype = gp .data .OrientationsTable .dt ))
105
- )
106
-
107
- perm = gp .data .StructuralElement (
108
- name = "Perm" ,
109
- id = 60_000 ,
110
- color = "#f4a142" ,
111
- surface_points = gp .data .SurfacePointsTable (np .empty (0 , dtype = gp .data .SurfacePointsTable .dt )),
112
- orientations = gp .data .OrientationsTable (np .zeros (0 , dtype = gp .data .OrientationsTable .dt ))
113
- )
114
-
115
- rotliegend_id = 62_000
116
- rotliegend_xyz = component_lith [rotliegend_id ]
117
-
118
- # Add the id
119
- rotliegend_surface_points = gp .data .SurfacePointsTable .from_arrays (
120
- x = rotliegend_xyz [:, 0 ],
121
- y = rotliegend_xyz [:, 1 ],
122
- z = rotliegend_xyz [:, 2 ],
123
- names = ["Rotliegend" ],
124
- name_id_map = {"Rotliegend" : rotliegend_id }
125
- )
126
-
127
- rotliegend = gp .data .StructuralElement (
128
- name = "Rotliegend" ,
129
- id = rotliegend_id ,
130
- color = "#bb825b" ,
131
- surface_points = rotliegend_surface_points ,
132
- orientations = gp .data .OrientationsTable (np .zeros (0 , dtype = gp .data .OrientationsTable .dt ))
133
- )
134
-
135
- devon = gp .data .StructuralElement (
136
- name = "Devon" ,
137
- id = 80_000 ,
138
- color = "#969594" ,
139
- surface_points = gp .data .SurfacePointsTable (np .empty (0 , dtype = gp .data .SurfacePointsTable .dt )),
140
- orientations = gp .data .OrientationsTable (np .zeros (0 , dtype = gp .data .OrientationsTable .dt ))
78
+ elements = gp .structural_elements_from_borehole_set (
79
+ borehole_set = borehole_set ,
80
+ elements_dict = {
81
+ # "Pleistozen": {"id": 10_000, "color": "#f9f97f", "top_lith": 10_000},
82
+ # "Kreide": {"id": 30_000, "color": "#a6d84a", "top_lith": 30_000},
83
+ # "Trias": {"id": 50_000, "color": "#a4469f", "top_lith": 50_000},
84
+ # "Perm": {"id": 60_000, "color": "#f4a142", "top_lith": 60_000},
85
+ "Rotliegend" : {"id" : 62_000 , "color" : "#bb825b" , "top_lith" : 62_000 },
86
+ # "Devon": {"id": 80_000, "color": "#969594", "top_lith": 80_000}
87
+ }
141
88
)
142
-
89
+
90
+
143
91
group = gp .data .StructuralGroup (
144
92
name = "Stratigraphic Pile" ,
145
- elements = [ rotliegend ] ,
93
+ elements = elements ,
146
94
structural_relation = gp .data .StackRelationType .ERODE
147
95
)
148
96
structural_frame = gp .data .StructuralFrame (
@@ -151,6 +99,9 @@ def test_structural_elements(self, borehole_set: BoreholeSet):
151
99
)
152
100
print (group )
153
101
102
+
103
+ component_lith = borehole_set .get_top_coords_for_each_lith ()
104
+ rotliegend_xyz = component_lith [62_000 ]
154
105
extent_from_data = rotliegend_xyz .min (axis = 0 ), rotliegend_xyz .max (axis = 0 )
155
106
156
107
geo_model = gp .data .GeoModel (
0 commit comments