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.
Files changed (122) hide show
  1. cxtgeo.py +558 -0
  2. cxtgeoPYTHON_wrap.c +19537 -0
  3. xtgeo/__init__.py +248 -0
  4. xtgeo/_cxtgeo.cp313-win_amd64.pyd +0 -0
  5. xtgeo/_internal.cp313-win_amd64.pyd +0 -0
  6. xtgeo/common/__init__.py +19 -0
  7. xtgeo/common/_angles.py +29 -0
  8. xtgeo/common/_xyz_enum.py +50 -0
  9. xtgeo/common/calc.py +396 -0
  10. xtgeo/common/constants.py +30 -0
  11. xtgeo/common/exceptions.py +42 -0
  12. xtgeo/common/log.py +93 -0
  13. xtgeo/common/sys.py +166 -0
  14. xtgeo/common/types.py +18 -0
  15. xtgeo/common/version.py +34 -0
  16. xtgeo/common/xtgeo_dialog.py +604 -0
  17. xtgeo/cube/__init__.py +9 -0
  18. xtgeo/cube/_cube_export.py +214 -0
  19. xtgeo/cube/_cube_import.py +532 -0
  20. xtgeo/cube/_cube_roxapi.py +180 -0
  21. xtgeo/cube/_cube_utils.py +287 -0
  22. xtgeo/cube/_cube_window_attributes.py +273 -0
  23. xtgeo/cube/cube1.py +1023 -0
  24. xtgeo/grid3d/__init__.py +15 -0
  25. xtgeo/grid3d/_ecl_grid.py +778 -0
  26. xtgeo/grid3d/_ecl_inte_head.py +152 -0
  27. xtgeo/grid3d/_ecl_logi_head.py +71 -0
  28. xtgeo/grid3d/_ecl_output_file.py +81 -0
  29. xtgeo/grid3d/_egrid.py +1004 -0
  30. xtgeo/grid3d/_find_gridprop_in_eclrun.py +625 -0
  31. xtgeo/grid3d/_grdecl_format.py +309 -0
  32. xtgeo/grid3d/_grdecl_grid.py +400 -0
  33. xtgeo/grid3d/_grid3d.py +29 -0
  34. xtgeo/grid3d/_grid3d_fence.py +284 -0
  35. xtgeo/grid3d/_grid3d_utils.py +228 -0
  36. xtgeo/grid3d/_grid_boundary.py +76 -0
  37. xtgeo/grid3d/_grid_etc1.py +1683 -0
  38. xtgeo/grid3d/_grid_export.py +222 -0
  39. xtgeo/grid3d/_grid_hybrid.py +50 -0
  40. xtgeo/grid3d/_grid_import.py +79 -0
  41. xtgeo/grid3d/_grid_import_ecl.py +101 -0
  42. xtgeo/grid3d/_grid_import_roff.py +135 -0
  43. xtgeo/grid3d/_grid_import_xtgcpgeom.py +375 -0
  44. xtgeo/grid3d/_grid_refine.py +258 -0
  45. xtgeo/grid3d/_grid_roxapi.py +292 -0
  46. xtgeo/grid3d/_grid_translate_coords.py +154 -0
  47. xtgeo/grid3d/_grid_wellzone.py +165 -0
  48. xtgeo/grid3d/_gridprop_export.py +202 -0
  49. xtgeo/grid3d/_gridprop_import_eclrun.py +164 -0
  50. xtgeo/grid3d/_gridprop_import_grdecl.py +132 -0
  51. xtgeo/grid3d/_gridprop_import_roff.py +52 -0
  52. xtgeo/grid3d/_gridprop_import_xtgcpprop.py +168 -0
  53. xtgeo/grid3d/_gridprop_lowlevel.py +171 -0
  54. xtgeo/grid3d/_gridprop_op1.py +272 -0
  55. xtgeo/grid3d/_gridprop_roxapi.py +301 -0
  56. xtgeo/grid3d/_gridprop_value_init.py +140 -0
  57. xtgeo/grid3d/_gridprops_import_eclrun.py +344 -0
  58. xtgeo/grid3d/_gridprops_import_roff.py +83 -0
  59. xtgeo/grid3d/_roff_grid.py +470 -0
  60. xtgeo/grid3d/_roff_parameter.py +303 -0
  61. xtgeo/grid3d/grid.py +3010 -0
  62. xtgeo/grid3d/grid_properties.py +699 -0
  63. xtgeo/grid3d/grid_property.py +1313 -0
  64. xtgeo/grid3d/types.py +15 -0
  65. xtgeo/interfaces/rms/__init__.py +18 -0
  66. xtgeo/interfaces/rms/_regular_surface.py +460 -0
  67. xtgeo/interfaces/rms/_rms_base.py +100 -0
  68. xtgeo/interfaces/rms/_rmsapi_package.py +69 -0
  69. xtgeo/interfaces/rms/rmsapi_utils.py +438 -0
  70. xtgeo/io/__init__.py +1 -0
  71. xtgeo/io/_file.py +603 -0
  72. xtgeo/metadata/__init__.py +17 -0
  73. xtgeo/metadata/metadata.py +435 -0
  74. xtgeo/roxutils/__init__.py +7 -0
  75. xtgeo/roxutils/_roxar_loader.py +54 -0
  76. xtgeo/roxutils/_roxutils_etc.py +122 -0
  77. xtgeo/roxutils/roxutils.py +207 -0
  78. xtgeo/surface/__init__.py +20 -0
  79. xtgeo/surface/_regsurf_boundary.py +26 -0
  80. xtgeo/surface/_regsurf_cube.py +210 -0
  81. xtgeo/surface/_regsurf_cube_window.py +391 -0
  82. xtgeo/surface/_regsurf_cube_window_v2.py +297 -0
  83. xtgeo/surface/_regsurf_cube_window_v3.py +360 -0
  84. xtgeo/surface/_regsurf_export.py +388 -0
  85. xtgeo/surface/_regsurf_grid3d.py +275 -0
  86. xtgeo/surface/_regsurf_gridding.py +347 -0
  87. xtgeo/surface/_regsurf_ijxyz_parser.py +278 -0
  88. xtgeo/surface/_regsurf_import.py +347 -0
  89. xtgeo/surface/_regsurf_lowlevel.py +122 -0
  90. xtgeo/surface/_regsurf_oper.py +538 -0
  91. xtgeo/surface/_regsurf_utils.py +81 -0
  92. xtgeo/surface/_surfs_import.py +43 -0
  93. xtgeo/surface/_zmap_parser.py +138 -0
  94. xtgeo/surface/regular_surface.py +3043 -0
  95. xtgeo/surface/surfaces.py +276 -0
  96. xtgeo/well/__init__.py +24 -0
  97. xtgeo/well/_blockedwell_roxapi.py +241 -0
  98. xtgeo/well/_blockedwells_roxapi.py +68 -0
  99. xtgeo/well/_well_aux.py +30 -0
  100. xtgeo/well/_well_io.py +327 -0
  101. xtgeo/well/_well_oper.py +483 -0
  102. xtgeo/well/_well_roxapi.py +304 -0
  103. xtgeo/well/_wellmarkers.py +486 -0
  104. xtgeo/well/_wells_utils.py +158 -0
  105. xtgeo/well/blocked_well.py +220 -0
  106. xtgeo/well/blocked_wells.py +134 -0
  107. xtgeo/well/well1.py +1516 -0
  108. xtgeo/well/wells.py +211 -0
  109. xtgeo/xyz/__init__.py +6 -0
  110. xtgeo/xyz/_polygons_oper.py +272 -0
  111. xtgeo/xyz/_xyz.py +758 -0
  112. xtgeo/xyz/_xyz_data.py +646 -0
  113. xtgeo/xyz/_xyz_io.py +737 -0
  114. xtgeo/xyz/_xyz_lowlevel.py +42 -0
  115. xtgeo/xyz/_xyz_oper.py +613 -0
  116. xtgeo/xyz/_xyz_roxapi.py +766 -0
  117. xtgeo/xyz/points.py +698 -0
  118. xtgeo/xyz/polygons.py +827 -0
  119. xtgeo-4.14.1.dist-info/METADATA +146 -0
  120. xtgeo-4.14.1.dist-info/RECORD +122 -0
  121. xtgeo-4.14.1.dist-info/WHEEL +5 -0
  122. xtgeo-4.14.1.dist-info/licenses/LICENSE.md +165 -0
xtgeo/__init__.py ADDED
@@ -0,0 +1,248 @@
1
+ # ruff: noqa
2
+ # type: ignore
3
+ """The XTGeo Python library."""
4
+
5
+ import os
6
+ import platform
7
+ import sys
8
+ import timeit
9
+ import warnings
10
+
11
+
12
+ def _timer(*args):
13
+ time1 = timeit.default_timer()
14
+
15
+ if args:
16
+ return time1 - args[0]
17
+
18
+ return time1
19
+
20
+
21
+ TIME0 = _timer()
22
+
23
+ DEBUG = 19
24
+
25
+ if os.environ.get("XTG_DEBUG_DEV") is None:
26
+ DEBUG = 0
27
+
28
+
29
+ def _xprint(msg):
30
+ difftime = _timer(TIME0)
31
+
32
+ if DEBUG:
33
+ print(f"({difftime:4.3f}) {msg}")
34
+
35
+
36
+ _xprint("XTGEO __init__ ...")
37
+
38
+
39
+ try:
40
+ from xtgeo.common.version import __version__, version
41
+ except ImportError:
42
+ __version__ = version = "0.0.0"
43
+
44
+ from xtgeo._cxtgeo import XTGeoCLibError
45
+ from xtgeo.common import XTGeoDialog
46
+ from xtgeo.common.constants import UNDEF, UNDEF_INT, UNDEF_INT_LIMIT, UNDEF_LIMIT
47
+ from xtgeo.common.exceptions import (
48
+ BlockedWellsNotFoundError,
49
+ DateNotFoundError,
50
+ GridNotFoundError,
51
+ InvalidFileFormatError,
52
+ KeywordFoundNoDateError,
53
+ KeywordNotFoundError,
54
+ WellNotFoundError,
55
+ )
56
+
57
+ _xprint("Import common... done")
58
+
59
+ _xprint("Import various XTGeo modules...")
60
+
61
+ from xtgeo.metadata.metadata import (
62
+ MetaDataCPGeometry,
63
+ MetaDataCPProperty,
64
+ MetaDataRegularCube,
65
+ MetaDataRegularSurface,
66
+ MetaDataWell,
67
+ )
68
+
69
+ _xprint("Import various XTGeo modules... metadata...")
70
+
71
+ from xtgeo.roxutils import roxutils
72
+ from xtgeo.roxutils.roxutils import RoxUtils
73
+
74
+ from xtgeo.well import blocked_well, blocked_wells, well1, wells
75
+ from xtgeo.well.blocked_well import (
76
+ BlockedWell,
77
+ blockedwell_from_file,
78
+ blockedwell_from_roxar,
79
+ )
80
+ from xtgeo.well.blocked_wells import (
81
+ BlockedWells,
82
+ blockedwells_from_files,
83
+ blockedwells_from_roxar,
84
+ )
85
+ from xtgeo.well.well1 import Well, well_from_file, well_from_roxar
86
+ from xtgeo.well.wells import Wells, wells_from_files
87
+ from xtgeo.xyz.points import (
88
+ points_from_file,
89
+ points_from_roxar,
90
+ points_from_surface,
91
+ points_from_wells,
92
+ points_from_wells_dfrac,
93
+ )
94
+
95
+ _xprint("Import various XTGeo modules... wells...")
96
+
97
+ from xtgeo.grid3d._ecl_grid import GridRelative, Units
98
+ from xtgeo.grid3d.grid import Grid
99
+ from xtgeo.grid3d.grid_properties import (
100
+ GridProperties,
101
+ gridproperties_dataframe,
102
+ gridproperties_from_file,
103
+ list_gridproperties,
104
+ )
105
+ from xtgeo.grid3d.grid_property import (
106
+ GridProperty,
107
+ gridproperty_from_file,
108
+ gridproperty_from_roxar,
109
+ )
110
+
111
+ _xprint("Import various XTGeo modules... 3D grids...")
112
+
113
+ from xtgeo.surface import regular_surface
114
+ from xtgeo.surface.regular_surface import (
115
+ RegularSurface,
116
+ surface_from_cube,
117
+ surface_from_file,
118
+ surface_from_grid3d,
119
+ surface_from_rms,
120
+ surface_from_roxar,
121
+ )
122
+ from xtgeo.surface.surfaces import Surfaces
123
+
124
+ _xprint("Import various XTGeo modules... surface...")
125
+
126
+ from xtgeo.cube import cube1
127
+ from xtgeo.cube.cube1 import Cube
128
+
129
+ _xprint("Import various XTGeo modules... cube...")
130
+
131
+ from xtgeo.xyz import points, polygons
132
+ from xtgeo.xyz.points import Points
133
+ from xtgeo.xyz.polygons import Polygons
134
+
135
+ _xprint("Import various XTGeo modules... xyz...")
136
+ _xprint("Import various XTGeo modules...DONE")
137
+
138
+ # some function wrappers to initiate objects from imports
139
+ _xprint("Import various XTGeo wrappers...")
140
+ from xtgeo.cube.cube1 import cube_from_file, cube_from_roxar
141
+ from xtgeo.grid3d.grid import (
142
+ create_box_grid,
143
+ grid_from_cube,
144
+ grid_from_file,
145
+ grid_from_roxar,
146
+ grid_from_surfaces,
147
+ )
148
+ from xtgeo.xyz.polygons import (
149
+ polygons_from_file,
150
+ polygons_from_roxar,
151
+ polygons_from_wells,
152
+ )
153
+
154
+ warnings.filterwarnings("default", category=DeprecationWarning, module="xtgeo")
155
+
156
+ _xprint("XTGEO __init__ done")
157
+
158
+ # Remove symbols imported for internal use
159
+ del os, platform, sys, timeit, warnings, TIME0, DEBUG, _timer, _xprint
160
+
161
+ # Let type-checkers know what is exported
162
+ __all__ = [
163
+ "BlockedWell",
164
+ "BlockedWells",
165
+ "BlockedWellsNotFoundError",
166
+ "Cube",
167
+ "DateNotFoundError",
168
+ "Grid",
169
+ "GridNotFoundError",
170
+ "GridProperties",
171
+ "GridProperty",
172
+ "GridRelative",
173
+ "GridRelative",
174
+ "InvalidFileFormatError",
175
+ "KeywordFoundNoDateError",
176
+ "KeywordNotFoundError",
177
+ "MetaDataCPGeometry",
178
+ "MetaDataCPProperty",
179
+ "MetaDataRegularCube",
180
+ "MetaDataRegularSurface",
181
+ "MetaDataWell",
182
+ "Points",
183
+ "Polygons",
184
+ "RegularSurface",
185
+ "RoxUtils",
186
+ "Surfaces",
187
+ "UNDEF",
188
+ "UNDEF_INT",
189
+ "UNDEF_INT_LIMIT",
190
+ "UNDEF_LIMIT",
191
+ "Units",
192
+ "Units",
193
+ "Well",
194
+ "WellNotFoundError",
195
+ "Wells",
196
+ "XTGeoCLibError",
197
+ "XTGeoDialog",
198
+ "__version__",
199
+ "blocked_well",
200
+ "blocked_wells",
201
+ "blockedwell_from_file",
202
+ "blockedwell_from_roxar",
203
+ "blockedwells_from_file",
204
+ "blockedwells_from_files",
205
+ "blockedwells_from_roxar",
206
+ "create_box_grid",
207
+ "cube1",
208
+ "cube_from_file",
209
+ "cube_from_roxar",
210
+ "grid",
211
+ "grid",
212
+ "grid_from_cube",
213
+ "grid_from_file",
214
+ "grid_from_roxar",
215
+ "grid_from_surfaces",
216
+ "grid_properties",
217
+ "grid_properties",
218
+ "grid_property",
219
+ "grid_property",
220
+ "gridproperties_dataframe",
221
+ "gridproperties_from_file",
222
+ "gridproperty_from_file",
223
+ "gridproperty_from_roxar",
224
+ "list_gridproperties",
225
+ "points",
226
+ "points_from_file",
227
+ "points_from_roxar",
228
+ "points_from_surface",
229
+ "points_from_wells",
230
+ "points_from_wells_dfrac",
231
+ "polygons",
232
+ "polygons_from_file",
233
+ "polygons_from_roxar",
234
+ "polygons_from_wells",
235
+ "regular_surface",
236
+ "roxutils",
237
+ "surface_from_cube",
238
+ "surface_from_file",
239
+ "surface_from_grid3d",
240
+ "surface_from_rms",
241
+ "surface_from_roxar",
242
+ "version",
243
+ "well1",
244
+ "well_from_file",
245
+ "well_from_roxar",
246
+ "wells",
247
+ "wells_from_files",
248
+ ]
Binary file
Binary file
@@ -0,0 +1,19 @@
1
+ """The XTGeo common package"""
2
+
3
+ from ._xyz_enum import _AttrName, _AttrType, _XYZType
4
+ from .exceptions import WellNotFoundError
5
+ from .log import null_logger
6
+ from .sys import inherit_docstring
7
+ from .xtgeo_dialog import XTGDescription, XTGeoDialog, XTGShowProgress
8
+
9
+ __all__ = [
10
+ "inherit_docstring",
11
+ "null_logger",
12
+ "WellNotFoundError",
13
+ "XTGDescription",
14
+ "XTGeoDialog",
15
+ "XTGShowProgress",
16
+ "_AttrName",
17
+ "_AttrType",
18
+ "_XYZType",
19
+ ]
@@ -0,0 +1,29 @@
1
+ from math import degrees, radians
2
+
3
+
4
+ def _deg_angle2azimuth(deg: float) -> float:
5
+ """Converts an angle from X-axis anti-clockwise orientation
6
+ to Y-axis clockwise azimuth.
7
+ """
8
+ return (-deg + 90) % 360
9
+
10
+
11
+ def _deg_azimuth2angle(deg: float) -> float:
12
+ """Converts azimuth from Y-axis clockwise orientation to X-axis
13
+ anti-clockwise angle.
14
+ """
15
+ return (450 - deg) % 360
16
+
17
+
18
+ def _rad_angle2azimuth(rad: float) -> float:
19
+ """Converts an angle from X-axis anti-clockwise orientation to Y-axis clockwise
20
+ azimuth in radians.
21
+ """
22
+ return radians(_deg_angle2azimuth(degrees(rad)))
23
+
24
+
25
+ def _rad_azimuth2angle(deg: float) -> float:
26
+ """Converts azimuth from Y-axis clockwise orientation to X-axis anti-clockwise
27
+ angle in radians.
28
+ """
29
+ return radians(_deg_azimuth2angle(degrees(deg)))
@@ -0,0 +1,50 @@
1
+ from enum import Enum, unique
2
+
3
+
4
+ # to be able to list all values in an easy manner e.g. _AttrName.list()
5
+ class ExtendedEnum(Enum):
6
+ @classmethod
7
+ def list(cls):
8
+ return [c.value for c in cls]
9
+
10
+
11
+ # default names of special column names
12
+ @unique
13
+ class _AttrName(ExtendedEnum):
14
+ XNAME = "X_UTME"
15
+ YNAME = "Y_UTMN"
16
+ ZNAME = "Z_TVDSS"
17
+ PNAME = "POLY_ID"
18
+ M_MD_NAME = "M_MDEPTH"
19
+ Q_MD_NAME = "Q_MDEPTH"
20
+ M_AZI_NAME = "M_AZI"
21
+ Q_AZI_NAME = "Q_AZI"
22
+ M_INCL_NAME = "M_INCL"
23
+ Q_INCL_NAME = "Q_INCL"
24
+ I_INDEX = "I_INDEX"
25
+ J_INDEX = "J_INDEX"
26
+ K_INDEX = "K_INDEX"
27
+ R_HLEN_NAME = "R_HLEN"
28
+ HNAME = "H_CUMLEN"
29
+ DHNAME = "H_DELTALEN"
30
+ TNAME = "T_CUMLEN"
31
+ DTNAME = "T_DELTALEN"
32
+ WELLNAME = "WELLNAME"
33
+ TRAJECTORY = "TRAJECTORY"
34
+
35
+
36
+ @unique
37
+ class _AttrType(ExtendedEnum):
38
+ """Enumerate type of attribute/log"""
39
+
40
+ CONT = "CONT"
41
+ DISC = "DISC"
42
+
43
+
44
+ @unique
45
+ class _XYZType(ExtendedEnum):
46
+ """Enumerate type of context"""
47
+
48
+ POINTS = "POINTS"
49
+ POLYGONS = "POLYGONS"
50
+ WELL = "WELL"