fmu.tools package
Subpackages
- fmu.tools.domainconversion package
- Submodules
- fmu.tools.domainconversion.dconvert module
DomainConversionDomainConversion.depth_surfacesDomainConversion.time_surfacesDomainConversion.namesDomainConversion.templateDomainConversion.max_depth_for_cube()DomainConversion.surface_names()DomainConversion.velocity_surfaces()DomainConversion.slowness_surfaces()DomainConversion.average_velocity_cube_in_timeDomainConversion.average_slowness_cube_in_depthDomainConversion.depth_convert_surfaces()DomainConversion.time_convert_surfaces()DomainConversion.depth_convert_cube()DomainConversion.time_convert_cube()
- Module contents
DomainConversionDomainConversion.depth_surfacesDomainConversion.time_surfacesDomainConversion.namesDomainConversion.templateDomainConversion.max_depth_for_cube()DomainConversion.surface_names()DomainConversion.velocity_surfaces()DomainConversion.slowness_surfaces()DomainConversion.average_velocity_cube_in_timeDomainConversion.average_slowness_cube_in_depthDomainConversion.depth_convert_surfaces()DomainConversion.time_convert_surfaces()DomainConversion.depth_convert_cube()DomainConversion.time_convert_cube()
- fmu.tools.ensembles package
- Submodules
- fmu.tools.ensembles.ensemble_well_props module
ScreenInfoget_parser_args()dump_example_config()parse_config()PropsDataConfigDataWellCaseEnsembleWellPropsEnsembleWellProps.wellEnsembleWellProps.realizationsEnsembleWellProps.cfgEnsembleWellProps.sinfoEnsembleWellProps.added_logsEnsembleWellProps.added_flag_logsEnsembleWellProps.cumlenreportEnsembleWellProps.cumlenreport_summaryEnsembleWellProps.process_ensemble_avglogs()EnsembleWellProps.process_ensemble_cumlen()EnsembleWellProps.optionally_delete_logs()EnsembleWellProps.optionally_delete_flag_logs()
loop_for_compute()run_compute()process_ensemble()main()
- Module contents
- fmu.tools.fipmapper package
- fmu.tools.nestedhybridgrid package
- fmu.tools.properties package
- fmu.tools.qcdata package
- fmu.tools.qcforward package
- fmu.tools.rms package
- Submodules
- fmu.tools.rms.copy_rms_param_to_ertbox_grid module
copy_rms_param()check_missing_keywords_list()from_geogrid_to_ertbox()from_ertbox_to_geogrid()get_grid_model()check_and_get_grid_dimensions()get_grid_indices()active_params_in_zone()ertbox_active_param_to_rms()define_active_parameters_in_ertbox()get_param_values()copy_parameters_for_zone()update_ertbox_properties_int()update_ertbox_properties_float()assign_undefined_constant()fill_remaining_masked_values_within_colum()assign_undefined_vertical()assign_undefined_lateral()extrapolate_values_for_zone()add_noise_to_undefined_grid_cell_values()copy_from_geo_to_ertbox_grid()check_geogrid_parameters()define_active_cell_indices()set_continuous_3d_parameter_values_in_zone_region()get_conformity()get_conformity_per_zone()get_grid_building_job_arguments()get_job_names()log_warning()check_and_get_grid_job_name()check_grid_layout()check_grid_conformity()assign_conformity()extract_values_from_geogrid_simbox_to_ertbox_grid()extract_values_from_ertbox_grid_to_geogrid_simbox()extract_active_values_from_geogrid_simbox_to_ertbox_grid()
- fmu.tools.rms.create_rft_ertobs module
- fmu.tools.rms.fluid_contacts_from_grid module
- fmu.tools.rms.generate_bw_per_facies module
- fmu.tools.rms.generate_petro_jobs_for_field_update module
main()check_rms_project()read_specification_file()check_specification()define_new_variable_names_and_correlation_matrix()sort_new_var_names()get_original_job_settings()create_copy_of_job()get_zone_names_per_facies()get_used_petro_names()set_new_var_name()report_unused_fields()check_consistency()create_new_petro_job_per_facies()write_petro_job_to_file()
- fmu.tools.rms.import_localmodules module
- fmu.tools.rms.qcreset module
- fmu.tools.rms.rename_rms_scripts module
PythonCompMasterPythonCompMaster.parentPythonCompMaster.pathPythonCompMaster.headerPythonCompMaster.entriesPythonCompMaster.get_inconsistent_entries()PythonCompMaster.get_invalid_extensions()PythonCompMaster.get_invalid_instance_names()PythonCompMaster.get_pep8_noncompliant()PythonCompMaster.get_nonexistent_standalonefilenames()PythonCompMaster.get_unused_scripts()PythonCompMaster.get_entry()PythonCompMaster.fix_standalone_filenames()PythonCompMaster.write_master_file()
main()
- fmu.tools.rms.update_petro_real module
- fmu.tools.rms.volumetrics module
- fmu.tools.rms.zone_mapping module
ZoneMappingZoneMapping.validate_zone_number_for_grid()ZoneMapping.get_number_of_zones_in_grid()ZoneMapping.get_zone_names_from_grid()ZoneMapping.get_zone_names_from_param()ZoneMapping.get_zone_numbers()ZoneMapping.get_zone_numbers_in_grid()ZoneMapping.get_zone_number()ZoneMapping.get_zone_name_for_zone_number()ZoneMapping.get_zone_name_for_zone_index()ZoneMapping.get_zone_number_for_zone_index()ZoneMapping.get_zone_index_for_zone_number()ZoneMapping.is_zone_number_defined()ZoneMapping.number_of_layers_for_zone_number()ZoneMapping.number_of_layers_for_zone_index()ZoneMapping.get_start_end_layer_for_zone_number()ZoneMapping.get_start_end_layer_for_zone_index()ZoneMapping.get_number_of_layers_per_zone()
get_zone_parameter()get_zone_mapping()
- Module contents
- fmu.tools.utilities package
Submodules
fmu.tools.extract_grid_zone_tops_etc module
Extract grid zone tops from wells.
- fmu.tools.extract_grid_zone_tops_etc.extract_grid_zone_tops(project=None, well_list=None, logrun='log', trajectory='Drilled trajectory', gridzonelog=None, mdlogname=None, grid=None, zone_param=None, alias_file=None, rms_name='RMS_WELL_NAME', ecl_name='ECLIPSE_WELL_NAME')[source]
Function for extracting top and base from gridzones, both in TVD and MD. A pandas dataframe will be returned.
Users can either input a pre-generated gridzonelog or a grid and a zone parameter for computing the gridzonelog.
The function works both inside RMS and outside with file input. If input from files, and a MD log is not present in the well a quasi md log will be computed and used.
- Return type:
DataFrame
fmu.tools.version module
Module contents
Top-level package for fmu-tools
- fmu.tools.extract_grid_zone_tops(project=None, well_list=None, logrun='log', trajectory='Drilled trajectory', gridzonelog=None, mdlogname=None, grid=None, zone_param=None, alias_file=None, rms_name='RMS_WELL_NAME', ecl_name='ECLIPSE_WELL_NAME')[source]
Function for extracting top and base from gridzones, both in TVD and MD. A pandas dataframe will be returned.
Users can either input a pre-generated gridzonelog or a grid and a zone parameter for computing the gridzonelog.
The function works both inside RMS and outside with file input. If input from files, and a MD log is not present in the well a quasi md log will be computed and used.
- Return type:
DataFrame
- fmu.tools.wellzonation_vs_grid(data, project=None)[source]
Check well zonation or perforations vs 3D grid.
- Parameters:
data (dict) – This is dictonary telling where data comes from
- class fmu.tools.QCProperties[source]
Bases:
objectThe QCProperties class consists of a set of methods for extracting property statistics from 3D Grids, Raw and Blocked wells.
Statistics can be collected from either discrete or continous properties. Dependent on the property different statistics are collected.
The methods for statistics extraction can be run individually, or a yaml-configuration file can be used to enable an automatic run of the methods. See the method ‘from_yaml’.
When several methods of statistics extraction has been run within the instance, a merged dataframe is available through the ‘dataframe’ property.
All methods can be run from either RMS python, or from files.
XTGeo is being utilized to get a dataframe from the input parameter data. XTGeo data is reused in the instance to increase performance.
- property dataframe
Dataframe with statistics
- get_grid_statistics(data, project=None)[source]
Extract property statistics from 3D Grid
- Return type:
DataFrame
- get_well_statistics(data, project=None)[source]
Extract property statistics from wells
- Return type:
DataFrame
- get_bwell_statistics(data, project=None)[source]
Extract property statistics from blocked wells
- Return type:
DataFrame
- class fmu.tools.DomainConversion(depth_surfaces, time_surfaces, names=None, template=None, _nlay_cropper=(0, 0))[source]
Bases:
objectDomain conversion, tailored for fmu-sim2seis, but also works as standalone.
The principle is to use matching sets of time and depth surfaces to create a velocity (and slowness) model, and use that further to domain convert either seismic cubes or surfaces, time <=> depth.
- Parameters:
depth_surfaces (
list[RegularSurface]) – List of depth surfaces.time_surfaces (
list[RegularSurface]) – List of time surfaces.names (
list[str] |None) – Optional list of names for the surfaces. If not provided, the names will be inferred from the input object, or (if missing) generated as “surf_0”, “surf_1”, etc.template (
RegularSurface|None) – Optional template surface to use for resampling the input surfaces. If not provided, the last time surface will be used as template.
Note
The input surfaces must be in the same sorted order, and the number of depth and time surfaces must be equal. The first surface does not need to be MSL. The surfaces must extend the full area of the model, and the subsequent surfaces or cubes to be converted must be inside the area of the surfaces that define the model.
Example
>>> from xtgeo import RegularSurface, Cube >>> from fmu.tools.domainconversion import DomainConversion >>> # read input surfaces into lists... >>> depth_surfaces_list = [xtgeo.surface_from_file("depth1.gri"), ...] >>> time_surfaces_list = [xtgeo.surface_from_file("time1.gri"), ...] >>> dc = DomainConversion(depth_surfaces_list, time_surfaces_list) >>> # read a cube... and convert the cube from time to depth >>> input_cube_in_time = xtgeo.cube_from_file("input_cube.segy") >>> result_cube_in_depth = dc.depth_convert_cube(input_cube_in_time)
-
depth_surfaces:
list[RegularSurface]
-
time_surfaces:
list[RegularSurface]
-
names:
list[str] |None= None
-
template:
RegularSurface|None= None
- property average_velocity_cube_in_time: Cube | None
- property average_slowness_cube_in_depth: Cube | None
- depth_convert_surfaces(insurfs)[source]
Use the current average velocity model/surfaces to perform depth conversion.
- Parameters:
insurfs (
list[RegularSurface]) – List of xtgeo surface objects (in time domain) to depth convert.- Return type:
list[RegularSurface]
- time_convert_surfaces(insurfs)[source]
Use the average slowness model/cube to perform depth to time conversion.
- Parameters:
insurfs (
list[RegularSurface]) – List of xtgeo surface objects to time convert.- Return type:
list[RegularSurface]
- depth_convert_cube(incube, zinc=None, zmin=None, zmax=None, undefined=-999.25)[source]
Depth convert a cube (time to depth).
- Parameters:
incube (
Cube) – Input cube (in time domain) to convert.zinc (
float|None) – Proposed z increment for the output cube.zmin (
float|None) – Proposed z minimum for the output cube.zmax (
float|None) – Proposed z maximum for the output cube.undefined (
float) – Value to use for undefined values in the output cube.
- Return type:
Cube
Note
The proposed zinc, zmin, zmax are optional and will be calculated from the existing input surfaces (making the velocity/slowness model) if not provided. If given, the actual values may differ from the proposed values, for technical reasons.
- time_convert_cube(incube, tinc=None, tmin=None, tmax=None, undefined=-999.25)[source]
Time convert a cube (depth to time).
- Parameters:
incube (
Cube) – Input cube (in depth domain) to convert.tinc (
float|None) – Proposed time increment for the output cube.tmin (
float|None) – Proposed time minimum for the output cube.tmax (
float|None) – Proposed time maximum for the output cube.undefined (
float) – Value to use for undefined values in the output cube.
- Return type:
Cube
Note
The proposed tinc, tmin, tmax are optional and will be calculated from the existing input surfaces (making the velocity/slowness model) if not provided. If given, the values may be adjusted for technical reasons.
- fmu.tools.sample_attributes_for_sim2seis(grid, attribute, attribute_error=0.05, attribute_error_minimum=None, region=None, zone=None, position=('', Position.CENTER), **kwargs)[source]
Sample attributes on grid resolution as poinst sets.
This usage is for setting attributes on grid resolution, e.g. a seismic attribute (from a map) combined with a region parameter from the grid.
This is targeted to the “sim2seis” workflow in FMU.
- Parameters:
grid (
Grid) – The grid to sample the attributes on.attribute (
RegularSurface) – The seismic (or custom) map/surface to sample the attribute from.attribute_error (
RegularSurface|float) – The error to apply to the attribute (optional). Shall be absolute (positive) values. If the user wants to apply a polygons with different error values, the user can ise surface-polygons functions in xtgeo to achieve this.attribute_error_minimum (
float|None) – The minimum error to apply to the attribute (optional).region (
GridProperty|None) – The region parameter to sample from the grid (optional).zone (
GridProperty|None) – The zone parameter to sample from the grid (optional).position (
tuple[str,Position]) – The position to sample the attributes on the grid. This shall be given as a tuple, as e.g. (“MyZone”, “center”) where the first is zone name, and the second is vertical position (“top”, “center”, “base”) in that zone. Default is (“”, “center”) which will take the middle layer of the total grid. The zone name is case sensitive. If zone is not given, the full grid interval will be applied to determine the layer.**kwargs (
Any) – Additional keywords (developer settings).
- Returns:
Points with the sampled attributes and attributes combined.
- Return type:
pd.Dataframe
- fmu.tools.create_nested_hybrid_grid(grid, region, target_region_id, refinement)[source]
Create a nested hybrid grid by refining one region and merging it back.
The cells belonging to target_region_id are replaced by a refined (subdivided) version of the same region. A
NEST_IDdiscrete property is attached to the merged grid, encoding the nested hybrid structure:NEST_ID == 1: coarse (mother) grid cells.NEST_ID == 2: refined grid cells.
In addition, a NNC mapping table is returned that lists every mother ↔ refined cell pair that should be connected by a Non-Neighbour Connection (NNC). The table is derived from the topological knowledge available at merge time (which original cell was refined and how its sub-cells map into the merged grid).
The table columns are:
I1, J1, K1: mother cell indices (1-based) in the merged grid.I2, J2, K2: refined cell indices (1-based) in the merged grid.DIRECTION: face direction from the mother cell’s perspective (I+,I-,J+,J-,K+,K-).
This table can be passed to
xtgeo.Grid.get_transmissibilities()to compute NNC transmissibilities for the specified cell pairs.- Parameters:
grid (
Grid) – The original coarse grid.region (
GridProperty) – Axtgeo.GridPropertywhose values identify the regions (e.g. an integer region parameter).target_region_id (
int) – The region value to refine.refinement (
tuple[int,int,int]) –(ncol, nrow, nlay)refinement factors.
- Return type:
tuple[Grid,DataFrame]- Returns:
A tuple
(merged_grid, nnc_table)where merged_grid is a newxtgeo.Gridwith the refined region stitched back into the coarse grid and nnc_table is apandas.DataFramemapping mother cells to their connected refined cells.
- fmu.tools.nnc_to_flowsimulator_input(nnc_df, filepath)[source]
Write NNC transmissibilities to a flow-simulator input file.
Produces a file with the
NNCkeyword suitable for reservoir simulators that use Eclipse-style input decks, such as Eclipse and OPM Flow. The file can be included in the deck viaINCLUDE. Each row of nnc_df becomes one NNC record with the six cell indices and the transmissibility value.- Parameters:
nnc_df (
DataFrame) – A DataFrame with at least columnsI1, J1, K1, I2, J2, K2, T. Optional columnsTYPEandDIRECTIONare written as end-of-line comments.filepath (
str|PathLike[str]) – Path to the output file.
- Return type:
None
- fmu.tools.nnc_to_gridproperty(grid, nnc_df)[source]
Convert NNC transmissibility data to three GridProperty instances.
Takes the NNC DataFrame produced by
xtgeo.Grid.get_transmissibilities()and maps transmissibility values onto grid cells, producing one property per direction (I, J, K).For rows where DIRECTION contains
"+", the transmissibility value is placed in cell(I1, J1, K1). For rows where DIRECTION contains"-", the value is placed in cell(I2, J2, K2). Index columns (I1, J1, K1, I2, J2, K2) are expected to be 1-based.If multiple rows map to the same cell and direction, the transmissibility values are summed (parallel flow paths are additive).
- Parameters:
grid (
Grid) – The xtgeo Grid that defines the geometry.nnc_df (
DataFrame) – A DataFrame with at least columnsI1, J1, K1, I2, J2, K2, T, DIRECTION.
- Return type:
tuple[GridProperty,GridProperty,GridProperty]- Returns:
A tuple
(tranx_nnc, trany_nnc, tranz_nnc)ofxtgeo.GridPropertyinstances named"TRANX_NNC","TRANY_NNC", and"TRANZ_NNC"respectively. Cells without an NNC value are set to-1.0.