omfpandas.blockmodels.geometry.TensorGeometry
- class omfpandas.blockmodels.geometry.TensorGeometry(corner, axis_u, axis_v, axis_w, tensor_u, tensor_v, tensor_w)[source]
Tensor geometry data class.
Applicable for on omf.v2 TensorGridBlockModel.
- __init__(corner, axis_u, axis_v, axis_w, tensor_u, tensor_v, tensor_w)
Methods
__init__
(corner, axis_u, axis_v, axis_w, ...)from_element
(element)from_json
(json_str)Deserialize a JSON string to a full geometry object.
from_multi_index
(index)nearest_centroid_lookup
(x, y, z)Find the nearest centroid for provided x, y, z points.
to_json
()Convert the full geometry to a JSON string.
to_json_file
(json_filepath)Write the Geometry to a JSON file.
Convert a TensorGeometry to a MultiIndex.
to_summary_json
()Convert the geometry to a JSON string.
Attributes
block_sizes
bounding_box
centroid_u
centroid_v
centroid_w
extents
is_regular
num_cells
shape
summary
tensor_u
tensor_v
tensor_w
corner
axis_u
axis_v
axis_w
- classmethod from_json(json_str)[source]
Deserialize a JSON string to a full geometry object.
- Return type:
- 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_multi_index()[source]
Convert a TensorGeometry 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 - dx: The x cell sizes - dy: The y cell sizes - dz: The z cell sizes
- Return type:
MultiIndex