HorizonProperty3d#

class cegalprizm.pythontool.HorizonProperty3d(python_petrel_property: HorizonProperty3dGrpc)#

Functions

__init__(python_petrel_property)

add_comment(new_comment[, overwrite])

Add a comment to the already existing comments on the PetrelObject, or overwrite the existing comments.

all()

Creates a cegalprizm.pythontool.Chunk with the values for the attribute

chunk([i, j])

Creates a cegalprizm.pythontool.Chunk with the values for the attribute

clone(name_of_clone[, copy_values])

Creates a clone of the Petrel object.

ijks_to_positions(indices)

Converts a list with i and j indices to xyz.

indices(x, y)

The indices of the node nearest the specified point

is_undef_value(value)

Whether the value is the 'undefined value' for the attribute

position(i, j)

The position of the node

positions_to_ijks(positions)

Converts a list of xyzs to ijk

retrieve_history()

The Petrel history for the object.

retrieve_stats()

Retrieves a dictionary summarizing the statistics for the object

Properties

affine_transform

The affine transform of the object.

comments

The comments on the PetrelObject.

crs_wkt

The PROJCS well known text representation of the object CRS.

droid

The Petrel Droid (object id or guid) for the object

extent

The number of nodes in the i and j directions

horizon_interpretation_3d

The parent 3d horizon interpretation of the horizon property.

path

The path of this object in Petrel.

petrel_name

Returns the name of this object in Petrel

readonly

The read-only status of this object

template

Returns the Petrel template for the object as a string.

undef_value

The 'undefined value' for this attribute

unit_symbol

The symbol for the unit which the values are measured in

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

all() cegalprizm.pythontool.chunk.Chunk#

Creates a cegalprizm.pythontool.Chunk with the values for the attribute

Returns

A Slice containing the values for the attribute

Return type

cegalprizm.pythontool.Chunk

chunk(i: Optional[Tuple[int, int]] = None, j: Optional[Tuple[int, int]] = None) cegalprizm.pythontool.chunk.Chunk#

Creates a cegalprizm.pythontool.Chunk with the values for the attribute

Parameters
  • i – A tuple(i1,i2) where i1 is the start index and i2 is the end index. The start and end value in this range is inclusive. If None include all i values.

  • j – A tuple(j1,j2) where j1 is the start index and j2 is the end index. The start and end value in this range is inclusive. If None include all j values.

Returns

A Slice containing the values for the attribute

Return type

cegalprizm.pythontool.Chunk

clone(name_of_clone: str, copy_values: bool = False) cegalprizm.pythontool.horizoninterpretation.HorizonProperty3d#

Creates a clone of the Petrel object.

The clone is placed in the same collection as the source object. A clone cannot be created with the same name as an existing Petrel object in the same collection.

This is a Python Tool Pro function and is not available when running scripts in the editor integrated in Python Tool or in a workflow.

Parameters
  • path_of_clone – Petrel name of the clone

  • copy_values – Set to True if values shall be copied into the clone. Defaults to False.

Returns

the cloned HorizonProperty3d object

Return type

cegalprizm.pythontool.HorizonProperty3d

Raises
  • Exception – If there already exists a Petrel object with the same name

  • ValueError – If name_of_clone is empty or contains slashes

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 node nearest the specified point

Please 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

Returns: A cegalprizm.pythontool.primitives.Indices object

representing the indices of the node nearest the point. K will always be None.

Raises

ValueError – if the point is outside the beyond the extent of the surface

is_undef_value(value: Union[float, int]) bool#

Whether the value is the ‘undefined value’ for the attribute

Petrel represents some undefined values by MAX_INT, others by NaN. A comparison with NaN will always return False (e.g. float.nan != float.nan) so it is preferable to always use this method to test for undefined values.

Parameters

value – the value to test

Returns

True if value is ‘undefined’ for this surface attribute

Return type

bool

position(i: int, j: int) cegalprizm.pythontool.primitives.Point#

The position of the node

Parameters
  • i – the i-index of the node

  • j – the j -index of the node

Returns: A cegalprizm.pythontool.Point object

representing the position of the node.

Raises

ValueError – if the indices are outside the surface

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 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 nodes in the i and j directions

Returns

A cegalprizm.pythontool.Extent object

property horizon_interpretation_3d: cegalprizm.pythontool.horizoninterpretation.HorizonInterpretation3d#

The parent 3d horizon interpretation of the horizon property.

Returns

The parent grid of the property

Return type

cegalprizm.pythontool.HorizonInterpretation3d

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 template: str#

Returns the Petrel template for the object as a string. If no template available, will return an empty string.

property undef_value: float#

The ‘undefined value’ for this attribute

Use this value when setting a slice’s value to ‘undefined’. Do not attempt to test for undefinedness by comparing with this value, use is_undef_value() instead.

Returns

The ‘undefined value’ for this attribute

property unit_symbol: Optional[str]#

The symbol for the unit which the values are measured in

Returns

The symbol for the unit, or None if no unit is used

Return type

string