gempy.core.model.Project

class gempy.core.model.Project(project_name='default_project')[source]

Container class of all objects that constitute a GemPy model.

In addition the class provides all the methods you need to construct a geological model with ImplicitCoKriging.

See also

MetaData, ImplicitCoKriging

Examples using Project

Methods

__init__([project_name])

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()

get_additional_data()

get_data([itype, verbosity, numeric])

Method to return the data stored in panda.DataFrame within a gempy.core.model.Project data object.

load_model_pickle(path)

Read InputData object from python pickle.

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.

new_model([name_project])

Reset the model object.

read_data([source_i, source_o, add_basement])

Read data from a csv, or directly supplied dataframes

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.

save_model([name, path, compress])

Save model in new folder.

save_model_pickle([path])

Short term model storage.

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__(project_name='default_project')[source]

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

new_model(name_project='default_project')[source]

Reset the model object.

save_model_pickle(path=False)[source]

Short term model storage. Object to a python pickle (serialization of python). Be aware that if the dependencies versions used to export and import the pickle differ it may give problems

Parameters

path (str) – path where save the pickle

Returns

True

static load_model_pickle(path)[source]

Read InputData object from python pickle.

Parameters

path (str) – path where save the pickle

Returns

gempy.core.model.Model

save_model(name=None, path=None, compress=True)[source]

Save model in new folder. Input data is saved as csv files. Solutions, extent and resolutions are saved as npy.

Parameters
  • name (str) – name of the newly created folder and the part of the files name

  • path (str) – path where save the model folder.

  • compress (bool) – If true create a zip

Returns

True

read_data(source_i=None, source_o=None, add_basement=True, **kwargs)[source]

Read data from a csv, or directly supplied dataframes

Parameters
  • source_i – Path to the data bases of surface_points. Default os.getcwd(), or direct pandas data frame

  • source_o – Path to the data bases of orientations. Default os.getcwd(), or direct pandas data frame

  • add_basement (bool) – if True add a basement surface. This wont be interpolated it just gives the values

  • the volume below the last surface. (for) –

Keyword Arguments

update_surfaces (bool) – True

Returns

True

Return type

bool

See also

get_data(itype='data', verbosity=0, numeric=False)[source]

Method to return the data stored in panda.DataFrame within a gempy.core.model.Project data object.

Parameters
  • itype (str{'all', 'surface_points', 'orientations', 'surfaces', 'series', 'faults', 'faults_relations','additional data'}) – input data type to be retrieved.

  • numeric (bool) – Return only the numerical values of the dataframe. This is much lighter database for storing traces

  • verbosity (int) – Number of properties shown

Returns

Data Object df.

Return type

pandas.DataFrame