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__()

from_multi_index(index)

nearest_centroid_lookup(x, y, z)

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_u

Return the unique u coordinates of the centroids.

centroid_v

Return the unique v coordinates of the centroids.

centroid_w

Return the unique w coordinates of the centroids.

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.

num_blocks

shape

srs

summary

corner

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

Return the unique u coordinates of the centroids.

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

Return the unique v coordinates of the centroids.

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

Return the unique w coordinates of the centroids.

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.

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