resqpy 4.14.1__py3-none-any.whl → 5.1.5__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- resqpy/__init__.py +1 -1
- resqpy/fault/_gcs_functions.py +10 -10
- resqpy/fault/_grid_connection_set.py +277 -113
- resqpy/grid/__init__.py +2 -3
- resqpy/grid/_defined_geometry.py +3 -3
- resqpy/grid/_extract_functions.py +2 -1
- resqpy/grid/_grid.py +95 -12
- resqpy/grid/_grid_types.py +22 -7
- resqpy/grid/_points_functions.py +1 -1
- resqpy/grid/_regular_grid.py +6 -2
- resqpy/grid_surface/__init__.py +17 -38
- resqpy/grid_surface/_blocked_well_populate.py +5 -5
- resqpy/grid_surface/_find_faces.py +1349 -253
- resqpy/lines/_polyline.py +24 -33
- resqpy/model/_catalogue.py +9 -0
- resqpy/model/_forestry.py +18 -14
- resqpy/model/_hdf5.py +11 -3
- resqpy/model/_model.py +85 -10
- resqpy/model/_xml.py +38 -13
- resqpy/multi_processing/wrappers/grid_surface_mp.py +92 -37
- resqpy/olio/read_nexus_fault.py +8 -2
- resqpy/olio/relperm.py +1 -1
- resqpy/olio/transmission.py +8 -8
- resqpy/olio/triangulation.py +36 -30
- resqpy/olio/vector_utilities.py +340 -6
- resqpy/olio/volume.py +0 -20
- resqpy/olio/wellspec_keywords.py +19 -13
- resqpy/olio/write_hdf5.py +1 -1
- resqpy/olio/xml_et.py +12 -0
- resqpy/property/__init__.py +6 -4
- resqpy/property/_collection_add_part.py +4 -3
- resqpy/property/_collection_create_xml.py +4 -2
- resqpy/property/_collection_get_attributes.py +4 -0
- resqpy/property/attribute_property_set.py +311 -0
- resqpy/property/grid_property_collection.py +11 -11
- resqpy/property/property_collection.py +79 -31
- resqpy/property/property_common.py +3 -8
- resqpy/rq_import/_add_surfaces.py +34 -14
- resqpy/rq_import/_grid_from_cp.py +2 -2
- resqpy/rq_import/_import_nexus.py +75 -48
- resqpy/rq_import/_import_vdb_all_grids.py +64 -52
- resqpy/rq_import/_import_vdb_ensemble.py +12 -13
- resqpy/surface/_mesh.py +4 -0
- resqpy/surface/_surface.py +593 -118
- resqpy/surface/_tri_mesh.py +22 -12
- resqpy/surface/_tri_mesh_stencil.py +4 -4
- resqpy/surface/_triangulated_patch.py +71 -51
- resqpy/time_series/_any_time_series.py +7 -4
- resqpy/time_series/_geologic_time_series.py +1 -1
- resqpy/unstructured/_hexa_grid.py +6 -2
- resqpy/unstructured/_prism_grid.py +13 -5
- resqpy/unstructured/_pyramid_grid.py +6 -2
- resqpy/unstructured/_tetra_grid.py +6 -2
- resqpy/unstructured/_unstructured_grid.py +6 -2
- resqpy/well/_blocked_well.py +1986 -1946
- resqpy/well/_deviation_survey.py +3 -3
- resqpy/well/_md_datum.py +11 -21
- resqpy/well/_trajectory.py +10 -5
- resqpy/well/_wellbore_frame.py +10 -2
- resqpy/well/blocked_well_frame.py +3 -3
- resqpy/well/well_object_funcs.py +7 -9
- resqpy/well/well_utils.py +33 -0
- {resqpy-4.14.1.dist-info → resqpy-5.1.5.dist-info}/METADATA +8 -9
- {resqpy-4.14.1.dist-info → resqpy-5.1.5.dist-info}/RECORD +66 -66
- {resqpy-4.14.1.dist-info → resqpy-5.1.5.dist-info}/WHEEL +1 -1
- resqpy/grid/_moved_functions.py +0 -15
- {resqpy-4.14.1.dist-info → resqpy-5.1.5.dist-info}/LICENSE +0 -0
@@ -67,55 +67,78 @@ def import_nexus(
|
|
67
67
|
ensemble_size_limit = None,
|
68
68
|
grid_title = 'ROOT',
|
69
69
|
mode = 'w',
|
70
|
-
progress_fn = None
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
vdb_case (str, optional): required if the vdb contains more than one case
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
70
|
+
progress_fn = None,
|
71
|
+
vdb_property_list = None):
|
72
|
+
"""Read a Nexus grid geometry (from ascii input or vdb) and optionally grid properties.
|
73
|
+
|
74
|
+
arguments:
|
75
|
+
- resqml_file_root (str): output path and file name without .epc or .h5 extension
|
76
|
+
- extent_ijk (triple float, optional): ijk extents (fortran ordering)
|
77
|
+
- vdb_file (str, optional): vdb input file, either this or corp_file should be not None;
|
78
|
+
required if importing from a vdb
|
79
|
+
- vdb_case (str, optional): required if the vdb contains more than one case;
|
80
|
+
if None, first case in vdb is used
|
81
|
+
- corp_file (str, optional): required if importing from corp ascii file;
|
82
|
+
corp ascii input file containing nexus corp data without keyword
|
83
|
+
- corp_bin_file (str, optional): required if importing from corp binary file
|
84
|
+
- corp_xy_units (str, default 'm'): xy length units
|
85
|
+
- corp_z_units (str, default 'm'): z length units
|
86
|
+
- corp_z_inc_down (bool, default True): if True z values increase with depth
|
87
|
+
- ijk_handedness (str, default 'right'): 'right' or 'left'
|
88
|
+
- corp_eight_mode (bool, default False): if True the ordering of corner point data
|
89
|
+
is in nexus EIGHT mode
|
90
|
+
- geometry_defined_everywhere (bool, default True): if False then inactive cells are
|
91
|
+
marked as not having geometry
|
92
|
+
- treat_as_nan (float, default None): if a value is provided corner points with
|
93
|
+
this value will be assigned not-a-number
|
94
|
+
- active_mask_file (str, default None): ascii property file holding values 0 or 1,
|
95
|
+
with 1 indicating active cells
|
96
|
+
- use_binary (bool, default False): if True a cached binary version of ascii files
|
97
|
+
will be used (pure binary, not corp bin format)
|
98
|
+
- resqml_xy_units (str, default 'm'): output xy units for resqml file
|
99
|
+
- resqml_z_units (str, default 'm'): output z units for resqml file
|
100
|
+
- resqml_z_inc_down (bool, default True): if True z values increase with depth for
|
101
|
+
output resqml file
|
102
|
+
- shift_to_local (bool, default False): if True then a local origin will be used in the CRS
|
103
|
+
- local_origin_place (str, default 'centre'): 'centre' or 'minimum'; if 'centre' the
|
104
|
+
local origin is placed at the centre of the grid; ignored if shift_to_local is False
|
105
|
+
- max_z_void (float, default 0.1): maximum z gap between vertically neighbouring corner points;
|
106
|
+
vertical gaps greater than this will introduce k gaps into resqml grid; units are corp z units
|
107
|
+
- split_pillars (bool, default True): if False an unfaulted grid will be generated
|
108
|
+
- split_tolerance (float, default 0.01): maximum distance between neighbouring corner points
|
109
|
+
before a pillar is considered 'split'; applies to each of x, y, z differences
|
110
|
+
- property_array_files (list, default None): list of (filename, keyword, uom, time_index, null_value, discrete)
|
111
|
+
- summary_file (str, default None): nexus output summary file, used to extract timestep dates
|
112
|
+
when loading recurrent data from vdb
|
113
|
+
- vdb_static_properties (bool, default True): if True, static vdb properties are imported;
|
114
|
+
only relevant if vdb_file is not None; see also vdb_property_list
|
115
|
+
- vdb_recurrent_properties (bool, default False): if True, recurrent vdb properties are imported;
|
116
|
+
only relevant if vdb_file is not None; see also vdb_property_list
|
117
|
+
- timestep_selection (str, default 'all): 'first', 'last', 'first and last', 'all',
|
118
|
+
or list of ints being reporting timestep numbers; ignored if vdb_recurrent_properties is False
|
119
|
+
- use_compressed_time_series (bool, default True): generates reduced time series containing
|
120
|
+
timesteps with recurrent properties from vdb, rather than full nexus summary time series
|
121
|
+
- decoarsen (bool, default True): where ICOARSE is present, redistribute data to uncoarse cells
|
122
|
+
- ab_property_list (list, optional): list of
|
123
|
+
(file_name, keyword, property_kind, facet_type, facet, uom, time_index, null_value, discrete)
|
124
|
+
- create_property_set (bool, default False): if True a resqml PropertySet is created
|
125
|
+
- ensemble_case_dirs_root (str, optional): path up to but excluding realisation number
|
126
|
+
- ensemble_property_dictionary (str, optional): dictionary mapping title (or keyword) to
|
127
|
+
(filename, property_kind, facet_type, facet, uom, time_index, null_value, discrete)
|
128
|
+
- ensemble_size_limit (int, optional): if present processing of ensemble will terminate
|
129
|
+
after this number of cases is reached
|
130
|
+
- grid_title (str, default 'ROOT'): grid citation title
|
131
|
+
- mode (str, default 'w'): 'w' or 'a', mode to write or append to hdf5
|
132
|
+
- progress_fn (function, default None): if present function must have one floating argument
|
133
|
+
with value increasing from 0.0 to 1.0, and is called at intervals to indicate progress
|
134
|
+
- vdb_property_list (list of str, optional): list of vdb static and/or recurrent properties to
|
135
|
+
include in the import; if None, all properties are imported; vdb_static_properties and
|
136
|
+
vdb_recurrent_properties boolean arguments must also be set True for respective properties
|
137
|
+
to be included; ignored if not importing from vdb
|
138
|
+
|
139
|
+
returns:
|
140
|
+
- resqml model in memory & written to disc
|
117
141
|
"""
|
118
|
-
|
119
142
|
if resqml_file_root.endswith('.epc'):
|
120
143
|
resqml_file_root = resqml_file_root[:-4]
|
121
144
|
assert mode in ['w', 'a']
|
@@ -333,6 +356,8 @@ def import_nexus(
|
|
333
356
|
prop_import_collection = rp.GridPropertyCollection()
|
334
357
|
prop_import_collection.set_grid(grid)
|
335
358
|
for keyword in props:
|
359
|
+
if vdb_property_list is not None and keyword not in vdb_property_list:
|
360
|
+
continue
|
336
361
|
prop_import_collection.import_vdb_static_property_to_cache(vdbase, keyword, grid_name = grid_title)
|
337
362
|
# if active_mask is not None:
|
338
363
|
# prop_import_collection.add_cached_array_to_imported_list(active_mask, active_mask_file, 'ACTIVE', property_kind = 'active',
|
@@ -520,6 +545,8 @@ def import_nexus(
|
|
520
545
|
for keyword in recur_prop_list:
|
521
546
|
if vdb.bad_keyword(keyword):
|
522
547
|
continue
|
548
|
+
if vdb_property_list is not None and keyword not in vdb_property_list:
|
549
|
+
continue
|
523
550
|
prop_kind, facet_type, facet = rp.property_kind_and_facet_from_keyword(keyword)
|
524
551
|
step_import_collection.import_vdb_recurrent_property_to_cache(
|
525
552
|
vdbase,
|
@@ -10,60 +10,71 @@ import resqpy.olio.vdb as vdb
|
|
10
10
|
import resqpy.rq_import as rqi
|
11
11
|
|
12
12
|
|
13
|
-
def import_vdb_all_grids(
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
# 'first', 'last', 'first and last', 'all', or list of ints being reporting timestep numbers
|
38
|
-
create_property_set = False):
|
13
|
+
def import_vdb_all_grids(resqml_file_root,
|
14
|
+
extent_ijk = None,
|
15
|
+
vdb_file = None,
|
16
|
+
vdb_case = None,
|
17
|
+
corp_xy_units = 'm',
|
18
|
+
corp_z_units = 'm',
|
19
|
+
corp_z_inc_down = True,
|
20
|
+
ijk_handedness = 'right',
|
21
|
+
geometry_defined_everywhere = True,
|
22
|
+
treat_as_nan = None,
|
23
|
+
resqml_xy_units = 'm',
|
24
|
+
resqml_z_units = 'm',
|
25
|
+
resqml_z_inc_down = True,
|
26
|
+
shift_to_local = False,
|
27
|
+
local_origin_place = 'centre',
|
28
|
+
max_z_void = 0.1,
|
29
|
+
split_pillars = True,
|
30
|
+
split_tolerance = 0.01,
|
31
|
+
vdb_static_properties = True,
|
32
|
+
vdb_recurrent_properties = False,
|
33
|
+
decoarsen = True,
|
34
|
+
timestep_selection = 'all',
|
35
|
+
create_property_set = False,
|
36
|
+
vdb_property_list = None):
|
39
37
|
"""Creates a RESQML dataset containing grids and grid properties, including LGRs, for a single realisation.
|
40
38
|
|
41
|
-
|
42
|
-
resqml_file_root (str): output path and file name without .epc or .h5 extension
|
43
|
-
extent_ijk (triple float, optional): ijk extents (fortran ordering)
|
44
|
-
vdb_file (str, optional): vdb input file, either this or corp_file should be not None
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
39
|
+
arguments:
|
40
|
+
- resqml_file_root (str): output path and file name without .epc or .h5 extension
|
41
|
+
- extent_ijk (triple float, optional): ijk extents (fortran ordering)
|
42
|
+
- vdb_file (str, optional): vdb input file, either this or corp_file should be not None;
|
43
|
+
required if importing from a vdb
|
44
|
+
- vdb_case (str, optional): required if the vdb contains more than one case;
|
45
|
+
if None, first case in vdb is used
|
46
|
+
- corp_xy_units (str, default 'm'): xy length units
|
47
|
+
- corp_z_units (str, default 'm'): z length units
|
48
|
+
- corp_z_inc_down (bool, default True): if True z values increase with depth
|
49
|
+
- ijk_handedness (str, default 'right'): 'right' or 'left'
|
50
|
+
- geometry_defined_everywhere (bool, default True): if False then inactive cells are marked
|
51
|
+
as not having geometry
|
52
|
+
- treat_as_nan (float, default None): if a value is provided corner points with this value
|
53
|
+
will be assigned nan (not-a-number)
|
54
|
+
- resqml_xy_units (str, default 'm'): output xy units for resqml file
|
55
|
+
- resqml_z_units (str, default 'm'): output z units for resqml file
|
56
|
+
- resqml_z_inc_down (bool, default True): if True z values increase with depth in output resqml file
|
57
|
+
- shift_to_local (bool, default False): if True then a local origin will be used in the CRS
|
58
|
+
- local_origin_place (str, default 'centre'): 'centre' or 'minimum'; if 'centre' the local origin
|
59
|
+
is placed at the centre of the grid; ignored if shift_to_local is False
|
60
|
+
- max_z_void (float, default 0.1): maximum z gap between vertically neighbouring corner points;
|
61
|
+
vertical gaps greater than this will introduce k gaps into resqml grid; units are corp z units
|
62
|
+
- split_pillars (bool, default True): if False an unfaulted grid will be generated
|
63
|
+
- split_tolerance (float, default 0.01): maximum distance between neighbouring corner points
|
64
|
+
before a pillar is considered 'split'; applies to each of x, y, z differences
|
65
|
+
- vdb_static_properties (bool, default True): if True, static vdb properties are imported;
|
66
|
+
only relevant if vdb_file is not None; see also vdb_property_list
|
67
|
+
- vdb_recurrent_properties (bool, default False): if True, recurrent vdb properties are imported;
|
68
|
+
only relevant if vdb_file is not None; see also vdb_property_list
|
69
|
+
- decoarsen (bool, default True): where ICOARSE is present, redistribute data to uncoarse cells
|
70
|
+
- timestep_selection (str, default 'all): 'first', 'last', 'first and last', 'all', or list of ints
|
71
|
+
being reporting timestep numbers to include; ignored if vdb_recurrent_properties is False
|
72
|
+
- create_property_set (bool, default False): if True a resqml PropertySet is created
|
73
|
+
- vdb_property_list (list of str, optional): list of vdb static and/or recurrent properties to
|
74
|
+
include in the import; if None, all properties are imported; vdb_static_properties and
|
75
|
+
vdb_recurrent_properties boolean arguments must also be set True for respective properties
|
76
|
+
to be included; ignored if not importing from vdb
|
65
77
|
"""
|
66
|
-
|
67
78
|
vdbase = vdb.VDB(vdb_file)
|
68
79
|
case_list = vdbase.cases()
|
69
80
|
assert len(case_list) > 0, 'no cases found in vdb'
|
@@ -104,5 +115,6 @@ def import_vdb_all_grids(
|
|
104
115
|
timestep_selection = timestep_selection,
|
105
116
|
create_property_set = create_property_set,
|
106
117
|
grid_title = grid_name,
|
107
|
-
mode = 'w' if index == 0 else 'a'
|
118
|
+
mode = 'w' if index == 0 else 'a',
|
119
|
+
vdb_property_list = vdb_property_list)
|
108
120
|
index += 1
|
@@ -225,11 +225,11 @@ def import_vdb_ensemble(
|
|
225
225
|
vdb_file = ensemble_list[realisation]
|
226
226
|
log.info('processing realisation ' + str(realisation) + ' from: ' + str(vdb_file))
|
227
227
|
vdbase = vdb.VDB(vdb_file)
|
228
|
-
#
|
229
|
-
#
|
230
|
-
#
|
231
|
-
#
|
232
|
-
#
|
228
|
+
# case_list = vdbase.cases()
|
229
|
+
# assert len(case_list) > 0, 'no cases found in vdb: ' + str(vdb_file)
|
230
|
+
# if len(case_list) > 1: log.warning('more than one case found in vdb (using first): ' + str(vdb_file))
|
231
|
+
# vdb_case = case_list[0]
|
232
|
+
# vdbase.set_use_case(vdb_case)
|
233
233
|
vdbase.set_extent_kji(grid.extent_kji)
|
234
234
|
|
235
235
|
prop_import_collection = rp.GridPropertyCollection(realization = realisation)
|
@@ -243,9 +243,8 @@ def import_vdb_ensemble(
|
|
243
243
|
if keyword_list is not None and keyword not in keyword_list:
|
244
244
|
continue
|
245
245
|
prop_kind, facet_type, facet = rp.property_kind_and_facet_from_keyword(keyword)
|
246
|
-
if property_kind_list is not None and prop_kind not in property_kind_list and
|
247
|
-
|
248
|
-
]:
|
246
|
+
if property_kind_list is not None and prop_kind not in property_kind_list and \
|
247
|
+
prop_kind not in ['active', 'region initialization']:
|
249
248
|
continue
|
250
249
|
prop_import_collection.import_vdb_static_property_to_cache(vdbase,
|
251
250
|
keyword,
|
@@ -312,9 +311,9 @@ def import_vdb_ensemble(
|
|
312
311
|
if decoarsen_array is not None:
|
313
312
|
step_import_collection.decoarsen_imported_list(decoarsen_array = decoarsen_array)
|
314
313
|
# extend hdf5 with cached arrays for this timestep
|
315
|
-
#
|
316
|
-
#
|
317
|
-
#
|
314
|
+
# log.info('number of recurrent grid property arrays for timestep: ' + str(timestep_number) +
|
315
|
+
# ' is: ' + str(step_import_collection.number_of_imports()))
|
316
|
+
# log.info('extending hdf5 file with recurrent properties for timestep: ' + str(timestep_number))
|
318
317
|
grid.write_hdf5_from_caches(hdf5_file,
|
319
318
|
mode = 'a',
|
320
319
|
geometry = False,
|
@@ -322,8 +321,8 @@ def import_vdb_ensemble(
|
|
322
321
|
write_active = False)
|
323
322
|
# add imported list for this timestep to full imported list
|
324
323
|
prop_import_collection.inherit_imported_list_from_other_collection(step_import_collection)
|
325
|
-
#
|
326
|
-
#
|
324
|
+
# log.debug('total number of property arrays after timestep: ' + str(timestep_number) +
|
325
|
+
# ' is: ' + str(prop_import_collection.number_of_imports()))
|
327
326
|
# remove cached copies of arrays
|
328
327
|
step_import_collection.remove_all_cached_arrays()
|
329
328
|
|
resqpy/surface/_mesh.py
CHANGED
@@ -207,6 +207,10 @@ class Mesh(rqsb.BaseSurface):
|
|
207
207
|
extra_metadata = em)
|
208
208
|
return mesh
|
209
209
|
|
210
|
+
def is_big(self):
|
211
|
+
"""Returns True if the number of nodes exceeds 2^31 - 1, False otherwise."""
|
212
|
+
return (self.ni * self.nj >= 2_147_483_648)
|
213
|
+
|
210
214
|
def set_represented_interpretation_root(self, interp_root):
|
211
215
|
"""Makes a note of the xml root of the represented interpretation."""
|
212
216
|
|