# gempy.core.data_modules.geometric_data.Orientations¶

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

Data child with specific methods to manipulate orientation 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 Notice that orientations may be place anywhere in the 3D space

• pole_vector (np.ndarray) – [s3] (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) – [s4] (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]) – [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 the orientations of the model

Type

pn.core.frame.DataFrames

Examples using Orientations

Methods

 __init__(surfaces[, coord, pole_vector, …]) Initialize self. add_orientation(x, y, z, surface[, …]) Add orientation. calculate_gradient([idx]) Calculate the gradient vector of module 1 given dip and azimuth to be able to plot the orientations Calculate and update the orientation data (azimuth and dip) from gradients in the data frame. Create and set orientations from at least 3 points categories_df Delete orientation get_orientation(normal) Get orientation (dip, azimuth, polarity ) for points in all point set 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_orientations(idx, **kwargs) Allows modification of any of an orientation column at a given index. plane_fit(point_list) Fit plane to points in PointSet Fit an d-dimensional plane to the points in a point set. read_data(file_path, **kwargs) Read a comma-separated values (csv) file into DataFrame. read_orientations(table_source[, debug, …]) Read tabular using pandas tools and if inplace set it properly to the surface points object. Set a default point at the middle of the extent area to be able to start making the model set_orientations([coord, pole_vector, …]) Set coordinates, surface and orientation data. 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. sort_table() First we sort the dataframes by the series age. 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, pole_vector=None, orientation=None, surface=None)[source]

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

set_orientations(coord: numpy.ndarray = None, pole_vector: numpy.ndarray = None, orientation: numpy.ndarray = None, surface: list = None)[source]

Set coordinates, surface and orientation data.

If both are passed pole vector has priority over orientation

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

add_orientation(x, y, z, surface, pole_vector: Union[list, tuple, numpy.ndarray] = None, orientation: Union[list, numpy.ndarray] = None, idx=None)[source]

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], str) – [s3] (str, Iterable[str]): list with the surface names for each input point. They must exist in the surfaces object linked to SurfacePoints

• pole_vector (np.ndarray) – [s4] (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) – [s5] (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 (Optional[int, list[int]) – [s6] (int, list, numpy.ndarray): If passed, list of indices where the function will be applied

Returns

Orientations

del_orientation(idx)[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, **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

calculate_gradient(idx=None)[source]

Calculate the gradient vector of module 1 given dip and azimuth to be able to plot the orientations

calculate_orientations(idx=None)[source]

Calculate and update the orientation data (azimuth and dip) from gradients in the data frame.

Authors: Elisa Heim, Miguel de la Varga

create_orientation_from_surface_points(surface_points: gempy.core.data_modules.geometric_data.SurfacePoints, indices)[source]

Create and set orientations from at least 3 points categories_df

Parameters
• 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.

• indices (list[int]) – indices of the surface point used to generate the orientation. At least 3 independent points will need to be passed.

set_default_orientation()[source]

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

read_orientations(table_source, debug=False, inplace=True, kwargs_pandas: 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 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

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

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

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

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

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

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

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

Returns:

GeometricData.read_data()

update_annotations()[source]

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

Returns:

static get_orientation(normal)[source]

Get orientation (dip, azimuth, polarity ) for points in all point set

static plane_fit(point_list)[source]

Fit plane to points in PointSet Fit an d-dimensional plane to the points in a point set. adjusted from: http://stackoverflow.com/questions/12299540/plane-fitting-to-4-or-more-xyz-points

Parameters

point_list (array_like) – array of points XYZ

Returns

Return a point, p, on the plane (the point-cloud centroid), and the normal, n.