resqpy.olio.vdb.VDB¶
- class resqpy.olio.vdb.VDB(path)[source]¶
Bases:
object
Class for handling a vdb, particularly to support import of grid and properties.
Methods:
__init__
(path)Initialises a VDB object and associates it with the given vdb directory path.
cases
()Returns a list of simulation case strings as found in the main xml file.
set_use_case
(case)Sets the simulation case to use in other functions.
print_header_tree
(relative_path)Low level: prints out the raw header tree found in the vdb file (for debugging).
print_key_tree
(relative_path)Low level: prints out the keyword tree found in the vdb file.
data_for_keyword
(relative_path, keyword[, ...])Reads data associated with a keyword from a vdb binary file; returns a numpy array (or string).
data_for_keyword_chain
(relative_path, ...)Follows a list of keywords down through hierarchy and returns the data as a numpy array (or string).
set_extent_kji
(extent_kji[, use_case, grid_name])Sets extent for one use case (defaults to current use case) as alternative to processing corp data.
fetch_corp_patch
(relative_path)Loads one patch of grid corp data from one file in the vdb; returns (number of cells, 1D array).
Returns a list of grid names for which corp data exists in the vdb for the current use case.
Loads root grid corp data from vdb; returns pagoda style resequenced 7D numpy array of doubles.
grid_corp
(grid_name)Loads corp data for named grid from vdb; returns pagoda style resequenced 7D numpy array of doubles.
load_init_mapdata_array
(file, keyword[, ...])Loads an INIT MAPDATA array from vdb; returns 3D numpy array coerced to dtype (if not None).
load_recurrent_mapdata_array
(file, keyword)Loads a RECUR MAPDATA array from vdb; returns 3D numpy array coerced to dtype (if not None).
root_dad
()Loads and returns the IROOTDAD array from vdb; returns 3D numpy int32 array.
grid_dad
(grid_name)Loads and returns the DAD array from vdb for the named grid; returns 3D numpy int32 array.
root_kid
()Loads and returns the IROOTKID array from vdb; returns 3D numpy int32 array (can be inactive cell mask).
grid_kid
(grid_name)Loads and returns the IROOTKID array from vdb; returns 3D numpy int32 array (can be inactive cell mask).
Loads the IROOTKID array and returns boolean mask of cells inactive in ROOT grid.
grid_kid_inactive_mask
(grid_name)Loads the KID array for the named grid and returns boolean mask of cells inactive in grid.
root_uid
()Loads and returns the IROOTUID array from vdb; returns 3D numpy int32 array.
grid_uid
(grid_name)Loads and returns the UID array from vdb for the named grid; returns 3D numpy int32 array.
Loads and returns the IROOTUNPACK array from vdb; returns 3D numpy int32 array.
grid_unpack
(grid_name)Loads and returns the IROOTUNPACK array from vdb; returns 3D numpy int32 array.
Returns list of static property keywords present in the vdb for ROOT.
grid_list_of_static_properties
(grid_name)Returns list of static property keywords present in the vdb for named grid.
root_static_property
(keyword[, dtype, unpack])Loads and returns a ROOT static property array.
grid_static_property
(grid_name, keyword[, ...])Loads and returns a static property array for named grid.
Returns a list of integer timesteps for which a ROOT recurrent mapdata file exists.
grid_list_of_timesteps
(grid_name)Returns a list of integer timesteps for which a recurrent mapdata file for the named grid exists.
list_of_recurrent_properties
(timestep)Returns list of recurrent property keywords present in the vdb for given timestep.
grid_list_of_recurrent_properties
(grid_name, ...)Returns list of recurrent property keywords present in the vdb for named grid for given timestep.
root_recurrent_property_for_timestep
(...[, ...])Loads and returns a ROOT recurrent property array for one timestep.
grid_recurrent_property_for_timestep
(...[, ...])Loads and returns a recurrent property array for named grid for one timestep.
header_place_for_keyword
(relative_path, keyword)Low level function to return file position for header relating to given keyword.
root_shaped
(a)Returns array reshaped to root grid extent for current use case, if known; otherwise unchanged.
grid_shaped
(grid_name, a)Returns array reshaped to named grid extent for current use case, if known; otherwise unchanged.
zip_glob
(path_with_asterisk)Performs glob.glob like function for zipped file, path must contain a single asterisk.
- __init__(path)[source]¶
Initialises a VDB object and associates it with the given vdb directory path.
- print_header_tree(relative_path)[source]¶
Low level: prints out the raw header tree found in the vdb file (for debugging).
- print_key_tree(relative_path)[source]¶
Low level: prints out the keyword tree found in the vdb file.
- data_for_keyword(relative_path, keyword, search=True)[source]¶
Reads data associated with a keyword from a vdb binary file; returns a numpy array (or string).
- data_for_keyword_chain(relative_path, keyword_chain)[source]¶
Follows a list of keywords down through hierarchy and returns the data as a numpy array (or string).
- set_extent_kji(extent_kji, use_case=None, grid_name='ROOT')[source]¶
Sets extent for one use case (defaults to current use case) as alternative to processing corp data.
- fetch_corp_patch(relative_path)[source]¶
Loads one patch of grid corp data from one file in the vdb; returns (number of cells, 1D array).
- list_of_grids()[source]¶
Returns a list of grid names for which corp data exists in the vdb for the current use case.
- root_corp()[source]¶
Loads root grid corp data from vdb; returns pagoda style resequenced 7D numpy array of doubles.
- grid_corp(grid_name)[source]¶
Loads corp data for named grid from vdb; returns pagoda style resequenced 7D numpy array of doubles.
- load_init_mapdata_array(file, keyword, dtype=None, unpack=False, grid_name='ROOT')[source]¶
Loads an INIT MAPDATA array from vdb; returns 3D numpy array coerced to dtype (if not None).
- load_recurrent_mapdata_array(file, keyword, dtype=None, unpack=False, grid_name='ROOT')[source]¶
Loads a RECUR MAPDATA array from vdb; returns 3D numpy array coerced to dtype (if not None).
- grid_dad(grid_name)[source]¶
Loads and returns the DAD array from vdb for the named grid; returns 3D numpy int32 array.
- root_kid()[source]¶
Loads and returns the IROOTKID array from vdb; returns 3D numpy int32 array (can be inactive cell mask).
- grid_kid(grid_name)[source]¶
Loads and returns the IROOTKID array from vdb; returns 3D numpy int32 array (can be inactive cell mask).
- root_kid_inactive_mask()[source]¶
Loads the IROOTKID array and returns boolean mask of cells inactive in ROOT grid.
- grid_kid_inactive_mask(grid_name)[source]¶
Loads the KID array for the named grid and returns boolean mask of cells inactive in grid.
- grid_uid(grid_name)[source]¶
Loads and returns the UID array from vdb for the named grid; returns 3D numpy int32 array.
- root_unpack()[source]¶
Loads and returns the IROOTUNPACK array from vdb; returns 3D numpy int32 array.
- grid_unpack(grid_name)[source]¶
Loads and returns the IROOTUNPACK array from vdb; returns 3D numpy int32 array.
- list_of_static_properties()[source]¶
Returns list of static property keywords present in the vdb for ROOT.
- grid_list_of_static_properties(grid_name)[source]¶
Returns list of static property keywords present in the vdb for named grid.
- root_static_property(keyword, dtype=None, unpack=None)[source]¶
Loads and returns a ROOT static property array.
- grid_static_property(grid_name, keyword, dtype=None, unpack=None)[source]¶
Loads and returns a static property array for named grid.
- list_of_timesteps()[source]¶
Returns a list of integer timesteps for which a ROOT recurrent mapdata file exists.
- grid_list_of_timesteps(grid_name)[source]¶
Returns a list of integer timesteps for which a recurrent mapdata file for the named grid exists.
- list_of_recurrent_properties(timestep)[source]¶
Returns list of recurrent property keywords present in the vdb for given timestep.
- grid_list_of_recurrent_properties(grid_name, timestep)[source]¶
Returns list of recurrent property keywords present in the vdb for named grid for given timestep.
- root_recurrent_property_for_timestep(keyword, timestep, dtype=None, unpack=True)[source]¶
Loads and returns a ROOT recurrent property array for one timestep.
- grid_recurrent_property_for_timestep(grid_name, keyword, timestep, dtype=None, unpack=True)[source]¶
Loads and returns a recurrent property array for named grid for one timestep.
- header_place_for_keyword(relative_path, keyword, search=True)[source]¶
Low level function to return file position for header relating to given keyword.
- root_shaped(a)[source]¶
Returns array reshaped to root grid extent for current use case, if known; otherwise unchanged.