Skip to content

Commit 5beeda3

Browse files
committed
[WIP] Proper implementation of plotting lith block
1 parent 10f05fd commit 5beeda3

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

gempy/core/data/geo_model.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,22 @@ def orientations(self) -> OrientationsTable:
214214
def orientations(self, value):
215215
self.structural_frame.orientations = value
216216

217+
@property
218+
def project_bounds(self) -> np.ndarray:
219+
return self.grid.bounding_box
220+
221+
@property
222+
def extent_transformed(self) -> np.ndarray:
223+
transformed = self.input_transform.apply(self.project_bounds) # ! grid already has the grid transform applied
224+
new_extents = np.array([transformed[:, 0].min(), transformed[:, 0].max(),
225+
transformed[:, 1].min(), transformed[:, 1].max(),
226+
transformed[:, 2].min(), transformed[:, 2].max()])
227+
return new_extents
228+
229+
@property
230+
def extent(self) -> np.ndarray:
231+
return self.grid.extent
232+
217233
@property
218234
def interpolation_input_copy(self):
219235
if self.structural_frame.is_dirty is False:

gempy/modules/data_manipulation/engine_factory.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def interpolation_input_from_structural_frame(structural_frame: StructuralFrame,
4848

4949
def _apply_input_transform_to_grids(grid: Grid, input_transform: Transform) -> engine_grid.EngineGrid:
5050
transformed = input_transform.apply(grid.bounding_box) # ! grid already has the grid transform applied
51-
grid.regular_grid.input_transform = input_transform
5251
new_extents = np.array([transformed[:, 0].min(), transformed[:, 0].max(),
5352
transformed[:, 1].min(), transformed[:, 1].max(),
5453
transformed[:, 2].min(), transformed[:, 2].max()])

test/test_modules/.benchmarks/test_transformed_space.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,29 @@
88

99

1010
def test_plot_transformed_data():
11-
model = gp.generate_example_model(ExampleModel.ANTICLINE, compute_model=False)
11+
model = gp.generate_example_model(ExampleModel.ANTICLINE, compute_model=True)
1212
print(model.structural_frame)
1313

1414
if PLOT:
1515
gpv = require_gempy_viewer()
16+
17+
gpv.plot_3d(
18+
model,
19+
image=True,
20+
transformed_data=False,
21+
show_boundaries=False,
22+
show_lith=True,
23+
kwargs_plot_data={
24+
'arrow_size': 10
25+
}
26+
)
27+
1628
gpv.plot_3d(
1729
model,
1830
image=False,
1931
transformed_data=True,
32+
show_boundaries=False,
33+
show_lith=True,
2034
kwargs_plot_data={
2135
'arrow_size': .01
2236
}

0 commit comments

Comments
 (0)