geoh5py.objects package

Subpackages

Submodules

geoh5py.objects.block_model module

class geoh5py.objects.block_model.BlockModel(object_type: geoh5py.objects.object_type.ObjectType, **kwargs)[source]

Bases: geoh5py.objects.object_base.ObjectBase

Rectilinear 3D tensor mesh defined by three perpendicular axes. Each axis is divided into discrete intervals that define the cell dimensions. Nodal coordinates are determined relative to the origin and the sign of cell delimiters. Negative and positive cell delimiters are accepted to denote relative offsets from the origin.

property centroids

numpy.array, shape (n_cells, 3): Cell center locations in world coordinates.

centroids = [
    [x_1, y_1, z_1],
    ...,
    [x_N, y_N, z_N]
]
classmethod default_type_uid() uuid.UUID[source]
Returns

Default unique identifier

property n_cells: int | None

int: Total number of cells

property origin: numpy.ndarray

numpy.array of float, shape (3, ): Coordinates of the origin.

property rotation: float

float: Clockwise rotation angle (degree) about the vertical axis.

property shape: tuple | None

list of int, len (3, ): Number of cells along the u, v and z-axis

property u_cell_delimiters: np.ndarray | None

numpy.array of float: Nodal offsets along the u-axis relative to the origin.

property u_cells: np.ndarray | None

numpy.array of float, shape (shape [0], ): Cell size along the u-axis.

property v_cell_delimiters: np.ndarray | None

numpy.array of float: Nodal offsets along the v-axis relative to the origin.

property v_cells: np.ndarray | None

numpy.array of float, shape (shape [1], ): Cell size along the v-axis.

property z_cell_delimiters: np.ndarray | None

numpy.array of float: Nodal offsets along the z-axis relative to the origin (positive up).

property z_cells: np.ndarray | None

numpy.array of float, shape (shape [2], ): Cell size along the z-axis

geoh5py.objects.curve module

class geoh5py.objects.curve.Curve(object_type: geoh5py.objects.object_type.ObjectType, **kwargs)[source]

Bases: geoh5py.objects.points.Points

Curve object defined by a series of line segments (cells) connecting vertices.

property cells: np.ndarray | None

numpy.ndarray of int, shape (*, 2): Array of indices defining segments connecting vertices. Defined based on parts if set by the user.

property current_line_id
classmethod default_type_uid() uuid.UUID[source]
Returns

Default unique identifier

property parts

numpy.array of int, shape (n_vertices, 2): Group identifiers for vertices connected by line segments as defined by the cells property. The definition of the cells property get modified by the setting of parts.

property unique_parts

list of int: Unique parts identifiers.

geoh5py.objects.drillhole module

class geoh5py.objects.drillhole.Drillhole(object_type: geoh5py.objects.object_type.ObjectType, **kwargs)[source]

Bases: geoh5py.objects.points.Points

Drillhole object class defined by

Warning

Not yet implemented.

add_data(data: dict, property_group: str = None) Data | list[Data][source]

Create Data specific to the drillhole object from dictionary of name and arguments. A keyword ‘depth’ or ‘from-to’ with corresponding depth values is expected in order to locate the data along the well path.

Parameters

data – Dictionary of data to be added to the object, e.g.

data_dict = {
    "data_A": {
        'values', [v_1, v_2, ...],
        "from-to": numpy.ndarray,
        },
    "data_B": {
        'values', [v_1, v_2, ...],
        "depth": numpy.ndarray,
        },
}
Returns

List of new Data objects.

add_vertices(xyz)[source]

Function to add vertices to the drillhole

property cells: np.ndarray | None

numpy.ndarray of int, shape (*, 2): Array of indices defining segments connecting vertices.

property collar

numpy.array of float, shape (3, ): Coordinates of the collar

property cost

float: Cost estimate of the drillhole

property default_collocation_distance

Minimum collocation distance for matching depth on merge

classmethod default_type_uid() uuid.UUID[source]
desurvey(depths)[source]

Function to return x, y, z coordinates from depth.

property deviation_x

numpy.ndarray: Store the change in x-coordinates along the well path.

property deviation_y

numpy.ndarray: Store the change in y-coordinates along the well path.

property deviation_z

numpy.ndarray: Store the change in z-coordinates along the well path.

property locations

numpy.ndarray: Lookup array of the well path x,y,z coordinates.

property planning

str: Status of the hole: [“Default”, “Ongoing”, “Planned”, “Completed”]

sort_depths()[source]

Read the ‘DEPTH’ data and sort all Data.values if needed

property surveys

numpy.array of float, shape (3, ): Coordinates of the surveys

property trace: np.ndarray | None

numpy.array: Drillhole trace defining the path in 3D

property trace_depth: np.ndarray | None

numpy.array: Drillhole trace depth from top to bottom

validate_interval_data(from_to, input_values, collocation_distance=0.0001)[source]

Compare new and current depth values, append new vertices if necessary and return an augmented values vector that matches the vertices indexing.

validate_log_data(depth, input_values, collocation_distance=0.0001)[source]

Compare new and current depth values, append new vertices if necessary and return an augmented values vector that matches the vertices indexing.

geoh5py.objects.geo_image module

class geoh5py.objects.geo_image.GeoImage(object_type: geoh5py.objects.object_type.ObjectType, **kwargs)[source]

Bases: geoh5py.objects.object_base.ObjectBase

Image object class.

Warning

Not yet implemented.

classmethod default_type_uid() uuid.UUID[source]

geoh5py.objects.grid2d module

class geoh5py.objects.grid2d.Grid2D(object_type: geoh5py.objects.object_type.ObjectType, **kwargs)[source]

Bases: geoh5py.objects.object_base.ObjectBase

Rectilinear 2D grid of uniform cell size. The grid can be oriented in 3D space through horizontal rotation and dip parameters. Nodal coordinates are determined relative to the origin and the sign of cell delimiters.

property cell_center_u: np.ndarray | None

numpy.array of float, shape(u_count, ): Cell center local coordinate along the u-axis.

property cell_center_v: np.ndarray | None

numpy.array of float shape(u_count, ): The cell center local coordinate along the v-axis.

property centroids: np.ndarray | None

numpy.array of float, shape (n_cells, 3): Cell center locations in world coordinates.

centroids = [
    [x_1, y_1, z_1],
    ...,
    [x_N, y_N, z_N]
]
classmethod default_type_uid() uuid.UUID[source]
Returns

Default unique identifier

property dip: float

float: Dip angle from horizontal (positive down) in degrees.

property n_cells: int | None

int: Total number of cells.

property origin: numpy.ndarray

numpy.array of float, shape (3, ): Coordinates of the origin.

property rotation: float

float: Clockwise rotation angle (degree) about the vertical axis.

property shape: tuple | None

list of int, len (2, ): Number of cells along the u and v-axis.

property u_cell_size: float | None

float: Cell size along the u-axis.

property u_count: int | None

int: Number of cells along u-axis

property v_cell_size: float | None

float: Cell size along the v-axis

property v_count: int | None

int: Number of cells along v-axis

property vertical: bool | None

bool: Set the grid to be vertical.

geoh5py.objects.label module

class geoh5py.objects.label.Label(object_type: geoh5py.objects.object_type.ObjectType, **kwargs)[source]

Bases: geoh5py.objects.object_base.ObjectBase

Label object for annotation in viewport.

Warning

Not yet implemented.

classmethod default_type_uid() uuid.UUID[source]

geoh5py.objects.notype_object module

class geoh5py.objects.notype_object.NoTypeObject(object_type: geoh5py.objects.object_type.ObjectType, **kwargs)[source]

Bases: geoh5py.objects.object_base.ObjectBase

Generic Data object without a registered type

classmethod default_type_uid() uuid.UUID[source]

geoh5py.objects.object_base module

class geoh5py.objects.object_base.ObjectBase(object_type: geoh5py.objects.object_type.ObjectType, **kwargs)[source]

Bases: geoh5py.shared.entity.Entity

Object base class.

add_comment(comment: str, author: Optional[str] = None)[source]

Add text comment to an object.

Parameters
  • comment – Text to be added as comment.

  • author – Name of author or defaults to contributors.

add_data(data: dict, property_group: str = None) Data | list[Data][source]

Create Data from dictionary of name and arguments. The provided arguments can be any property of the target Data class.

Parameters

data – Dictionary of data to be added to the object, e.g.

data = {
    "data_A": {
        'values', [v_1, v_2, ...],
        'association': 'VERTEX'
        },
    "data_B": {
        'values', [v_1, v_2, ...],
        'association': 'CELLS'
        },
}
Returns

List of new Data objects.

add_data_to_group(data: list | Data | uuid.UUID | str, name: str) PropertyGroup[source]

Append data children to a PropertyGroup All given data must be children of the parent object.

Parameters
  • dataData object, uid or name of data.

  • name – Name of a PropertyGroup. A new group is created if none exist with the given name.

Returns

The target property group.

property cells

numpy.array of int: Array of indices defining the connection between vertices.

property comments

Fetch a CommentsData entity from children.

abstract classmethod default_type_uid() uuid.UUID[source]
property entity_type: geoh5py.objects.object_type.ObjectType

EntityType: Object type.

property faces
find_or_create_property_group(**kwargs) geoh5py.groups.property_group.PropertyGroup[source]

Find or create PropertyGroup from given name and properties.

Parameters

kwargs – Any arguments taken by the PropertyGroup class.

Returns

A new or existing PropertyGroup

classmethod find_or_create_type(workspace: workspace.Workspace, **kwargs) ObjectType[source]

Find or create a type instance for a given object class.

Parameters

workspace – Target Workspace.

Returns

The ObjectType instance for the given object class.

get_data(name: str) list[Data][source]

Get a child Data by name.

Parameters

name – Name of the target child data

Returns

A list of children Data objects

get_data_list() list[str][source]

Get a list of names of all children Data.

Returns

List of names of data associated with the object.

property last_focus: str

bool: Object visible in camera on start.

property n_cells: int | None

int: Number of cells.

property n_vertices: int | None

int: Number of vertices.

property property_groups: list[PropertyGroup]

list of PropertyGroup.

remove_data_from_group(data: list | Data | uuid.UUID | str, name: str = None)[source]

Remove data children to a PropertyGroup All given data must be children of the parent object.

Parameters
  • dataData object, uid or name of data.

  • name – Name of a PropertyGroup. A new group is created if none exist with the given name.

validate_data_association(attribute_dict)[source]

Get a dictionary of attributes and validate the data ‘association’ keyword.

static validate_data_type(attribute_dict)[source]

Get a dictionary of attributes and validate the type of data.

property vertices

numpy.array of float, shape (*, 3): Array of x, y, z coordinates defining the position of points in 3D space.

geoh5py.objects.object_type module

class geoh5py.objects.object_type.ObjectType(workspace: workspace.Workspace, **kwargs)[source]

Bases: geoh5py.shared.entity_type.EntityType

Object type class

static create_custom(workspace: workspace.Workspace) ObjectType[source]

Creates a new instance of ObjectType for an unlisted custom Object type with a new auto-generated UUID.

Parameters

workspace – An active Workspace class

classmethod find_or_create(workspace: workspace.Workspace, entity_class, **kwargs) ObjectType[source]

Find or creates an EntityType with given uuid.UUID that matches the given Group implementation class.

It is expected to have a single instance of EntityType in the Workspace for each concrete Entity class.

Parameters
  • workspace – An active Workspace class

  • entity_class – An Group implementation class.

Returns

A new instance of GroupType.

geoh5py.objects.octree module

class geoh5py.objects.octree.Octree(object_type: geoh5py.objects.object_type.ObjectType, **kwargs)[source]

Bases: geoh5py.objects.object_base.ObjectBase

Octree mesh class that uses a tree structure such that cells can be subdivided it into eight octants.

base_refine()[source]

Refine the mesh to its base octree level resulting in a single cell along the shortest dimension.

property centroids

numpy.array of float, shape (n_cells, 3): Cell center locations in world coordinates.

centroids = [
    [x_1, y_1, z_1],
    ...,
    [x_N, y_N, z_N]
]
classmethod default_type_uid() uuid.UUID[source]
property n_cells: int | None

int: Total number of cells in the mesh

property octree_cells: np.ndarray | None

numpy.ndarray of int, shape (n_cells, 4): Array defining the i, j, k position and size of each cell. The size defines the width of a cell in number of base cells.

cells = [
    [i_1, j_1, k_1, size_1],
    ...,
    [i_N, j_N, k_N, size_N]
]
property origin

numpy.array of float, shape (3, ): Coordinates of the origin

property rotation: float

float: Clockwise rotation angle (degree) about the vertical axis.

property shape: tuple | None

list of int, len (3, ): Number of cells along the u, v and w-axis.

property u_cell_size: float | None

float: Base cell size along the u-axis.

property u_count: int | None

int: Number of cells along u-axis.

property v_cell_size: float | None

float: Base cell size along the v-axis.

property v_count: int | None

int: Number of cells along v-axis.

property w_cell_size: float | None

float: Base cell size along the w-axis.

property w_count: int | None

int: Number of cells along w-axis.

geoh5py.objects.points module

class geoh5py.objects.points.Points(object_type: geoh5py.objects.object_type.ObjectType, **kwargs)[source]

Bases: geoh5py.objects.object_base.ObjectBase

Points object made up of vertices.

classmethod default_type_uid() uuid.UUID[source]
property vertices: np.ndarray | None

vertices

geoh5py.objects.surface module

class geoh5py.objects.surface.Surface(object_type: geoh5py.objects.object_type.ObjectType, **kwargs)[source]

Bases: geoh5py.objects.points.Points

Surface object defined by vertices and cells

property cells: np.ndarray | None

Array of vertices index forming triangles :return cells: numpy.array of int, shape (“*”, 3)

classmethod default_type_uid() uuid.UUID[source]

Module contents