parq_blockmodel.geometry.SparseRegularGeometry

class parq_blockmodel.geometry.SparseRegularGeometry(corner, block_size, shape, c_index, axis_u=(1, 0, 0), axis_v=(0, 1, 0), axis_w=(0, 0, 1), srs=None)[source]

A subclass of RegularGeometry for sparse geometries using c-index.

__init__(corner, block_size, shape, c_index, axis_u=(1, 0, 0), axis_v=(0, 1, 0), axis_w=(0, 0, 1), srs=None)[source]

Methods

__init__(corner, block_size, shape, c_index)

centroid_i([dtype])

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

centroid_j([dtype])

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

centroid_k([dtype])

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

from_centroids(centroids)

Create a RegularGeometry from centroids.

from_extents(extents, block_size[, axis_u, ...])

Create a RegularGeometry from extents.

from_json(json_str)

Deserialize a JSON string to create a SparseRegularGeometry object.

from_multi_index(index[, shape, corner, ...])

Create a SparseRegularGeometry instance from a pandas MultiIndex.

from_parquet(filepath[, axis_azimuth, ...])

is_compatible(other)

Check if the geometry is compatible with another RegularGeometry.

nearest_centroid_lookup(x, y, z)

Find the nearest centroid for provided x, y, z points.

to_dataframe()

Convert a RegularGeometry to a DataFrame using the cached centroids.

to_ijk_multi_index([dtype])

Convert the sparse c-index to a MultiIndex with (i, j, k) indices.

to_json()

Serialize SparseRegularGeometry to a JSON string.

to_json_file(json_filepath)

Write the Geometry to a JSON file.

to_multi_index()

Convert the sparse c-index to a MultiIndex with (x, y, z) coordinates.

to_pyvista()

to_spatial_index()

Convert a RegularGeometry to an encoded integer index

to_summary_json()

Convert the geometry to a JSON string.

Attributes

axis_angles

Return (azimuth, dip, plunge) corresponding to axis_u, axis_v, axis_w.

axis_u

axis_v

axis_w

bounding_box

c_index

Compute the zero-based C-order (tabular) index for the dense grid.

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 that this geometry is sparse.

num_blocks

shape

srs

summary

corner

block_size

classmethod from_json(json_str)[source]

Deserialize a JSON string to create a SparseRegularGeometry object.

Return type:

SparseRegularGeometry

classmethod from_multi_index(index, shape=None, corner=None, axis_azimuth=0.0, axis_dip=0.0, axis_plunge=0.0, srs=None)[source]

Create a SparseRegularGeometry instance from a pandas MultiIndex.

Parameters:
  • index (pd.MultiIndex) – A MultiIndex containing the levels ‘x’, ‘y’, and ‘z’.

  • shape (Optional[Shape3D]) – The shape of the grid. If None, it is calculated as the tightest possible.

  • corner (Optional[Point]) – The corner of the grid. If None, it is calculated as the tightest possible.

  • axis_azimuth (float) – The azimuth angle in degrees for rotation. Defaults to 0.0.

  • axis_dip (float) – The dip angle in degrees for rotation. Defaults to 0.0.

  • axis_plunge (float) – The plunge angle in degrees for rotation. Defaults to 0.0.

  • srs (Optional[str]) – The spatial reference system. Defaults to None.

Returns:

An instance of SparseRegularGeometry.

Return type:

SparseRegularGeometry

property is_sparse: bool

Indicates that this geometry is sparse.

to_ijk_multi_index(dtype=<class 'numpy.int32'>)[source]

Convert the sparse c-index to a MultiIndex with (i, j, k) indices.

Return type:

MultiIndex

to_json()[source]

Serialize SparseRegularGeometry to a JSON string.

Return type:

str

to_multi_index()[source]

Convert the sparse c-index to a MultiIndex with (x, y, z) coordinates.

Return type:

MultiIndex