gempy.core.model.ImplicitCoKriging

class gempy.core.model.ImplicitCoKriging[source]
This class handles all the mutation of the data objects of the model involved on the

implicit cokriging ensuring the synchronization of all the members.

_grid

[s0] Class to generate grids.

Type

gempy.core.data.Grid

_faults

[s1] Class that encapsulate faulting related content. Mainly, which surfaces/surfaces are faults. The fault network—i.e. which faults offset other faults—and fault types—finite vs infinite.

Type

gempy.core.data.Grid

_stack

[s2] Class that contains the functionality and attributes related to the series. Notice that series does not onlyrefers to stratigraphic series but to any set of surfaces which will be interpolated together (comfortably).

Type

gempy.core.data_modules.stack.Stack

_surfaces

[s3] Class that contains the surfaces of the model and the values of each of them.

Type

gempy.core.data.Surfaces

_surface_points

[s4] Data child with specific methods to manipulate interface data. It is initialize without arguments to giveflexibility to the origin of the data.

Type

gempy.core.data_modules.geometric_data.SurfacePoints

_orientations

[s5] Data child with specific methods to manipulate orientation data. It is initialize without arguments to giveflexibility to the origin of the data.

Type

gempy.core.data_modules.geometric_data.Orientations

_rescaling

[s6] Auxiliary class to rescale the coordinates between 0 and 1 to increase float stability.

Type

gempy.core.data_modules.geometric_data.Rescaling

_additional_data

[s7] Container class that encapsulate Structure, KrigingParameters, Options and rescaling parameters

Type

gempy.core.data.AdditionalData

_interpolator

[s8] Child class of Interpolator which set the shared variables and compiles the theanograph to compute the geological model, i.e. lithologies.

Type

gempy.core.interpolator.InterpolatorModel

solutions

[s9] This class stores the output of the interpolation and the necessary objectsto visualize and manipulate this data.

Type

gempy.core.solutions.Solutions

Examples using ImplicitCoKriging

Methods

__init__()

Initialize self.

add_features(features_list[, reset_order_series])

Add series, update the categories dependent on them and reset the flow control.

add_orientations(X, Y, Z, surface[, …])

Add orientation.

add_series(series_list[, reset_order_series])

Add series to the df

add_surface_points(X, Y, Z, surface[, idx, …])

Add surface points.

add_surface_values(values_array[, …])

Add values to be interpolated for each surfaces.

add_surfaces(surface_list[, update_df])

Add surface to the df.

delete_features(indices[, …])

Delete series, update the categories dependent on them and reset the flow control.

delete_orientations(idx)

Delete orientation

delete_series(indices[, …])

Delete series, update the categories dependent on them and reset the flow control.

delete_surface_points(idx)

Delete surface points.

delete_surface_points_basement()

Delete surface points belonging to the basement layer if any

delete_surface_values(properties_names)

Delete a property or several properties column.

delete_surfaces(indices[, update_id, …])

@TODO When implemeted activate geometric data, change remove data to False by default Delete a surface and update all related object.

get_active_grids()

map_geometric_data_df(d)

Map a geometric data dataframe from the linked objects (at 07.2019 surfaces and series)

map_series_to_surfaces(*args, **kwargs)

Map series to surfaces and update all related objects accordingly to the following arguments:

map_stack_to_surfaces([mapping_object, …])

Map series to surfaces and update all related objects accordingly to the following arguments:

modify_kriging_parameters(attribute, value, …)

Method to modify a given field

modify_options(attribute, value)

Method to modify a given field

modify_order_features(new_value, idx)

Modify order of the feature.

modify_order_series(new_value, idx)

Replace to the new location the old series

modify_order_surfaces(new_value, idx[, …])

Replace to the new location the old series

modify_orientations(idx, **kwargs)

Allows modification of any of an orientation column at a given index.

modify_rescaling_parameters(attribute, value)

Modify the parameters used to rescale data

modify_surface_points(indices[, …])

Allows modification of the x,y and/or z-coordinates of an interface at specified dataframe index.

modify_surface_values(idx, properties_names, …)

Method to modify values using loc of pandas.

rename_features(new_categories)

Rename features and update the category dependent on them.

rename_series(new_categories)

Rename features and update the category dependent on them.

rename_surfaces(to_replace, **kwargs)

Replace values given in to_replace with value.

reorder_features(new_categories)

Reorder series.

reorder_series(new_categories)

Reorder series.

set_active_grid(grid_name[, reset])

Set active a given or several grids.

set_bottom_relation(series, bottom_relation)

Set the bottom relation between the series and the one below.

set_centered_grid(centers, radius[, resolution])

[s0] Initialize gravity grid.

set_custom_grid(custom_grid)

Set custom grid, rescale gird and initialize theano solutions.

set_default_orientation(**kwargs)

Set a default orientation if the df is empty.

set_default_surface_point(**kwargs)

Set a default surface point if the df is empty.

set_default_surfaces()

Set two default surfaces if the df is empty.

set_extent(extent)

Set project extent

set_fault_object()

Not implemented

set_fault_relation(rel_matrix)

Method to set the df that offset a given sequence and therefore also another fault.

set_grid_object(grid[, update_model])

Not implemented

set_is_fault([feature_fault, toggle, …])

Set a feature to fault and update all dependent objects of the Model.

set_is_finite_fault([series_fault, toggle])

Toggles given series’ finite fault property.

set_orientations(table, **kwargs)

Set coordinates, surface and orientation data.

set_orientations_object(orientations[, …])

set_regular_grid(extent, resolution)

Set a regular grid, rescale data and initialize theano solutions.

set_section_grid(section_dict)

[s0] Object that creates a grid of cross sections between two points.

set_series_object()

Not implemented yet.

set_surface_order_from_solution()

Order the surfaces respect the last computation.

set_surface_points(table, **kwargs)

Set Set coordinates and surface columns on the df.

set_surface_points_object(surface_points[, …])

Not Implemented

set_surface_values(values_array[, …])

Set values to be interpolated for each surfaces.

set_surfaces_object()

Not implemented yet.

set_theano_function(interpolator[, …])

Pass a theano function and its correspondent graph from an Interpolator

set_theano_graph(interpolator[, …])

Pass a theano graph of a Interpolator instance other than the Model compose

set_topography([source, set_mask])

Create a topography grid and activate it.

update_additional_data([update_structure, …])

update_from_grid()

Update objects dependent from the grid.

update_from_series([reorder_series, …])

Update all objects dependent on series.

update_from_surfaces([…])

Update all objects dependt on surfaces.

update_structure([update_theano, …])

Update python and theano structure parameters.

update_to_interpolator([reset])

Update all shared parameters from the data objects

Attributes

additional_data

gempy.core.data.AdditionalData [s0] Container class that encapsulate Structure, KrigingParameters, Options and rescaling parameters

faults

gempy.core.data_modules.stack.Faults [s0] Class that encapsulate faulting related content.

grid

gempy.core.data.Grid [s0] Class to generate grids.

interpolator

gempy.core.interpolator.InterpolatorModel [s0] Child class of Interpolator which set the shared variables and compiles the theanograph to compute the geological model, i.e. lithologies.

orientations

gempy.core.data_modules.geometric_data.Orientations [s0] Data child with specific methods to manipulate orientation data.

rescaling

gempy.core.data_modules.geometric_data.Rescaling [s0] Auxiliary class to rescale the coordinates between 0 and 1 to increase float stability.

series

Class that contains the functionality and attributes related to the series.

stack

gempy.core.data_modules.stack.Stack [s0] Class that encapsulates all type of geological features.

surface_points

gempy.core.data_modules.geometric_data.SurfacePoints [s0] Data child with specific methods to manipulate interface data.

surfaces

gempy.core.data.Surfaces [s0] Class that contains the surfaces of the model and the values of each of them.

__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

property grid

gempy.core.data.Grid [s0] Class to generate grids.

property faults

gempy.core.data_modules.stack.Faults [s0] Class that encapsulate faulting related content. Mainly, which surfaces/surfaces are faults. The fault network—i.e. which faults offset other faults—and fault types—finite vs infinite.

property stack

gempy.core.data_modules.stack.Stack [s0] Class that encapsulates all type of geological features. So far is Series and Faults

property series

Class that contains the functionality and attributes related to the series. Notice that series does not onlyrefers to stratigraphic series but to any set of surfaces which will be interpolated together (comfortably).

property surfaces

gempy.core.data.Surfaces [s0] Class that contains the surfaces of the model and the values of each of them.

property surface_points

gempy.core.data_modules.geometric_data.SurfacePoints [s0] Data child with specific methods to manipulate interface data. It is initialize without arguments to giveflexibility to the origin of the data.

property orientations

gempy.core.data_modules.geometric_data.Orientations [s0] Data child with specific methods to manipulate orientation data. It is initialize without arguments to giveflexibility to the origin of the data.

property rescaling

gempy.core.data_modules.geometric_data.Rescaling [s0] Auxiliary class to rescale the coordinates between 0 and 1 to increase float stability.

property additional_data

gempy.core.data.AdditionalData [s0] Container class that encapsulate Structure, KrigingParameters, Options and rescaling parameters

property interpolator

gempy.core.interpolator.InterpolatorModel [s0] Child class of Interpolator which set the shared variables and compiles the theanograph to compute the geological model, i.e. lithologies.

update_structure(update_theano=None, update_series_is_active=True, update_surface_is_active=True)[source]

Update python and theano structure parameters.

[s0] Update fields dependent on input data sucha as structure and universal kriging grade [s1] Set all theano shared variable dependent on Structure.

Parameters

update_theano (str{'matrices', 'weights'}) –

  • matrices [s2] Modify all theano shared matrices to the right size according to the structure data. This method allows to change the size of the results without having the recompute all serie

  • weights [s3] Modify the theano shared weights vector according to the structure.

Returns

gempy.core.data.Structure

update_from_grid()[source]

Update objects dependent from the grid.

set_active_grid(grid_name: Union[str, Iterable[str]], reset=False)[source]

Set active a given or several grids.

Parameters
  • grid_name (str, list[str]) – Name of the grid you want to activate. Options are {regular, custom, topography, centered}

  • reset (bool) – If True set inactive all grids not in grid_name

Returns

gempy.core.data.Grid

set_grid_object(grid: gempy.core.data.Grid, update_model=True)[source]

Not implemented

# TODO this should go to the api and let call all different grid types

Parameters
  • grid

  • update_model

Returns:

set_regular_grid(extent, resolution)[source]

Set a regular grid, rescale data and initialize theano solutions.

Parameters
  • extent (numpy.ndarray[float]) – [x_min, x_max, y_min, y_max, z_min, z_max]. Extent for the visualization of data and default of for the regular grid class.

  • resolution (numpy.ndarray[int]) – [nx, ny, nz]

Returns

gempy.core.data.Grid

See also

gempy.core.data.Grid.create_regular_grid

gempy.core.data.grid_modules.grid_types.RegularGrid

set_custom_grid(custom_grid)[source]

Set custom grid, rescale gird and initialize theano solutions. foo

Parameters

custom_grid (numpy.ndarray[float, 3]) – XYZ 2D array. Axis 1 is the coordinates while axis 0 is n number of input

Returns

gempy.core.data.Grid

See also

gempy.core.data.Grid.create_custom_grid

gempy.core.data.grid_modules.grid_types.CustomGrid

set_topography(source='random', set_mask=True, **kwargs)[source]

Create a topography grid and activate it.

Parameters

source

  • ‘gdal’: Load topography from a raster file.

  • ’random’: Generate random topography (based on a fractal grid).

  • ’saved’: Load topography that was saved with the topography.save() function. this is useful after loading and saving a heavy raster file with gdal once or after saving a random topography with the save() function. This .npy file can then be set as topography.

Keyword Arguments
  • = 'gdal' (source) –

  • = 'random' (source) –

    • fd: fractal dimension, defaults to 2.0

    • d_z: maximum height difference. If none, last 20% of the model in z direction

    • extent: extent in xy direction. If none, geo_model.grid.extent

    • resolution: desired resolution of the topography array. If none, geo_model.grid.resoution

  • = 'saved' (source) –

    • filepath: path to the .npy file that was created using the topography.save() function

  • = 'numpy' (source) –

    • array: numpy array containing the data

Returns

gempy.core.data.Grid

See also

gempy.core.grid_modules.grid_types.Topography

set_centered_grid(centers, radius, resolution=None)[source]

[s0] Initialize gravity grid. Deactivate the rest of the grids (inserted)

Parameters
  • centers (numpy.ndarray[float, 3]) – Location of the center of each kernel.

  • radius (float) – Distance from each center to create each XYZ point

  • resolution (numpy.ndarray[3]) – Number of voxels in each direction per kernel

Returns

gempy.core.data.Grid

set_section_grid(section_dict)[source]

[s0] Object that creates a grid of cross sections between two points.

Parameters

section_dict (dict) – ‘section name’: ([p1_x, p1_y], [p2_x, p2_y], [xyres, zres])

Returns

gempy.core.grid_modules.grid_types.Sections

set_series_object()[source]

Not implemented yet. Exchange the series object of the Model object.

set_bottom_relation(series: Union[str, list], bottom_relation: Union[str, list])[source]

Set the bottom relation between the series and the one below.

Parameters
  • series_list (str, list) – name or list of names of the series to apply the functionality

  • bottom_relation (str{Onlap, Erode, Fault}, list[str]) –

Returns

gempy.core.data_modules.stack.Stack

add_features(features_list: Union[str, list], reset_order_series=True)[source]

Add series, update the categories dependent on them and reset the flow control.

Parameters
  • features_list – (str, list): name or list of names of the series to apply the functionality

  • reset_order_series – if true [s0] Reset the column order series to monotonic ascendant values.

Returns

gempy.core.data_modules.stack.Stack

add_series(series_list: Union[str, list], reset_order_series=True)[source]

Add series to the df

Parameters
  • series_list (str, list) – name or list of names of the series to apply the functionality

  • reset_order_series (bool) – if true [s0] Reset the column order series to monotonic ascendant values.

Returns

Series

delete_features(indices: Union[str, list], reset_order_features=True, remove_surfaces=False, remove_data=False)[source]

Delete series, update the categories dependent on them and reset the flow control.

Parameters
  • indices (str, list) – name or list of names of the series to apply the functionality

  • reset_order_features – (bool): if true [s0] Reset the column order series to monotonic ascendant values.

  • remove_surfaces (bool) – if True remove the surfaces associated with the feature.

  • remove_data (bool) – if True remove the geometric data associated with the feature

Returns

gempy.core.data_modules.stack.Stack

delete_series(indices: Union[str, list], refactor_order_series=True, remove_surfaces=False, remove_data=False)[source]

Delete series, update the categories dependent on them and reset the flow control.

Parameters
  • indices (str, list) – name or list of names of the series to apply the functionality

  • reset_order_features – (bool): if true [s0] Reset the column order series to monotonic ascendant values.

  • remove_surfaces (bool) – if True remove the surfaces associated with the feature.

  • remove_data (bool) – if True remove the geometric data associated with the feature

Returns

gempy.core.data_modules.stack.Stack

rename_features(new_categories: Union[dict, list])[source]

Rename features and update the category dependent on them.

Parameters

new_categories (list, dict) –

  • list-like: all items must be unique and the number of items in the new categories must match the existing number of categories.

  • dict-like: specifies a mapping from old categories to new. Categories not contained in the mapping are passed through and extra categories in the mapping are ignored.

Returns

gempy.core.data_modules.stack.Stack

[s0] Rename categories.

Parameters

new_categories (list, dict) –

  • list-like: all items must be unique and the number of items in the new categories must match the existing number of categories.

  • dict-like: specifies a mapping from old categories to new. Categories not contained in the mapping are passed through and extra categories in the mapping are ignored.

Returns:

rename_series(new_categories: Union[dict, list])[source]

Rename features and update the category dependent on them.

Parameters

new_categories (list, dict) –

  • list-like: all items must be unique and the number of items in the new categories must match the existing number of categories.

  • dict-like: specifies a mapping from old categories to new. Categories not contained in the mapping are passed through and extra categories in the mapping are ignored.

Returns

gempy.core.data_modules.stack.Stack

[s0] Rename categories.

Parameters

new_categories (list, dict) –

  • list-like: all items must be unique and the number of items in the new categories must match the existing number of categories.

  • dict-like: specifies a mapping from old categories to new. Categories not contained in the mapping are passed through and extra categories in the mapping are ignored.

Returns:

modify_order_features(new_value: int, idx: str)[source]

Modify order of the feature. Reorder categories of the link Surfaces, sort surface (reset the basement layer) remap the Stack and Surfaces to the corespondent dataframes, sort Geometric objects, update structure and reset the flow control objects.

Parameters
  • new_value (int) – New location

  • idx (str) – name of the feature to be moved

Returns

gempy.core.data_modules.stack.Stack

modify_order_series(new_value: int, idx: str)[source]

Replace to the new location the old series

Parameters
  • new_value (int) – New location

  • series_name (str) – name of the series to be moved

Returns

Series

reorder_features(new_categories: Iterable[str])[source]

Reorder series. Reorder categories of the link Surfaces, sort surface (reset the basement layer) remap the Series and Surfaces to the corespondent dataframes, sort Geometric objects, update structure and reset the flow control objects.

Parameters

new_categories (list) – list with all series names in the desired order.

Returns

gempy.core.data_modules.stack.Stack

reorder_series(new_categories: Iterable[str])[source]

Reorder series. Reorder categories of the link Surfaces, sort surface (reset the basement layer) remap the Series and Surfaces to the corespondent dataframes, sort Geometric objects, update structure and reset the flow control objects.

Parameters

new_categories (list) – list with all series names in the desired order.

Returns

gempy.core.data_modules.stack.Stack

set_fault_object()[source]

Not implemented

set_is_fault(feature_fault: Optional[Union[str, list]] = None, toggle: bool = False, change_color: bool = True, twofins=False)[source]

Set a feature to fault and update all dependent objects of the Model.

Parameters
  • feature_fault (str, list[str]) – Name of the series which are faults

  • toggle (bool) – if True, passing a name which is already True will set it False.

  • twofins (bool) – If True, it allows to set several surfaces of a given geological feature to fault. This is behaviour is not tested and could have unexpected behaviour.

  • change_color (bool) – If True faults surfaces get the default fault color (light gray)

Returns

gempy.core.data_modules.stack.Faults

Set a flag to the series that are faults.

Parameters
  • series_fault (str, list[str]) – Name of the series which are faults

  • toggle (bool) – if True, passing a name which is already True will set it False.

  • offset_faults (bool) – If True by default faults offset other faults

Returns

gempy.core.data_modules.stack.Faults

set_is_finite_fault(series_fault=None, toggle: bool = True)[source]

Toggles given series’ finite fault property.

Parameters
  • series_finite (str, list[str]) – Name of the series which are finite

  • toggle (bool) – if True, passing a name which is already True will set it False.

Returns

gempy.core.data_modules.stack.Faults

set_fault_relation(rel_matrix)[source]

Method to set the df that offset a given sequence and therefore also another fault.

Parameters

rel_matrix (numpy.array[bool]) – 2D Boolean array with boolean logic. Rows affect (offset) columns

Returns

gempy.core.data_modules.stack.Faults.faults_relations_df

set_surfaces_object()[source]

Not implemented yet. Exchange the surface object of the Model object Returns:

add_surfaces(surface_list: Union[str, list], update_df=True)[source]

Add surface to the df.

Parameters
  • surface_list (str, list) – name or list of names of the surfaces to apply the functionality

  • update_df (bool) – Update Surfaces.df columns with the default values

Returns

gempy.core.data.Surfaces

delete_surfaces(indices: Union[str, Iterable[str]], update_id=True, remove_data=True)[source]

@TODO When implemeted activate geometric data, change remove data to False by default Delete a surface and update all related object.

Parameters
  • indices (str, list) – name or list of names of the series to apply the functionality

  • update_id (bool) – if true [s0] Set id of the layers (1 based) Args: id_list (list):

  • remove_data (bool) – if true delete all GeometricData labeled with the given surface.

Returns

gempy.core.data.Surfaces

rename_surfaces(to_replace: dict, **kwargs)[source]

Replace values given in to_replace with value.

Parameters
Returns

gempy.core.data.Surfaces

modify_order_surfaces(new_value: int, idx: int, series_name: Optional[str] = None)[source]

Replace to the new location the old series

Parameters
  • new_value (int) – New location

  • idx (int) – Index of the surface to be moved

  • series_name (str) – name of the series to be moved

Returns

gempy.core.data.Surfaces

add_surface_values(values_array: Iterable, properties_names: Iterable[str] = array([], dtype=float64))[source]

Add values to be interpolated for each surfaces.

Parameters
  • values_array (np.ndarray, list) – array-like of the same length as number of surfaces. This functionality can be used to assign different geophysical properties to each layer

  • properties_names (list) – list of names for each values_array columns. This must be of same size as values_array axis 1. By default properties will take the column name: ‘value_X’.

Returns

gempy.core.data.Surfaces

delete_surface_values(properties_names: list)[source]

Delete a property or several properties column.

Parameters

properties_names (str, list[str]) – Name of the property to delete

Returns

gempy.core.data.Surfaces

modify_surface_values(idx, properties_names, values)[source]

Method to modify values using loc of pandas.

Parameters
Returns

gempy.core.data.Surfaces

set_surface_values(values_array: Iterable, properties_names: list = array([], dtype=float64))[source]

Set values to be interpolated for each surfaces. This method will delete the previous values.

Parameters
  • values_array (np.ndarray, list) – array-like of the same length as number of surfaces. This functionality can be used to assign different geophysical properties to each layer

  • properties_names (list) – list of names for each values_array columns. This must be of same size as values_array axis 1. By default properties will take the column name: ‘value_X’.

Returns

gempy.core.data.Surfaces

map_stack_to_surfaces(mapping_object: Optional[Union[dict, pandas.core.arrays.categorical.Categorical]] = None, set_series=True, sort_geometric_data: bool = True, remove_unused_series=True, twofins=False)[source]

Map series to surfaces and update all related objects accordingly to the following arguments:

Parameters
  • mapping_object (dict, pandas.DataFrame) –

    • dict: keys are the series and values the surfaces belonging to that series

    • pandas.DataFrame: Dataframe with surfaces as index and a column series with the correspondent series name of each surface

  • set_series (bool) – if True, if mapping object has non existing series they will be created.

  • sort_geometric_data (bool) – If true geometric data will be sorted accordingly to the new order of the series

  • remove_unused_series (bool) – if true, if an existing series is not assigned with a surface, it will get removed from the Series object.

  • twofins (bool) – If True, it allows to set several surfaces of a given geological feature to fault. This is behaviour is not tested and could have unexpected behaviour.

Returns

gempy.core.data.Surfaces

map_series_to_surfaces(*args, **kwargs)[source]

Map series to surfaces and update all related objects accordingly to the following arguments:

Parameters
  • mapping_object (dict, pandas.DataFrame) –

    • dict: keys are the series and values the surfaces belonging to that series

    • pandas.DataFrame: Dataframe with surfaces as index and a column series with the correspondent series name of each surface

  • set_series (bool) – if True, if mapping object has non existing series they will be created.

  • sort_geometric_data (bool) – If true geometric data will be sorted accordingly to the new order of the series

  • remove_unused_series (bool) – if true, if an existing series is not assigned with a surface, it will get removed from the Series object.

  • twofins (bool) – If True, it allows to set several surfaces of a given geological feature to fault. This is behaviour is not tested and could have unexpected behaviour.

Returns

gempy.core.data.Surfaces

set_surface_points_object(surface_points: gempy.core.data_modules.geometric_data.SurfacePoints, update_model=True)[source]

Not Implemented

set_surface_points(table: pandas.core.frame.DataFrame, **kwargs)[source]

Set Set coordinates and surface columns on the df. coordinates and surface columns on the df.

Parameters

table (pandas.Dataframe) – table with surface points data.

Keyword Arguments

add_basement (bool) – add a basement surface to the df.

set_orientations(table: pandas.core.frame.DataFrame, **kwargs)[source]

Set coordinates, surface and orientation data.

If both are passed pole vector has priority over orientation

Args:

coord (np.ndarray): [s0] (numpy.ndarray[float, 3]): XYZ 2D array. Axis 1 is the coordinates while axis 0 is n number of input Notice that orientations may be place anywhere in the 3D space pole_vector (np.ndarray): [s2] (numpy.ndarray[float, 3]): 2D numpy array where axis 1 is the gradient values G_x, G_y, G_z of the pole while axis 0 is n number of orientations orientation (np.ndarray): [s3] (numpy.ndarray[float, 3]): 2D numpy array where axis 1 is are orientation values [dip, azimuth, polarity] of the pole while axis 0 is n number of orientations. — Dip is the inclination angle of 0 to 90 degrees measured from the horizontal plane downwards. Azimuth is the dip direction defined by a 360 degrees clockwise rotation, i.e. 0 = North, 90 = East, 180 = South, and 270 = West.*Polarity* defines where the upper (geologically younger) side of the orientation plane is and can be declared to be either normal (1) or reversed (-1).The orientation plane is perpendicular to the gradient surface (list[str]): [s1] (str, Iterable[str]): list with the surface names for each input point. They must exist in the surfaces object linked to SurfacePoints

Returns:

Set coordinates, surface and orientation data.

If both are passed pole vector has priority over orientation

Args:

table (pn.Dataframe): table with surface points data.

Returns:

gempy.core.data_modules.geometric_data.Orientations

See Also:

gempy.core.data_modules.geometric_data.Orientations

add_surface_points(X, Y, Z, surface, idx: Union[int, Iterable[int]] = None, recompute_rescale_factor=False)[source]

Add surface points.

Parameters
  • x (float, np.ndarray) – [s0] (bool): if True recompute the rescaling facto (float, Iterable[float]): values or list of values for the x coordinate

  • y (float, np.ndarray) – [s1] (float, Iterable[float]): values or list of values for the y coordinate

  • z (float, np.ndarray) – [s2] (float, Iterable[float]): values or list of values for the z coordinate

  • surface (str) – [s3] (str, Iterable[str]): list with the surface names for each input point. They must exist in the surfaces object linked to SurfacePoints

  • idx (Optional[int, list[int]) – [s4] (int, list, numpy.ndarray): If passed, list of indices where the function will be applied

  • X

  • Y

  • Z

  • surface

  • idx – Index of the point. If None, next available index will be used

  • recompute_rescale_factor (bool) – [s0].

Returns

gempy.core.data_modules.geometric_data.SurfacePoints

delete_surface_points(idx: Union[int, Iterable[int]])[source]

Delete surface points.

Parameters

idx (int, list[int]) – [s0] (int, list, numpy.ndarray): If passed, list of indices where the function will be applied

Returns

gempy.core.data_modules.geometric_data.SurfacePoints

delete_surface_points_basement()[source]

Delete surface points belonging to the basement layer if any

modify_surface_points(indices: Union[int, list], recompute_rescale_factor=False, **kwargs)[source]

Allows modification of the x,y and/or z-coordinates of an interface at specified dataframe index.

Parameters
  • indices (int, list, numpy.ndarray) – If passed, list of indices where the function will be applied.

  • recompute_rescale_factor (bool) – if True recompute the rescaling factor

Keyword Arguments
  • X (*) – values or list of values for the x coordinates

  • Y (*) – values or list of values for the y coordinates

  • Z (*) – values or list of values for the z coordinates

  • surface (*) – list with the surface names for each input point. They must exist in the surfaces object linked to SurfacePoints.

add_orientations(X, Y, Z, surface, pole_vector: Iterable = None, orientation: Iterable = None, idx=None, recompute_rescale_factor=False)[source]

Add orientation.

Parameters
  • X (float, Iterable[float]) – values or list of values for the x coordinates

  • Y (float, Iterable[float]) – values or list of values for the y coordinates

  • Z (float, Iterable[float]) – values or list of values for the z coordinates

  • surface (str, Iterable[str]) – list with the surface names for each input point. They must exist in the surfaces object linked to SurfacePoints.

  • pole_vector (numpy.ndarray[float, 3]) – 2D numpy array where axis 1 is the gradient values G_x, G_y, G_z of the pole while axis 0 is n number of orientations.

  • orientation (numpy.ndarray[float, 3]) – 2D numpy array where axis 1 is are orientation values [dip, azimuth, polarity] of the pole while axis 0 is n number of orientations. — Dip is the inclination angle of 0 to 90 degrees measured from the horizontal plane downwards. Azimuth is the dip direction defined by a 360 degrees clockwise rotation, i.e. 0 = North, 90 = East, 180 = South, and 270 = West.*Polarity* defines where the upper (geologically younger) side of the orientation plane is and can be declared to be either normal (1) or reversed (-1).The orientation plane is perpendicular to the gradient.

  • idx (int, list, numpy.ndarray) – If passed, list of indices where the function will be applied.

  • recompute_rescale_factor (bool) – if True recompute the rescaling factor

Returns

gempy.core.data_modules.geometric_data.Orientations

delete_orientations(idx: Union[list, int])[source]

Delete orientation

Parameters

idx (int, list, numpy.ndarray) – If passed, list of indices where the function will be applied.

Returns

gempy.core.data_modules.geometric_data.Orientations

modify_orientations(idx: list, **kwargs)[source]

Allows modification of any of an orientation column at a given index.

Parameters

idx (int, list[int]) – [s0] (int, list, numpy.ndarray): If passed, list of indices where the function will be applied

Keyword Arguments
  • X (*) –

  • Y (*) –

  • Z (*) –

  • G_x (*) –

  • G_y (*) –

  • G_z (*) –

  • dip (*) –

  • azimuth (*) –

  • polarity (*) –

  • surface (*) – [s1] (str, Iterable[str]): list with the surface names for each input point. They must exist in the surfaces object linked to SurfacePoints

modify_options(attribute, value)[source]

Method to modify a given field

Parameters
  • attribute (str) – Name of the field to modify

  • value – new value of the field. It will have to exist in the category in order for pandas to modify it.

Returns

df where options data is stored

Return type

pandas.DataFrame

modify_kriging_parameters(attribute, value, **kwargs)[source]

Method to modify a given field

Parameters
  • attribute (str) – Name of the field to modify

  • value – new value of the field. It will have to exist in the category in order for pandas to modify it.

  • kwargs

    • u_grade_sep (str): If drift equations values are str, symbol that separates the values.

Returns

df where options data is stored

Return type

pandas.DataFrame

modify_rescaling_parameters(attribute, value)[source]

Modify the parameters used to rescale data

Parameters
  • attribute (str) – Attribute to be modified. It can be: centers, rescaling factor * centers: [s0] (numpy.ndarray[float, 3]): XYZ array with the center of the data. This controls how much we shift the input coordinate * rescaling factor: [s1] Scaling factor by which all the parameters will be rescaled

  • value (float, list[float]) –

Returns

gempy.core.data_modules.geometric_data.Rescaling

set_default_surface_point(**kwargs)[source]

Set a default surface point if the df is empty. This is necessary for some type of functionality such as qgrid.

Parameters

**kwargs – Same as gempy.core.data_modules.geometric_data.SurfacePoints.add_surface_points()

Returns

gempy.core.data_modules.geometric_data.SurfacePoints

set_default_orientation(**kwargs)[source]

Set a default orientation if the df is empty. This is necessary for some type of functionality such as qgrid

Parameters

**kwargs – Same as :func:gempy.core.data_modules.geometric_data.Orientations.add_orientation

Returns

gempy.core.data_modules.geometric_data.Orientations

set_default_surfaces()[source]

Set two default surfaces if the df is empty. This is necessary for some type of functionality such as qgrid

Returns

gempy.core.data.Surfaces

set_extent(extent: Iterable)[source]

Set project extent

Parameters

extent (numpy.ndarray[float]) – [x_min, x_max, y_min, y_max, z_min, z_max]. Extent for the visualization of data and default of for the regular grid class.

Returns

gempy.core.data.Grid

update_from_series(reorder_series=True, sort_geometric_data=True, update_interpolator=True)[source]

Update all objects dependent on series.

This method is a bit of a legacy and has been substituted by rename_series() and reorder_series(), however is useful if you want to make sure all objects are up to date with the latest changes on series.

Parameters
  • reorder_series (bool) – if True reorder all pandas categories accordingly to the series.df

  • sort_geometric_data (bool) – It True sort the geometric data after mapping the new order

  • update_interpolator (bool) – If True update the theano shared variables dependent on the structure

Returns

True

update_from_surfaces(set_categories_from_series=True, set_categories_from_surfaces=True, map_surface_points=True, map_orientations=True, update_structural_data=True)[source]

Update all objects dependt on surfaces.

Parameters
  • set_categories_from_series (bool) – If True update the pandas categories with the Series object

  • set_categories_from_surfaces (bool) – If True update the pandas categories with the surfaces object

  • map_surface_points (bool) – If True map the surface points fields with the Surfaces obejct

  • map_orientations (bool) – If True map the orientations fields with the Surfaces object

  • update_structural_data (bool) – If true update the Structure with the Surface object

Returns

True

set_theano_graph(interpolator: gempy.core.interpolator.InterpolatorModel, update_structure=True, update_kriging=True)[source]

Pass a theano graph of a Interpolator instance other than the Model compose

Use this method only if you know what are you doing!

Parameters

interpolator (InterpolatorModel) – [s0]

Returns

True (inserted)

Child class of Interpolator which set the shared variables and compiles the theano

graph to compute the geological model, i.e. lithologies.

Attributes:

compute_weights_ctrl (list[bool]): [s0] List that controls what parts of the graph for each series have to be recomputed

compute_scalar_ctrl (list[bool]):

compute_block_ctrl (list[bool]):

Interpolator Doc

(inserted)

Class that act as:

  1. linker between the data objects and the theano graph

  2. container of theano graphs + shared variables

  3. container of theano function

Args:

surface_points (SurfacePoints): [s0] Data child with specific methods to manipulate interface data. It is initialize without arguments to giveflexibility to the origin of the data.

orientations (Orientations): [s1] Data child with specific methods to manipulate orientation data. It is initialize without arguments to giveflexibility to the origin of the data.

grid (Grid): [s2] Class to generate grids.

surfaces (Surfaces): [s3] Class that contains the surfaces of the model and the values of each of them.

series (Series): [s4] Class that contains the functionality and attributes related to the series. Notice that series does not onlyrefers to stratigraphic series but to any set of surfaces which will be interpolated together (comfortably).

faults (Faults): [s5] Class that encapsulate faulting related content. Mainly, which surfaces/surfaces are faults. The fault network—i.e. which faults offset other faults—and fault types—finite vs infinite.

additional_data (AdditionalData): [s6] Container class that encapsulate Structure, KrigingParameters, Options and rescaling parameters

kwargs:

  • compile_theano: if true, the function is compile at the creation of the class

Attributes:

surface_points (SurfacePoints)

orientations (Orientations)

grid (Grid)

surfaces (Surfaces)

faults (Faults)

additional_data (AdditionalData)

dtype ([‘float32’, ‘float64’]): float precision

theano_graph: theano graph object with the properties from AdditionalData -> Options

theano function: python function to call the theano code

set_theano_function(interpolator: gempy.core.interpolator.InterpolatorModel, update_structure=True, update_kriging=True)[source]
Pass a theano function and its correspondent graph from an Interpolator

instance other than the Model compose

Parameters
Returns

True

Return type

bool

update_to_interpolator(reset=True)[source]

Update all shared parameters from the data objects

Parameters

reset (bool) – if True reset the flow control and initialize results arrays

Returns

True

map_geometric_data_df(d: pandas.core.frame.DataFrame)[source]

Map a geometric data dataframe from the linked objects (at 07.2019 surfaces and series)

Parameters

d (pn.DataFrame) – Geometric data dataframe to be mapped

Returns

DataFrame

set_surface_order_from_solution()[source]

Order the surfaces respect the last computation. Therefore if you call this method, after sorting surface_points without recomputing you may get wrong results.

Returns

Surfaces