Surface#
- class cegalprizm.pythontool.Surface(petrel_object_link: SurfaceGrpc)#
Functions
__init__
(petrel_object_link)add_comment
(new_comment[, overwrite])Add a comment to the already existing comments on the PetrelObject, or overwrite the existing comments.
clone
(name_of_clone[, copy_values])ijks_to_positions
(indices)Converts a list with i and j indices to xyz.
indices
(x, y)The indices of the surface node nearest the specified point
position
(i, j)The xyz position of the surface node
positions_to_ijks
(positions)Converts a list of xyzs to ijk
The Petrel history for the object.
Retrieves a dictionary summarizing the statistics for the object
Properties
The affine transform of the object.
The comments on the PetrelObject.
The extent of the object in world-coordinates
The PROJCS well known text representation of the object CRS.
The Petrel Droid (object id or guid) for the object
The number of surface nodes in the i and j directions.
The parent collection containing this surface.
The path of this object in Petrel.
Returns the name of this object in Petrel
The read-only status of this object
The attributes for this surface
Returns the Petrel template for the object as a string.
- add_comment(new_comment: str, overwrite: bool = False) None #
Add a comment to the already existing comments on the PetrelObject, or overwrite the existing comments.
- Input:
new_comment: The new comment to add to the PetrelObject. overwrite: Boolean flag to overwrite all existing comments with the new comment. Default is False.
- Raises
PythonToolException – if object is read-only
- ijks_to_positions(indices: Tuple[List[float], List[float]]) Tuple[List[float], List[float], List[float]] #
Converts a list with i and j indices to xyz.
- Parameters
indices – A tuple([i],[j]) where [i] is a list of i indices and [j] is a list of j indices.
- Returns
- A tuple([x],[y],[z]) where [x] is a list of x coordinates,
[y] is a list of y coordinates and [z] is a list of z coordinates.
- indices(x: float, y: float) cegalprizm.pythontool.primitives.Indices #
The indices of the surface node nearest the specified point
Note: the node indices are 0-based, but in the Petrel UI they are 1-based.
- Parameters
x – the x-coordinate
y – the y-coordinate
- Raises
ValueError – if the point is outside the beyond the extent of the surface
- Returns
A
cegalprizm.pythontool.primitives.Indices
object representing the indices of the node nearest the point. k will always be None.
- position(i: int, j: int) cegalprizm.pythontool.primitives.Point #
The xyz position of the surface node
- Parameters
i – the i-index of the surface node
j – the j -index of the surface node
- Raises
ValueError – if the indices are outside the surface
- Returns
A
cegalprizm.pythontool.Point
object representing the xyz position of the surface node.
- positions_to_ijks(positions: Union[Tuple[List[float], List[float]], Tuple[List[float], List[float], List[float]]]) Tuple[List[float], List[float]] #
Converts a list of xyzs to ijk
- Parameters
positions – A tuple([x],[y]) where [x] is a list of x coordinates and [y] is a list of y coordinates.
- Returns
- A tuple([i],[j]) where [i] is a list of i indices
and [j] is a list of j indices.
- retrieve_history() pandas.core.frame.DataFrame #
The Petrel history for the object.
Returns the Petrel history for the object as Pandas dataframe.
- Returns
The history of the object as reported by Petrel
- Return type
DataFrame
- retrieve_stats() Dict[str, str] #
Retrieves a dictionary summarizing the statistics for the object
The statistics are a snapshot of the information in the Statistics page of the Settings panel of the object in the Petrel tree. Both the dict key and value are strings, and may contain punctuation, English phrases or just filler information. Any changes to the dict returned will not be saved or affect anything.
Note: this operation may be slow, since the statistics are ‘live’ - they represent the most up to date information.
- Returns
The statistics of the object as reported by Petrel
- Return type
dict
- property affine_transform#
The affine transform of the object.
- Returns
An array with 6 coefficients of the affine transformation matrix. If array is represented as [a, b, c, d, e, f] then this corresponds to a affine transformation matrix of form: | a b e | | c d f | | 0 0 1 |
- Return type
1d array
- property comments#
The comments on the PetrelObject.
- Returns
The comments on the PetrelObject as a string.
- Return type
string
- property coords_extent: cegalprizm.pythontool.primitives.CoordinatesExtent#
The extent of the object in world-coordinates
- Returns
- the extent of the
object in world-coordinate
- Return type
- property crs_wkt#
The PROJCS well known text representation of the object CRS.
- Returns
PROJCS well known text representation of the CRS.
- Return type
string
- property droid: str#
The Petrel Droid (object id or guid) for the object
Returns the Petrel Droid or object id or guid for the object. If not available, will throw a PythonToolException.
This property is planned to be deprecated in favour of a similar but more general id schema in future releases.
- Returns
The Petrel Droid of the object
- Return type
str
- property extent: cegalprizm.pythontool.primitives.Extent#
The number of surface nodes in the i and j directions.
- Returns
The number of surface nodes in each direction.
- Return type
cegalprizm.pythontool.Extent
- property parent_collection: cegalprizm.pythontool.surface.Surfaces#
The parent collection containing this surface.
Iterating through this collection will return this surface and all its siblings in the Petrel Input Tree.
- Returns
the parent collection
- Return type
cegalprizm.pythontool.Surfaces
- property path: str#
The path of this object in Petrel. Neither the Petrel name nor the path is guaranteed to be unique.
- Returns
The path of the Petrel object
- Return type
str
- property petrel_name: str#
Returns the name of this object in Petrel
- property readonly: bool#
The read-only status of this object
- Returns
True if the object is read-only
- Return type
bool
- property surface_attributes: cegalprizm.pythontool.surface.SurfaceAttributes#
The attributes for this surface
- Returns
the attributes for the surface
- Return type
cegalprizm.pythontool.SurfaceAttributes
- property template: str#
Returns the Petrel template for the object as a string. If no template available, will return an empty string.