xtgeo 4.14.1__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cxtgeo.py +558 -0
- cxtgeoPYTHON_wrap.c +19537 -0
- xtgeo/__init__.py +248 -0
- xtgeo/_cxtgeo.cp313-win_amd64.pyd +0 -0
- xtgeo/_internal.cp313-win_amd64.pyd +0 -0
- xtgeo/common/__init__.py +19 -0
- xtgeo/common/_angles.py +29 -0
- xtgeo/common/_xyz_enum.py +50 -0
- xtgeo/common/calc.py +396 -0
- xtgeo/common/constants.py +30 -0
- xtgeo/common/exceptions.py +42 -0
- xtgeo/common/log.py +93 -0
- xtgeo/common/sys.py +166 -0
- xtgeo/common/types.py +18 -0
- xtgeo/common/version.py +34 -0
- xtgeo/common/xtgeo_dialog.py +604 -0
- xtgeo/cube/__init__.py +9 -0
- xtgeo/cube/_cube_export.py +214 -0
- xtgeo/cube/_cube_import.py +532 -0
- xtgeo/cube/_cube_roxapi.py +180 -0
- xtgeo/cube/_cube_utils.py +287 -0
- xtgeo/cube/_cube_window_attributes.py +273 -0
- xtgeo/cube/cube1.py +1023 -0
- xtgeo/grid3d/__init__.py +15 -0
- xtgeo/grid3d/_ecl_grid.py +778 -0
- xtgeo/grid3d/_ecl_inte_head.py +152 -0
- xtgeo/grid3d/_ecl_logi_head.py +71 -0
- xtgeo/grid3d/_ecl_output_file.py +81 -0
- xtgeo/grid3d/_egrid.py +1004 -0
- xtgeo/grid3d/_find_gridprop_in_eclrun.py +625 -0
- xtgeo/grid3d/_grdecl_format.py +309 -0
- xtgeo/grid3d/_grdecl_grid.py +400 -0
- xtgeo/grid3d/_grid3d.py +29 -0
- xtgeo/grid3d/_grid3d_fence.py +284 -0
- xtgeo/grid3d/_grid3d_utils.py +228 -0
- xtgeo/grid3d/_grid_boundary.py +76 -0
- xtgeo/grid3d/_grid_etc1.py +1683 -0
- xtgeo/grid3d/_grid_export.py +222 -0
- xtgeo/grid3d/_grid_hybrid.py +50 -0
- xtgeo/grid3d/_grid_import.py +79 -0
- xtgeo/grid3d/_grid_import_ecl.py +101 -0
- xtgeo/grid3d/_grid_import_roff.py +135 -0
- xtgeo/grid3d/_grid_import_xtgcpgeom.py +375 -0
- xtgeo/grid3d/_grid_refine.py +258 -0
- xtgeo/grid3d/_grid_roxapi.py +292 -0
- xtgeo/grid3d/_grid_translate_coords.py +154 -0
- xtgeo/grid3d/_grid_wellzone.py +165 -0
- xtgeo/grid3d/_gridprop_export.py +202 -0
- xtgeo/grid3d/_gridprop_import_eclrun.py +164 -0
- xtgeo/grid3d/_gridprop_import_grdecl.py +132 -0
- xtgeo/grid3d/_gridprop_import_roff.py +52 -0
- xtgeo/grid3d/_gridprop_import_xtgcpprop.py +168 -0
- xtgeo/grid3d/_gridprop_lowlevel.py +171 -0
- xtgeo/grid3d/_gridprop_op1.py +272 -0
- xtgeo/grid3d/_gridprop_roxapi.py +301 -0
- xtgeo/grid3d/_gridprop_value_init.py +140 -0
- xtgeo/grid3d/_gridprops_import_eclrun.py +344 -0
- xtgeo/grid3d/_gridprops_import_roff.py +83 -0
- xtgeo/grid3d/_roff_grid.py +470 -0
- xtgeo/grid3d/_roff_parameter.py +303 -0
- xtgeo/grid3d/grid.py +3010 -0
- xtgeo/grid3d/grid_properties.py +699 -0
- xtgeo/grid3d/grid_property.py +1313 -0
- xtgeo/grid3d/types.py +15 -0
- xtgeo/interfaces/rms/__init__.py +18 -0
- xtgeo/interfaces/rms/_regular_surface.py +460 -0
- xtgeo/interfaces/rms/_rms_base.py +100 -0
- xtgeo/interfaces/rms/_rmsapi_package.py +69 -0
- xtgeo/interfaces/rms/rmsapi_utils.py +438 -0
- xtgeo/io/__init__.py +1 -0
- xtgeo/io/_file.py +603 -0
- xtgeo/metadata/__init__.py +17 -0
- xtgeo/metadata/metadata.py +435 -0
- xtgeo/roxutils/__init__.py +7 -0
- xtgeo/roxutils/_roxar_loader.py +54 -0
- xtgeo/roxutils/_roxutils_etc.py +122 -0
- xtgeo/roxutils/roxutils.py +207 -0
- xtgeo/surface/__init__.py +20 -0
- xtgeo/surface/_regsurf_boundary.py +26 -0
- xtgeo/surface/_regsurf_cube.py +210 -0
- xtgeo/surface/_regsurf_cube_window.py +391 -0
- xtgeo/surface/_regsurf_cube_window_v2.py +297 -0
- xtgeo/surface/_regsurf_cube_window_v3.py +360 -0
- xtgeo/surface/_regsurf_export.py +388 -0
- xtgeo/surface/_regsurf_grid3d.py +275 -0
- xtgeo/surface/_regsurf_gridding.py +347 -0
- xtgeo/surface/_regsurf_ijxyz_parser.py +278 -0
- xtgeo/surface/_regsurf_import.py +347 -0
- xtgeo/surface/_regsurf_lowlevel.py +122 -0
- xtgeo/surface/_regsurf_oper.py +538 -0
- xtgeo/surface/_regsurf_utils.py +81 -0
- xtgeo/surface/_surfs_import.py +43 -0
- xtgeo/surface/_zmap_parser.py +138 -0
- xtgeo/surface/regular_surface.py +3043 -0
- xtgeo/surface/surfaces.py +276 -0
- xtgeo/well/__init__.py +24 -0
- xtgeo/well/_blockedwell_roxapi.py +241 -0
- xtgeo/well/_blockedwells_roxapi.py +68 -0
- xtgeo/well/_well_aux.py +30 -0
- xtgeo/well/_well_io.py +327 -0
- xtgeo/well/_well_oper.py +483 -0
- xtgeo/well/_well_roxapi.py +304 -0
- xtgeo/well/_wellmarkers.py +486 -0
- xtgeo/well/_wells_utils.py +158 -0
- xtgeo/well/blocked_well.py +220 -0
- xtgeo/well/blocked_wells.py +134 -0
- xtgeo/well/well1.py +1516 -0
- xtgeo/well/wells.py +211 -0
- xtgeo/xyz/__init__.py +6 -0
- xtgeo/xyz/_polygons_oper.py +272 -0
- xtgeo/xyz/_xyz.py +758 -0
- xtgeo/xyz/_xyz_data.py +646 -0
- xtgeo/xyz/_xyz_io.py +737 -0
- xtgeo/xyz/_xyz_lowlevel.py +42 -0
- xtgeo/xyz/_xyz_oper.py +613 -0
- xtgeo/xyz/_xyz_roxapi.py +766 -0
- xtgeo/xyz/points.py +698 -0
- xtgeo/xyz/polygons.py +827 -0
- xtgeo-4.14.1.dist-info/METADATA +146 -0
- xtgeo-4.14.1.dist-info/RECORD +122 -0
- xtgeo-4.14.1.dist-info/WHEEL +5 -0
- xtgeo-4.14.1.dist-info/licenses/LICENSE.md +165 -0
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
"""Module for various operation in the RMSAPI (former rmsapi) python interface."""
|
|
2
|
+
|
|
3
|
+
import enum
|
|
4
|
+
import pathlib
|
|
5
|
+
import warnings
|
|
6
|
+
from typing import Any, Literal
|
|
7
|
+
|
|
8
|
+
from packaging.version import parse as versionparse
|
|
9
|
+
|
|
10
|
+
from xtgeo.common.log import null_logger
|
|
11
|
+
|
|
12
|
+
from ._rmsapi_package import RmsProjectType, rmsapi
|
|
13
|
+
|
|
14
|
+
logger = null_logger(__name__)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class _DomainType(str, enum.Enum):
|
|
18
|
+
"""Valid 'domain' types for Roxar API operations, invoked with 'domain=...'"""
|
|
19
|
+
|
|
20
|
+
DEPTH = "depth"
|
|
21
|
+
TIME = "time"
|
|
22
|
+
THICKNESS = "thickness"
|
|
23
|
+
UNKNOWN = "unknown"
|
|
24
|
+
|
|
25
|
+
@classmethod
|
|
26
|
+
def values(cls) -> list[str]:
|
|
27
|
+
"""Return list of all valid domain type values."""
|
|
28
|
+
return [item.value for item in cls]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class _DomainTypeClipBoardGeneral2D(str, enum.Enum):
|
|
32
|
+
"""
|
|
33
|
+
For clipboard/general2d_data where "thickness" is not valid according to API docs.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
DEPTH = "depth"
|
|
37
|
+
TIME = "time"
|
|
38
|
+
UNKNOWN = "unknown"
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def values(cls) -> list[str]:
|
|
42
|
+
"""Return list of all valid domain type values."""
|
|
43
|
+
return [item.value for item in cls]
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class _StorageTypeRegularSurface(str, enum.Enum):
|
|
47
|
+
"""Valid 'storage' types for reg. surf in RMS, invoked with 'stype=...'"""
|
|
48
|
+
|
|
49
|
+
HORIZONS = "horizons"
|
|
50
|
+
ZONES = "zones"
|
|
51
|
+
CLIPBOARD = "clipboard"
|
|
52
|
+
GENERAL2D_DATA = "general2d_data"
|
|
53
|
+
TRENDS = "trends"
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def values(cls) -> list[str]:
|
|
57
|
+
"""Return list of all valid surface type values."""
|
|
58
|
+
return [item.value for item in cls]
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class RmsApiUtils:
|
|
62
|
+
"""Class RmsApiUtils, for accessing project level methods::
|
|
63
|
+
|
|
64
|
+
import xtgeo
|
|
65
|
+
|
|
66
|
+
xr = xtgeo.RmsApiUtils(project)
|
|
67
|
+
xr.create_horizon_category('DS_extracted_run3')
|
|
68
|
+
xr.delete_horizon_category('DS_extracted_run2')
|
|
69
|
+
|
|
70
|
+
The project itself can be a reference to an existing project, typically
|
|
71
|
+
the magic ``project`` wording inside RMS python,
|
|
72
|
+
or a file path to a RMS project (for external access).
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
project (rmsapi.Project or str): Reference to a RMS project
|
|
76
|
+
either an existing instance or a RMS project folder path.
|
|
77
|
+
readonly (bool). Default is False. If readonly, then it cannot be
|
|
78
|
+
saved to this project (which is the case for "secondary" projects).
|
|
79
|
+
|
|
80
|
+
Examples::
|
|
81
|
+
|
|
82
|
+
import xtgeo
|
|
83
|
+
path = '/some/path/to/rmsproject.rmsx'
|
|
84
|
+
|
|
85
|
+
ext = xtgeo.RoxUtils(path, readonly=True)
|
|
86
|
+
# ...do something
|
|
87
|
+
ext.safe_close()
|
|
88
|
+
|
|
89
|
+
"""
|
|
90
|
+
|
|
91
|
+
def __init__(self, project: RmsProjectType, readonly: bool = False) -> None:
|
|
92
|
+
self._project = None
|
|
93
|
+
|
|
94
|
+
if rmsapi is None:
|
|
95
|
+
raise RuntimeError(
|
|
96
|
+
"rmsapi package is not available. "
|
|
97
|
+
"Please install it to use RMS features."
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
self._version = rmsapi.__version__
|
|
101
|
+
|
|
102
|
+
if versionparse(self._version) < versionparse("1.10"):
|
|
103
|
+
raise RuntimeError("XTGeo >= 4.0 requires rmsapi API >= 1.10")
|
|
104
|
+
|
|
105
|
+
self._rmsexternal = True
|
|
106
|
+
|
|
107
|
+
self._versions = {
|
|
108
|
+
"1.0": ["10.0.x"],
|
|
109
|
+
"1.1": ["10.1.0", "10.1.1", "10.1.2"],
|
|
110
|
+
"1.1.1": ["10.1.3"],
|
|
111
|
+
"1.2": ["11.0.0"],
|
|
112
|
+
"1.2.1": ["11.0.1"],
|
|
113
|
+
"1.3": ["11.1.0", "11.1.1", "11.1.2"],
|
|
114
|
+
"1.4": ["12.0.0", "12.0.1", "12.0.2"],
|
|
115
|
+
"1.5": ["12.1"],
|
|
116
|
+
"1.6": ["13.0"],
|
|
117
|
+
"1.7": ["13.1"],
|
|
118
|
+
"1.7.1": ["13.1.1"],
|
|
119
|
+
"1.7.2": ["13.1.2"],
|
|
120
|
+
"1.8": ["14.0", "14.0.1"],
|
|
121
|
+
"1.9": ["14.1"],
|
|
122
|
+
"1.10": ["14.2"],
|
|
123
|
+
"1.11": ["14.2.1", "14.2.2"],
|
|
124
|
+
"1.12": ["14.5"],
|
|
125
|
+
"1.12.1": ["14.5.0.1"],
|
|
126
|
+
"1.13": ["15", "15.0.1.0"],
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if project is not None and isinstance(project, (str, pathlib.Path)):
|
|
130
|
+
projectname = str(project)
|
|
131
|
+
self._project = rmsapi.Project.open(projectname, readonly=readonly)
|
|
132
|
+
logger.info("Open RMS project from %s", projectname)
|
|
133
|
+
|
|
134
|
+
elif isinstance(project, rmsapi.Project):
|
|
135
|
+
# this will happen for _current_ project inside RMS or if
|
|
136
|
+
# project is opened already e.g. by rmsapi.Project.open(). In the latter
|
|
137
|
+
# case, the user should also close the project by project.close() as
|
|
138
|
+
# an explicit action.
|
|
139
|
+
|
|
140
|
+
self._rmsexternal = False
|
|
141
|
+
self._project = project
|
|
142
|
+
logger.info("RMS project instance is already open as <%s>", project)
|
|
143
|
+
else:
|
|
144
|
+
raise RuntimeError("Project is not valid")
|
|
145
|
+
|
|
146
|
+
@property
|
|
147
|
+
def rmsapiversion(self) -> str:
|
|
148
|
+
"""RMS API version (read only)"""
|
|
149
|
+
return self._version
|
|
150
|
+
|
|
151
|
+
roxversion = rmsapiversion
|
|
152
|
+
|
|
153
|
+
@property
|
|
154
|
+
def project(self) -> RmsProjectType:
|
|
155
|
+
"""The RMS project instance (read only)"""
|
|
156
|
+
return self._project
|
|
157
|
+
|
|
158
|
+
def safe_close(self) -> None:
|
|
159
|
+
"""Close the project but only if rms apps (external) mode, i.e.
|
|
160
|
+
not current RMS project
|
|
161
|
+
|
|
162
|
+
In case rmsapi.Project.open() is done explicitly, safe_close() will do nothing.
|
|
163
|
+
|
|
164
|
+
"""
|
|
165
|
+
if self._rmsexternal and self._project is not None:
|
|
166
|
+
try:
|
|
167
|
+
self._project.close()
|
|
168
|
+
logger.info("RMS project instance is closed")
|
|
169
|
+
except TypeError as msg:
|
|
170
|
+
warnings.warn(str(msg), UserWarning, stacklevel=2)
|
|
171
|
+
else:
|
|
172
|
+
logger.info("Close request, but skip for good reasons...")
|
|
173
|
+
logger.debug(
|
|
174
|
+
"... either in RMS GUI or in a sequence of running rmsapi apps"
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
def version_required(self, targetversion: str) -> bool:
|
|
178
|
+
"""Defines a minimum RMSAPI version for some feature (True or False).
|
|
179
|
+
|
|
180
|
+
Args:
|
|
181
|
+
targetversion (str): Minimum version to compare with.
|
|
182
|
+
|
|
183
|
+
Example::
|
|
184
|
+
|
|
185
|
+
rox = RmsApiUtils(project)
|
|
186
|
+
if rox.version_required('1.5'):
|
|
187
|
+
somefunction()
|
|
188
|
+
else:
|
|
189
|
+
print('Not supported in this version')
|
|
190
|
+
|
|
191
|
+
"""
|
|
192
|
+
return versionparse(self._version) >= versionparse(targetversion)
|
|
193
|
+
|
|
194
|
+
def rmsversion(self, apiversion: str) -> list[str] | None:
|
|
195
|
+
"""Get the actual RMS version(s) given an API version.
|
|
196
|
+
|
|
197
|
+
Args:
|
|
198
|
+
apiversion (str): ROXAPI version to ask for
|
|
199
|
+
|
|
200
|
+
Returns:
|
|
201
|
+
A list of RMS version(s) for the given API version, None if
|
|
202
|
+
not any match.
|
|
203
|
+
|
|
204
|
+
Example::
|
|
205
|
+
|
|
206
|
+
rox = RmsApiUtils(project)
|
|
207
|
+
rmsver = rox.rmsversion('1.5')
|
|
208
|
+
print('The supported RMS version are {}'.format(rmsver))
|
|
209
|
+
|
|
210
|
+
"""
|
|
211
|
+
|
|
212
|
+
return self._versions.get(apiversion, None)
|
|
213
|
+
|
|
214
|
+
def _create_whatever_category(
|
|
215
|
+
self,
|
|
216
|
+
category: str | list[str],
|
|
217
|
+
stype: str = "horizons",
|
|
218
|
+
domain: Literal["depth", "time", "thickness", "unknown"] = "depth",
|
|
219
|
+
htype: Literal["surface", "lines", "points"] = "surface",
|
|
220
|
+
) -> None:
|
|
221
|
+
"""Create one or more a Horizons/Zones... category entries.
|
|
222
|
+
|
|
223
|
+
Args:
|
|
224
|
+
category (str or list): Name(s) of category to make, either as
|
|
225
|
+
a simple string or a list of strings.
|
|
226
|
+
stype (str): 'Super type' in RMS (horizons or zones).
|
|
227
|
+
Default is horizons
|
|
228
|
+
domain (str): The vertical_domian in RMS, 'depth' (default) or 'time'
|
|
229
|
+
htype (str): Horizon type: surface/lines/points
|
|
230
|
+
"""
|
|
231
|
+
|
|
232
|
+
project = self.project
|
|
233
|
+
# At this point, project is always a Project instance
|
|
234
|
+
# (str/Path converted in __init__)
|
|
235
|
+
assert rmsapi is not None
|
|
236
|
+
assert isinstance(project, rmsapi.Project), "Project must be initialized"
|
|
237
|
+
|
|
238
|
+
categories = []
|
|
239
|
+
|
|
240
|
+
if isinstance(category, str):
|
|
241
|
+
categories.append(category)
|
|
242
|
+
else:
|
|
243
|
+
categories.extend(category)
|
|
244
|
+
|
|
245
|
+
for catg in categories:
|
|
246
|
+
geom = rmsapi.GeometryType.surface
|
|
247
|
+
if htype.lower() == "lines":
|
|
248
|
+
geom = rmsapi.GeometryType.polylines
|
|
249
|
+
elif htype.lower() == "points":
|
|
250
|
+
geom = rmsapi.GeometryType.points
|
|
251
|
+
|
|
252
|
+
dom = rmsapi.VerticalDomain.depth
|
|
253
|
+
if domain.lower() == "time":
|
|
254
|
+
dom = rmsapi.VerticalDomain.time
|
|
255
|
+
elif domain.lower() == "thickness":
|
|
256
|
+
dom = rmsapi.VerticalDomain.thickness
|
|
257
|
+
elif domain.lower() == "unknown":
|
|
258
|
+
dom = rmsapi.VerticalDomain.unknown
|
|
259
|
+
|
|
260
|
+
if stype.lower() == "horizons":
|
|
261
|
+
if catg not in project.horizons.representations:
|
|
262
|
+
try:
|
|
263
|
+
project.horizons.representations.create(catg, geom, dom)
|
|
264
|
+
except Exception as exmsg:
|
|
265
|
+
print(f"Error: {exmsg}")
|
|
266
|
+
else:
|
|
267
|
+
print(f"Category <{catg}> already exists")
|
|
268
|
+
|
|
269
|
+
elif stype.lower() == "zones":
|
|
270
|
+
if catg not in project.zones.representations:
|
|
271
|
+
try:
|
|
272
|
+
project.zones.representations.create(catg, geom, dom)
|
|
273
|
+
except Exception as exmsg:
|
|
274
|
+
print(f"Error: {exmsg}")
|
|
275
|
+
else:
|
|
276
|
+
print(f"Category <{catg}> already exists")
|
|
277
|
+
|
|
278
|
+
def _delete_whatever_category(
|
|
279
|
+
self,
|
|
280
|
+
category: str | list[str],
|
|
281
|
+
stype: Literal["horizons", "zones"] = "horizons",
|
|
282
|
+
) -> None:
|
|
283
|
+
"""Delete one or more horizons or zones categories.
|
|
284
|
+
|
|
285
|
+
Args:
|
|
286
|
+
category: Name(s) of category to make, either
|
|
287
|
+
as a simple string or a list of strings.
|
|
288
|
+
stype: 'Storage type', in RMS ('horizons' or 'zones').
|
|
289
|
+
Default is 'horizons'
|
|
290
|
+
"""
|
|
291
|
+
|
|
292
|
+
project = self._project
|
|
293
|
+
|
|
294
|
+
assert project is not None
|
|
295
|
+
categories = []
|
|
296
|
+
|
|
297
|
+
if isinstance(category, str):
|
|
298
|
+
categories.append(category)
|
|
299
|
+
else:
|
|
300
|
+
categories.extend(category)
|
|
301
|
+
|
|
302
|
+
for catg in categories:
|
|
303
|
+
stype_lower = stype.lower()
|
|
304
|
+
if stype_lower == "horizons" or stype_lower == "zones":
|
|
305
|
+
try:
|
|
306
|
+
del project.horizons.representations[catg]
|
|
307
|
+
except KeyError as kerr:
|
|
308
|
+
if str(kerr) == catg:
|
|
309
|
+
print(f"Cannot delete {kerr}, does not exist")
|
|
310
|
+
else:
|
|
311
|
+
raise ValueError("Wrong stype applied")
|
|
312
|
+
|
|
313
|
+
def _clear_whatever_category(
|
|
314
|
+
self,
|
|
315
|
+
category: str | list[str],
|
|
316
|
+
stype: Literal["horizons", "zones"] = "horizons",
|
|
317
|
+
) -> None:
|
|
318
|
+
"""Clear (or make empty) the content of one or more horizon/zones... categories.
|
|
319
|
+
|
|
320
|
+
Args:
|
|
321
|
+
category (str or list): Name(s) of category to empty, either as
|
|
322
|
+
a simple string or a list of strings.
|
|
323
|
+
stype (str): 'Super type' in RMS (horizons or zones).
|
|
324
|
+
Default is horizons
|
|
325
|
+
|
|
326
|
+
.. versionadded:: 2.1
|
|
327
|
+
"""
|
|
328
|
+
|
|
329
|
+
project = self._project
|
|
330
|
+
assert project is not None
|
|
331
|
+
|
|
332
|
+
categories = []
|
|
333
|
+
if isinstance(category, str):
|
|
334
|
+
categories.append(category)
|
|
335
|
+
else:
|
|
336
|
+
categories.extend(category)
|
|
337
|
+
|
|
338
|
+
xtype = project.horizons
|
|
339
|
+
if stype.lower() == "zones":
|
|
340
|
+
xtype = project.zones
|
|
341
|
+
|
|
342
|
+
for catg in categories:
|
|
343
|
+
for xitem in xtype:
|
|
344
|
+
try:
|
|
345
|
+
item = xtype[xitem.name][catg]
|
|
346
|
+
item.set_empty()
|
|
347
|
+
except KeyError as kmsg:
|
|
348
|
+
print(kmsg)
|
|
349
|
+
|
|
350
|
+
def create_horizons_category(
|
|
351
|
+
self,
|
|
352
|
+
category: str | list[str],
|
|
353
|
+
domain: Literal["depth", "time", "thickness", "unknown"] = "depth",
|
|
354
|
+
htype: Literal["surface", "lines", "points"] = "surface",
|
|
355
|
+
) -> None:
|
|
356
|
+
"""Create one or more a Horizons category entries.
|
|
357
|
+
|
|
358
|
+
Args:
|
|
359
|
+
category: Name(s) of category to make, either as
|
|
360
|
+
a simple string or a list of strings.
|
|
361
|
+
domain: The vertical_domain as 'depth' (default) or 'time'
|
|
362
|
+
htype: Horizon type: surface/lines/points
|
|
363
|
+
"""
|
|
364
|
+
|
|
365
|
+
self._create_whatever_category(
|
|
366
|
+
category, stype="horizons", domain=domain, htype=htype
|
|
367
|
+
)
|
|
368
|
+
|
|
369
|
+
def create_zones_category(
|
|
370
|
+
self,
|
|
371
|
+
category: str | list[str],
|
|
372
|
+
domain: Literal["thickness", "unknown"] = "thickness",
|
|
373
|
+
htype: Literal["surface", "lines", "points"] = "surface",
|
|
374
|
+
) -> None:
|
|
375
|
+
"""Create one or more a Zones category entries.
|
|
376
|
+
|
|
377
|
+
Args:
|
|
378
|
+
category (str or list): Name(s) of category to make, either as
|
|
379
|
+
a simple string or a list of strings.
|
|
380
|
+
domain (str): 'thickness' (default) or ...?
|
|
381
|
+
htype (str): Horizon type: surface/lines/points
|
|
382
|
+
"""
|
|
383
|
+
|
|
384
|
+
self._create_whatever_category(
|
|
385
|
+
category, stype="zones", domain=domain, htype=htype
|
|
386
|
+
)
|
|
387
|
+
|
|
388
|
+
def delete_horizons_category(self, category: str | list[str]) -> None:
|
|
389
|
+
"""Delete on or more horizons or zones categories"""
|
|
390
|
+
|
|
391
|
+
self._delete_whatever_category(category, stype="horizons")
|
|
392
|
+
|
|
393
|
+
def delete_zones_category(self, category: str | list[str]) -> None:
|
|
394
|
+
"""Delete on or more horizons or zones categories. See previous"""
|
|
395
|
+
|
|
396
|
+
self._delete_whatever_category(category, stype="zones")
|
|
397
|
+
|
|
398
|
+
def clear_horizon_category(self, category: str | list[str]) -> None:
|
|
399
|
+
"""Clear (or make empty) the content of one or more horizon categories.
|
|
400
|
+
|
|
401
|
+
Args:
|
|
402
|
+
category (str or list): Name(s) of category to empty, either as
|
|
403
|
+
a simple string or a list of strings.
|
|
404
|
+
|
|
405
|
+
.. versionadded:: 2.1
|
|
406
|
+
"""
|
|
407
|
+
self._clear_whatever_category(category, stype="horizons")
|
|
408
|
+
|
|
409
|
+
def clear_zone_category(self, category: str | list[str]) -> None:
|
|
410
|
+
"""Clear (or make empty) the content of one or more zone categories.
|
|
411
|
+
|
|
412
|
+
Args:
|
|
413
|
+
category (str or list): Name(s) of category to empty, either as
|
|
414
|
+
a simple string or a list of strings.
|
|
415
|
+
|
|
416
|
+
.. versionadded:: 2.1
|
|
417
|
+
"""
|
|
418
|
+
self._clear_whatever_category(category, stype="zones")
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
# Backward compatibility alias with deprecation warning. These PendingDeprecationWarning
|
|
422
|
+
# warnings can be upgraded to DeprecationWarning in future releases. Currently they are
|
|
423
|
+
# are not seen in RMS GUI for users due to warning filters, which is OK.
|
|
424
|
+
class RoxUtils(RmsApiUtils):
|
|
425
|
+
"""Deprecated: Use RmsApiUtils instead."""
|
|
426
|
+
|
|
427
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
428
|
+
warnings.warn(
|
|
429
|
+
"RoxUtils is deprecated and will be removed in a future version. "
|
|
430
|
+
"Use RmsApiUtils instead.",
|
|
431
|
+
PendingDeprecationWarning,
|
|
432
|
+
stacklevel=2,
|
|
433
|
+
)
|
|
434
|
+
super().__init__(*args, **kwargs)
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
# For convenience, also create a simple alias without the warning for internal use
|
|
438
|
+
_RoxUtils = RmsApiUtils # Internal alias without deprecation warning
|
xtgeo/io/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""XTGeo io module"""
|