gempy.core.data_modules.geometric_data.SurfacePoints

class gempy.core.data_modules.geometric_data.SurfacePoints(surfaces: gempy.core.data.Surfaces, coord=None, surface=None)[source]

Data child with specific methods to manipulate interface data. It is initialize without arguments to give flexibility to the origin of the data.

Parameters
  • surfaces (Surfaces) – [s0] Class that contains the surfaces of the model and the values of each of them.

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

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

df

Pandas data frame containing the necessary information respect

Type

pn.core.frame.DataFrames

the surface points of the model

Examples using SurfacePoints

Methods

__init__(surfaces[, coord, surface])

Initialize self.

add_surface_points(x, y, z, surface[, idx])

Add surface points.

del_surface_points(idx)

Delete surface points.

init_dependent_properties()

Set the defaults values to the columns before gets mapped with the the Surfaces attribute.

map_data_from_series(series, attribute[, idx])

Map columns from the Series data frame to a GeometricData data frame.

map_data_from_surfaces(surfaces, attribute)

Map columns from the Series data frame to a GeometricData data frame.

modify_surface_points(idx, **kwargs)

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

read_data(file_path, **kwargs)

Read a comma-separated values (csv) file into DataFrame.

read_surface_points(table_source[, debug, …])

Read tabular using pandas tools and if inplace set it properly to the surface points object.

set_default_surface_points()

Set a default point at the middle of the extent area to be able to start making the model

set_series_categories_from_series(series)

set the series categorical columns with the series index of the passed Series

set_surface_categories_from_surfaces(surfaces)

set the series categorical columns with the series index of the passed Series.

set_surface_points([coord, surface])

Set coordinates and surface columns on the df.

sort_table()

First we sort the dataframes by the series age.

update_annotations()

Add a column in the Dataframes with latex names for each input_data paramenter.

update_series_category()

Update the series categorical columns with the series categories of the Surfaces attribute.

__init__(surfaces: gempy.core.data.Surfaces, coord=None, surface=None)[source]

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

set_surface_points(coord: Optional[numpy.ndarray] = None, surface: Optional[list] = None)[source]

Set coordinates and surface columns on the df.

Parameters
  • coord (np.ndarray) – [s0] (numpy.ndarray[float, 3]): XYZ 2D array. Axis 1 is the coordinates while axis 0 is n number of input

  • 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

SurfacePoints

add_surface_points(x: Union[float, numpy.ndarray], y: Union[float, numpy.ndarray], z: Union[float, numpy.ndarray], surface: Union[list, numpy.ndarray], idx: Optional[Union[int, list, numpy.ndarray]] = None)[source]

Add surface points.

Parameters
  • x (float, np.ndarray) – [s0] (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 (list[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

Returns

gempy.core.data_modules.geometric_data.SurfacePoints

del_surface_points(idx: Union[int, list, numpy.ndarray])[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

modify_surface_points(idx: Union[int, list, numpy.ndarray], **kwargs)[source]

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

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

  • **kwargs

    • X: [s1] (float, Iterable[float]): values or list of values for the x coordinate

    • Y: [s2] (float, Iterable[float]): values or list of values for the y coordinate

    • Z: [s3] (float, Iterable[float]): values or list of values for the z coordinate

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

Returns

gempy.core.data_modules.geometric_data.SurfacePoints

read_surface_points(table_source, debug=False, inplace=False, kwargs_pandas: Optional[dict] = None, **kwargs)[source]

Read tabular using pandas tools and if inplace set it properly to the surface points object.

Parameters
  • table_source (str, path object, file-like object or direct pandas data frame) – [s0] Any valid string path is acceptable. The string could be a URL. Valid URL schemes include http, ftp, s3, and file. For file URLs, a host is expected. A local file could be: file://localhost/path/to/table.csv. If you want to pass in a path object, pandas accepts either pathlib.Path or py._path.local.LocalPath. By file-like object, we refer to objects with a read() method, such as a file handler (e.g. via builtin open function) or StringIO

  • debug (bool) – [s1] of debug is True the method will return the result without modify any related objec

  • inplace (bool) – [s2] if True, perform operation in-plac

  • kwargs_pandas – kwargs for the panda function pn.read_csv()

  • **kwargs

    • update_surfaces (bool): If True add to the linked Surfaces object unique surface names read on the csv file

    • coord_x_name (str): Name of the header on the csv for this attribute, e.g for coord_x. Default X

    • coord_y_name (str): Name of the header on the csv for this attribute. Default Y.

    • coord_z_name (str): Name of the header on the csv for this attribute. Default Z.

    • surface_name (str): Name of the header on the csv for this attribute. Default formation

Returns:

See also

GeometricData.read_data()

set_default_surface_points()[source]

Set a default point at the middle of the extent area to be able to start making the model

update_annotations()[source]

Add a column in the Dataframes with latex names for each input_data paramenter.

Returns

SurfacePoints