gempy.core.data.OrientationsTable

class gempy.core.data.OrientationsTable(data: ndarray = FieldInfo(annotation=NoneType, required=False, default=array([], dtype=[('X', '<f8'), ('Y', '<f8'), ('Z', '<f8'), ('G_x', '<f8'), ('G_y', '<f8'), ('G_z', '<f8'), ('id', '<i4'), ('nugget', '<f8')]), description='A structured NumPy array holding the X, Y, Z coordinates, gradients G_x, G_y, G_z, id, and nugget of each orientation.', exclude=True), name_id_map: dict[str, int] | None = None, _model_transform: Transform | None = None)[source]

A dataclass to represent a table of orientations in a geological model.

Examples using gempy.core.data.OrientationsTable

Basics: Data Classes and Modeling API

Basics: Data Classes and Modeling API

Saving and Loading gempy Models

Saving and Loading gempy Models

Claudius, Queensland, Australia

Claudius, Queensland, Australia

Hecho, Spanish Pyrenees

Hecho, Spanish Pyrenees

Mourèze, France

Mourèze, France

Methods

__init__([data, name_id_map, _model_transform])

empty_orientation(id)

fill_missing_orientations_groups(...)

Fill Missing Orientations Groups

from_arrays(x, y, z, G_x, G_y, G_z, names[, ...])

Create an OrientationsTable from arrays.

get_orientations_by_id(id)

Get orientations by ID.

get_orientations_by_id_groups()

Get orientations grouped by ID.

get_orientations_by_name(name)

Get orientations by name.

initialize_empty()

Attributes

data

A structured NumPy array holding the X, Y, Z coordinates, id, and nugget of each surface point.

df

dt

The custom data type for the data array.

grads

Get the gradient components.

grads_view

Get a view of the gradient components.

id

ids

Get the IDs.

model_transform

name_id_map

A mapping between orientation names and ids.

nugget

Get the nugget values.

xyz

Get the XYZ coordinates.

xyz_view

Get a view of the XYZ coordinates.

dt = dtype([('X', '<f8'), ('Y', '<f8'), ('Z', '<f8'), ('G_x', '<f8'), ('G_y', '<f8'), ('G_z', '<f8'), ('id', '<i4'), ('nugget', '<f8')])

The custom data type for the data array.

data: ndarray = array([],       dtype=[('X', '<f8'), ('Y', '<f8'), ('Z', '<f8'), ('G_x', '<f8'), ('G_y', '<f8'), ('G_z', '<f8'), ('id', '<i4'), ('nugget', '<f8')])

A structured NumPy array holding the X, Y, Z coordinates, id, and nugget of each surface point.

name_id_map: dict[str, int] | None = None

A mapping between orientation names and ids.

classmethod from_arrays(x: ndarray, y: ndarray, z: ndarray, G_x: ndarray, G_y: ndarray, G_z: ndarray, names: Sequence | str, nugget: ndarray | None = None, name_id_map: dict[str, int] | None = None) → OrientationsTable[source]

Create an OrientationsTable from arrays.

Parameters:
  • x (np.ndarray) – Array of x-coordinates.

  • y (np.ndarray) – Array of y-coordinates.

  • z (np.ndarray) – Array of z-coordinates.

  • G_x (np.ndarray) – Array of x-components of the gradients.

  • G_y (np.ndarray) – Array of y-components of the gradients.

  • G_z (np.ndarray) – Array of z-components of the gradients.

  • names (Union[Sequence[str], str]) – Sequence of names corresponding to each orientation.

  • nugget (Optional[np.ndarray]) – Array of nugget values. If None, defaults are used.

  • name_id_map (Optional[dict[str, int]]) – Mapping between names and ids.

Returns:

The created OrientationsTable.

Return type:

OrientationsTable

property xyz: ndarray

Get the XYZ coordinates.

Returns:

The XYZ coordinates.

Return type:

np.ndarray

property xyz_view: ndarray

Get a view of the XYZ coordinates.

Returns:

A view of the XYZ coordinates.

Return type:

np.ndarray

property grads: ndarray

Get the gradient components.

Returns:

The gradient components.

Return type:

np.ndarray

property grads_view: ndarray

Get a view of the gradient components.

Returns:

A view of the gradient components.

Return type:

np.ndarray

property nugget: ndarray

Get the nugget values.

Returns:

The nugget values.

Return type:

np.ndarray

property ids: ndarray

Get the IDs.

Returns:

The IDs.

Return type:

np.ndarray

get_orientations_by_name(name: str) → OrientationsTable[source]

Get orientations by name.

Parameters:

name (str) – The name of the orientations.

Returns:

The orientations corresponding to the given name.

Return type:

OrientationsTable

get_orientations_by_id(id: int) → OrientationsTable[source]

Get orientations by ID.

Parameters:

id (int) – The ID of the orientations.

Returns:

The orientations corresponding to the given ID.

Return type:

OrientationsTable

get_orientations_by_id_groups() → list[OrientationsTable][source]

Get orientations grouped by ID.

Returns:

A list of OrientationsTable objects, each corresponding to a unique ID.

Return type:

list[OrientationsTable]

classmethod fill_missing_orientations_groups(orientations_groups: list[OrientationsTable], surface_points_groups: list[SurfacePointsTable]) → list[OrientationsTable][source]

Fill Missing Orientations Groups

Fills in missing orientations in a list of orientations groups based on a list of surface points.

Args:

__init__(data: ndarray = FieldInfo(annotation=NoneType, required=False, default=array([], dtype=[('X', '<f8'), ('Y', '<f8'), ('Z', '<f8'), ('G_x', '<f8'), ('G_y', '<f8'), ('G_z', '<f8'), ('id', '<i4'), ('nugget', '<f8')]), description='A structured NumPy array holding the X, Y, Z coordinates, gradients G_x, G_y, G_z, id, and nugget of each orientation.', exclude=True), name_id_map: dict[str, int] | None = None, _model_transform: Transform | None = None) → None