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.
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_anglesReturn (azimuth, dip, plunge) corresponding to axis_u, axis_v, axis_w.
axis_uaxis_vaxis_wbounding_boxc_indexCompute the zero-based C-order (tabular) index for the dense grid.
centroid_xReturn the x coordinates of the centroids.
centroid_yReturn the y coordinates of the centroids.
centroid_zReturn the z coordinates of the centroids.
extentsis_regularis_rotatedCheck if the geometry is rotated.
Indicates that this geometry is sparse.
num_blocksshapesrssummarycornerblock_size- classmethod from_json(json_str)[source]
Deserialize a JSON string to create a SparseRegularGeometry object.
- Return type:
- 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:
- property is_sparse: bool
Indicates that this geometry is sparse.