MarkerAttribute#

class cegalprizm.pythontool.MarkerAttribute(petrel_object_link: MarkerAttributeGrpc, parent_markercollection)#

A class holding information about a MarkerAttribute

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.

as_array([include_unconnected_markers, ...])

Gets a numpy array with the values for MarkerAttribute in the MarkerCollection.

as_dataframe([include_unconnected_markers, ...])

Gets a dataframe with information about a MarkerAttribute in the MarkerCollection.

clone(name_of_clone[, copy_values])

retrieve_history()

The Petrel history for the object.

retrieve_stats()

Retrieves a dictionary summarizing the statistics for the object

set_values(data[, ...])

Attribute values are written to Petrel. The data parameter must be a numpy array.

Properties

comments

The comments on the PetrelObject.

droid

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

markercollection

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.

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

as_array(include_unconnected_markers: bool = True, marker_stratigraphy: Optional[cegalprizm.pythontool.markerstratigraphy.MarkerStratigraphy] = None, well: Optional[cegalprizm.pythontool.borehole.Well] = None) numpy.array#

Gets a numpy array with the values for MarkerAttribute in the MarkerCollection.

Parameters
  • include_unconnected_markers – Flag to include markers where the borehole does not exist in the project. Defaults to true.

  • marker_stratigraphy – Limit array to include only markers for one specified MarkerStratigraphy (as returned my markercollection.stratigraphies). Defaults to None.

  • well – Limit array to include only markers for a specified Well (as returned by petrelconnection.wells). Defaults to None.

Returns

A numpy array with the values for the MarkerAttribute.

Return type

Array

as_dataframe(include_unconnected_markers: bool = True, marker_stratigraphy: Optional[cegalprizm.pythontool.markerstratigraphy.MarkerStratigraphy] = None, well: Optional[cegalprizm.pythontool.borehole.Well] = None) pandas.core.frame.DataFrame#

Gets a dataframe with information about a MarkerAttribute in the MarkerCollection.

Parameters
  • include_unconnected_markers – Flag to include markers where the borehole does not exist in the project. Defaults to true.

  • marker_stratigraphy – Limit dataframe to include only markers for one specified MarkerStratigraphy (as returned my markercollection.stratigraphies). Defaults to None.

  • well – Limit dataframe to include only markers for a specified Well (as returned by petrelconnection.wells). Defaults to None.

Returns

A dataframe with MarkerAttribute information together with Petrel index, Well identifier and Surface information.

Return type

Dataframe

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

set_values(data: numpy.array, include_unconnected_markers: bool = True, marker_stratigraphy: Optional[cegalprizm.pythontool.markerstratigraphy.MarkerStratigraphy] = None, well: Optional[cegalprizm.pythontool.borehole.Well] = None) None#
Attribute values are written to Petrel. The data parameter must be a numpy array.

The length of the array must match the number of selected markers in the markercollection.

Example:

Set a new numpy array as the values of a specified attribute and write the new data back to Petrel.

import numpy as np
new_attribute_values = np.array([1.1, 2.2, 3.3])
my_attribute = markercollection.attributes['my attribute']
my_attribute.set_values(new_attribute_values, False)
Parameters
  • data – A numpy array of attributes with format as returned by as_array()

  • include_unconnected_markers – A boolean flag to include markers where the borehole does not exist in the project. Defaults to True.

  • marker_stratigraphy – Limit array to include only markers for one specified MarkerStratigraphy (as returned my markercollection.stratigraphies). Defaults to None.

  • well – Limit array to include only markers for a specified Well (as returned by petrelconnection.wells). Defaults to None.

Raises
  • PythonToolException – if the parent MarkerCollection is read-only

  • ValueError – if the data input is empty

property comments#

The comments on the PetrelObject.

Returns

The comments on the PetrelObject as a string.

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 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.