|
13 | 13 | import numpy as np |
14 | 14 | from geoapps_utils.modelling.plates import PlateModel |
15 | 15 | from geoapps_utils.utils.locations import gaussian |
16 | | -from geoh5py.objects import ObjectBase, Surface |
| 16 | +from geoh5py.objects import ObjectBase, Points, Surface |
| 17 | +from geoh5py.shared.utils import fetch_active_workspace |
17 | 18 | from grid_apps.octree_creation.options import OctreeOptions |
18 | 19 | from pydantic import BaseModel, ConfigDict |
19 | 20 |
|
@@ -77,16 +78,20 @@ def octree_params( |
77 | 78 |
|
78 | 79 | :return: OctreeOptions instance ready to be passed to an OctreeDriver. |
79 | 80 | """ |
80 | | - shifted_survey = survey.copy() |
81 | | - shifted_survey.vertices = shifted_survey.vertices - np.r_[self.cell_size] / 2.0 |
| 81 | + |
| 82 | + locs = survey.vertices.copy() |
| 83 | + locs = np.vstack([locs, locs - np.r_[self.cell_size] / 2]) |
| 84 | + with fetch_active_workspace(survey.workspace) as geoh5: |
| 85 | + survey = Points.create(geoh5, vertices=locs) |
| 86 | + |
82 | 87 | refinements = [ |
83 | 88 | { |
84 | 89 | "refinement_object": survey, |
85 | 90 | "levels": self.survey_refinement, |
86 | 91 | "horizon": False, |
87 | 92 | }, |
88 | 93 | { |
89 | | - "refinement_object": shifted_survey, |
| 94 | + "refinement_object": survey, |
90 | 95 | "levels": self.survey_refinement, |
91 | 96 | "horizon": False, |
92 | 97 | }, |
|
0 commit comments