fmu.tools package

Subpackages

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.extract_grid_zone_tops_etc.shift_zone_values(zvals)[source]
Return type:

ndarray

fmu.tools.extract_grid_zone_tops_etc.make_alias_dict(alias_file, rms_name='RMS_WELL_NAME', ecl_name='ECLIPSE_WELL_NAME')[source]

Create a correspondance dictionary so that well_dict[ <RMS wellname> ] = <Eclipse wellname>

Return type:

Dict[str, str]

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: object

The 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

from_yaml(cfg, project=None)[source]

Use yaml-configuration file to run the statistics extractions methods

to_csv(csvfile)[source]

Write combined dataframe to csv

class fmu.tools.DomainConversion(depth_surfaces, time_surfaces, names=None, template=None, _nlay_cropper=(0, 0))[source]

Bases: object

Domain 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 of depth surfaces.

  • time_surfaces – List of time surfaces.

  • names – 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 – 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[xtgeo.RegularSurface]
time_surfaces: list[xtgeo.RegularSurface]
names: list[str] | None = None
template: xtgeo.RegularSurface | None = None
static max_depth_for_cube(cube)[source]

Calculate the maximum depth for a cube.

Return type:

float

surface_names()[source]

Return a generator of surface names.

velocity_surfaces()[source]

Return a generator of velocity surfaces.

slowness_surfaces()[source]

Return a generator of slowness surfaces.

property average_velocity_cube_in_time: xtgeo.Cube | None
property average_slowness_cube_in_depth: xtgeo.Cube | None
depth_convert_surfaces(insurfs)[source]

Use the current average velocity model/surfaces to perform depth conversion.

Parameters:

insurfs – List of xtgeo surface objects (in time domain) to depth convert.

time_convert_surfaces(insurfs)[source]

Use the average slowness model/cube to perform depth to time conversion.

Parameters:

insurfs – List of xtgeo surface objects to time convert.

depth_convert_cube(incube, zinc=None, zmin=None, zmax=None, undefined=-999.25)[source]

Depth convert a cube (time to depth).

Parameters:
  • incube (xtgeo.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:

xtgeo.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 (xtgeo.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:

xtgeo.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: '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 (xtgeo.Grid) – The grid to sample the attributes on.

  • attribute (xtgeo.RegularSurface) – The seismic (or custom) map/surface to sample the attribute from.

  • attribute_error (xtgeo.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 (xtgeo.GridProperty | None) – The region parameter to sample from the grid (optional).

  • zone (xtgeo.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