DiscreteWellLog#

class cegalprizm.pythontool.DiscreteWellLog(python_petrel_welllog: DiscreteWellLogGrpc)#

A class holding information about a discrete well log.

Functions

__init__(python_petrel_welllog)

add_comment(new_comment[, overwrite])

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

as_dataframe()

The values of the log as a Pandas DataFrame

clone(name_of_clone[, copy_values, ...])

Creates a clone of the discrete well log.

get_template()

Returns the Petrel template for the object as a Template or DiscreteTemplate object

retrieve_history()

The Petrel history for the object.

retrieve_stats()

Retrieves a dictionary summarizing the statistics for the object

set_values(mds, values)

Replaces all the log samples with the supplied measured depths and values

Properties

comments

The comments on the PetrelObject.

crs_wkt

The PROJCS well known text representation of the object CRS.

discrete_codes

A dictionary of discrete codes and values

droid

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

global_well_log

The global well log this log is an instance of

missing_value

The value interpreted by Petrel as a 'missing' one

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

samples

Gets or sets the log samples in the form of a cegalprizm.pythontool.LogSamples object

template

Returns the Petrel template for the object as a string.

unit_symbol

The symbol for the unit which the values are measured in

well

The well to which this log is measured down

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.

Parameters
  • 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_dataframe() pandas.core.frame.DataFrame#

The values of the log as a Pandas DataFrame

This method is only available in CPython.

clone(name_of_clone: str, copy_values: bool = False, discrete_template: Optional[cegalprizm.pythontool.template.DiscreteTemplate] = None) cegalprizm.pythontool.welllog.DiscreteWellLog#

Creates a clone of the discrete well log.

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

A clone can be created with a DiscreteTemplate. Cloning with a discrete_template is only possible if copy_values=False. When cloning with discrete template, the clone will get the default color table of the given discrete template. If a discrete_template argument is not provided, the clone will have the same discrete template and color table as the source object.

Parameters
  • name_of_clone (str) – Petrel name of the clone

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

  • discrete_template – DiscreteTemplate to use for the clone. Defaults to None.

Returns

The clone

Return type

DiscreteWellLog

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

  • ValueError – If name_of_clone is empty or contains slashes

  • UserErrorException – If both copy_values=True and discrete_template is used as arguments. Can only clone with discrete_template if copy_values=False

  • UserErrorException – If discrete_template is not a DiscreteTemplate object

get_template() Optional[Union[cegalprizm.pythontool.template.Template, cegalprizm.pythontool.template.DiscreteTemplate]]#

Returns the Petrel template for the object as a Template or DiscreteTemplate object

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(mds: List[float], values: List[Optional[float]])#

Replaces all the log samples with the supplied measured depths and values

Parameters
  • mds – a list of measured depths, one per sample

  • values – a list of values, one per sample

Raises
  • PythonToolException – if the log is readonly

  • ValueError – if the measured depths and values are of difference lengths

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 discrete_codes: Dict[int, str]#

A dictionary of discrete codes and values

Changes to this dictionary will not be persisted or affect any Petrel objects.

Example:

mylog = petrellink.welllog['facies']
print(mylog.discrete_codes[1])
# outputs 'Fine sand'
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 global_well_log: cegalprizm.pythontool.welllog.DiscreteGlobalWellLog#

The global well log this log is an instance of

Returns

the global well log for this log

Return type

cegalprizm.pythontool.DiscreteGlobalWellLog

property missing_value: int#

The value interpreted by Petrel as a ‘missing’ one

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 samples: cegalprizm.pythontool.welllog.LogSamples#

Gets or sets the log samples in the form of a cegalprizm.pythontool.LogSamples object

Raises
  • PythonToolException – if the log is readonly

  • ValueError – if the supplied value is not a cegalprizm.pythontool.LogSamples object

property template: str#

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

property unit_symbol: None#

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

property well: Well#

The well to which this log is measured down

Returns

the well for this log

Return type

cegalprizm.pythontool.Well