parq_blockmodel.geometry.Geometry

class parq_blockmodel.geometry.Geometry[source]

Base class for geometry objects.

The geometry associated with omf block models are not defined by block centroids, and vary by block model type. In the pandas representation, the geometry is defined by the block centroids, so this class is used to define the geometry in terms of block centroids. Additionally, other properties of the geometry are defined here, such as the shape of the geometry.

Attributes (in omf and pyvista) are stored in Fortran ‘F’ order, meaning that the last index changes the fastest. Hence, the MultiIndex levels need to be sorted by ‘z’, ‘y’, ‘x’, to align with the Fortran order. This has x changing fastest, z changing slowest.

__init__()

Methods

__init__()

centroid_i()

Return the unique i (axis u) indices of the centroids.

centroid_j()

Return the unique j (axis v) indices of the centroids.

centroid_k()

Return the unique k (axis w) indices of the centroids.

from_multi_index(index)

nearest_centroid_lookup(x, y, z)

to_ijk_multi_index([dtype])

to_json_file(json_filepath)

Write the Geometry to a JSON file.

to_multi_index()

to_summary_json()

Convert the geometry to a JSON string.

Attributes

axis_u

axis_v

axis_w

bounding_box

centroid_x

Return the x coordinates of the centroids.

centroid_y

Return the y coordinates of the centroids.

centroid_z

Return the z coordinates of the centroids.

extents

is_regular

is_rotated

Check if the geometry is rotated.

is_sparse

Indicates whether the geometry is sparse.

num_blocks

shape

srs

summary

corner

abstract centroid_i()[source]

Return the unique i (axis u) indices of the centroids.

Return type:

ndarray[Any, dtype[floating]]

abstract centroid_j()[source]

Return the unique j (axis v) indices of the centroids.

Return type:

ndarray[Any, dtype[floating]]

abstract centroid_k()[source]

Return the unique k (axis w) indices of the centroids.

Return type:

ndarray[Any, dtype[floating]]

abstract property centroid_x: ndarray[Any, dtype[floating]]

Return the x coordinates of the centroids.

abstract property centroid_y: ndarray[Any, dtype[floating]]

Return the y coordinates of the centroids.

abstract property centroid_z: ndarray[Any, dtype[floating]]

Return the z coordinates of the centroids.

property is_rotated: bool

Check if the geometry is rotated.

property is_sparse: bool

Indicates whether the geometry is sparse.

to_json_file(json_filepath)[source]

Write the Geometry to a JSON file.

Parameters:

json_filepath (Path) – The path to write the JSON file.

Return type:

Path

Returns:

Path to the json file.

to_summary_json()[source]

Convert the geometry to a JSON string.

Returns:

The JSON string representing the geometry.

Return type:

str