parq_blockmodel.geometry.RegularGeometry
- class parq_blockmodel.geometry.RegularGeometry(corner, block_size, shape=<property object>, axis_u=(1, 0, 0), axis_v=(0, 1, 0), axis_w=(0, 0, 1), srs=None)[source]
Regular geometry data class.
- __init__(corner, block_size, shape=<property object>, axis_u=(1, 0, 0), axis_v=(0, 1, 0), axis_w=(0, 0, 1), srs=None)
Methods
__init__
(corner, block_size[, shape, ...])from_extents
(extents, block_size[, axis_u, ...])Create a RegularGeometry from extents.
from_json
(json_str)Deserialize a JSON string to a full geometry object.
from_multi_index
(index[, axis_azimuth, ...])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.
Convert a RegularGeometry to a DataFrame using the cached centroids.
to_json
()Convert the full geometry to a JSON string.
to_json_file
(json_filepath)Write the Geometry to a JSON file.
Convert a RegularGeometry to a MultiIndex.
to_pyvista
()Convert a RegularGeometry to an encoded integer index
to_summary_json
()Convert the geometry to a JSON string.
Attributes
Return (azimuth, dip, plunge) corresponding to axis_u, axis_v, axis_w.
axis_u
axis_v
axis_w
bounding_box
Return the unique u coordinates of the centroids.
Return the unique v coordinates of the centroids.
Return the unique w coordinates of the centroids.
Return the x coordinates of the centroids.
Return the y coordinates of the centroids.
Return the z coordinates of the centroids.
extents
is_regular
is_rotated
Check if the geometry is rotated.
num_blocks
shape
srs
summary
corner
block_size
- property axis_angles
Return (azimuth, dip, plunge) corresponding to axis_u, axis_v, axis_w.
- property centroid_u: ndarray
Return the unique u coordinates of the centroids.
- property centroid_v: ndarray
Return the unique v coordinates of the centroids.
- property centroid_w: ndarray
Return the unique w coordinates of the centroids.
- property centroid_x: ndarray
Return the x coordinates of the centroids.
- property centroid_y: ndarray
Return the y coordinates of the centroids.
- property centroid_z: ndarray
Return the z coordinates of the centroids.
- classmethod from_extents(extents, block_size, axis_u=(1, 0, 0), axis_v=(0, 1, 0), axis_w=(0, 0, 1))[source]
Create a RegularGeometry from extents.
- Return type:
- classmethod from_json(json_str)[source]
Deserialize a JSON string to a full geometry object.
- Return type:
- is_compatible(other)[source]
Check if the geometry is compatible with another RegularGeometry.
- Parameters:
other (
RegularGeometry
) – The other RegularGeometry to check compatibility with.- Returns:
True if the geometries are compatible, False otherwise.
- Return type:
bool
- nearest_centroid_lookup(x, y, z)[source]
Find the nearest centroid for provided x, y, z points.
- Parameters:
x (float) – X coordinate.
y (float) – Y coordinate.
z (float) – Z coordinate.
- Returns:
The coordinates of the nearest centroid.
- Return type:
Point3
- to_dataframe()[source]
Convert a RegularGeometry to a DataFrame using the cached centroids.
- Returns:
The DataFrame representing the blockmodel element geometry.
- Return type:
pd.DataFrame
- to_multi_index()[source]
Convert a RegularGeometry to a MultiIndex.
The MultiIndex will have the following levels: - x: The x coordinates of the cell centres - y: The y coordinates of the cell centres - z: The z coordinates of the cell centres
- Returns:
The MultiIndex representing the blockmodel element geometry.
- Return type:
pd.MultiIndex