SeismicLine#
- class cegalprizm.pythontool.SeismicLine(petrel_object_link: Seismic2DGrpc)#
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, template])Creates a clone of the seismic line.
column
(j)Creates a
cegalprizm.pythontool.Chunk
with the values for the specified columncolumns
([jrange])The columns in given j-range
Returns the Petrel template for the object as a Template or DiscreteTemplate object
has_same_parent
(other)Tests whether the seismic line has the same parent collection
indices
(x, y, z)The indices of a node nearest the specified point
position
(j, k)The position of the seismic node/sample index
The Petrel history for the object.
Retrieves a dictionary summarizing the statistics for the object
Properties
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 extent of the seismic line
The path of this object in Petrel.
Returns the name of this object in Petrel
The read-only status of this object
Returns the Petrel template for the object as a string.
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.
- 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
- clone(name_of_clone: str, copy_values: bool = False, template: Optional[cegalprizm.pythontool.template.Template] = None) cegalprizm.pythontool.seismic.SeismicLine #
Creates a clone of the seismic line.
The clone is placed in the same collection as the source seismic line. 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 continuous Template. Cloning with template is only possible if copy_values=False. When cloning with template, the clone will get the default color table of the given template. If a template argument is not provided, the clone will have the same 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.
template – Template to use for the clone. Defaults to None.
- Returns
The clone
- Return type
- 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 template is used as argument when copy_values=True. Can only clone with template if copy_values=False
UserErrorException – If template is not a Template object
- column(j: int) cegalprizm.pythontool.chunk.Chunk #
Creates a
cegalprizm.pythontool.Chunk
with the values for the specified column- Parameters
j – the index in the j-direction
- Returns
A Slice containing the values for all layers
- Raises
ValueError – if the line does not have the column specified
- columns(jrange: Optional[Iterable[int]] = None) Iterable[cegalprizm.pythontool.chunk.Chunk] #
The columns in given j-range
- Parameters
jrange – an iterable (e.g. list) of j-values to generate columns for. If None, generate for all j-values.
- Yields
- A generator of column
cegalprizm.pythontool.Chunk
objects covering the jrange passed.
- A generator of column
- Raises
ValueError – if the indices are invalid.
Example:
# sets to 0 all values in the i-slices i=10 through to i=19, for col in my_prop.columns(range(10, 20)): col.set(0) # sets to 0 all values in the property for col in my_prop.columns(): col.set(0)
- 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
- has_same_parent(other: cegalprizm.pythontool.seismic.SeismicLine) bool #
Tests whether the seismic line has the same parent collection
- Parameters
other – the other seismic line
- Returns
True
if theother
object has the same parent collection- Return type
bool
- Raises
ValueError – if
other
is not a SeismicLine
- indices(x: float, y: float, z: float) cegalprizm.pythontool.primitives.Indices #
The indices of a node nearest the specified point
- Parameters
x – the x-coordinate
y – the y-coordinate
z – the z-coordinate
- Returns
A
cegalprizm.pythontool.Indices
object representing the indices of the node nearest the specified point. The i value will always be None.- Raises
ValueError – if the position is outside the seismic object
- position(j: int, k: int) cegalprizm.pythontool.primitives.Point #
The position of the seismic node/sample index
- Parameters
j – the j-index
k – the k-index (sample index in trace)
- Returns: A
cegalprizm.pythontool.Point
object representing the position of the node.
- Raises
ValueError – if the indices are outside the seismic 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
- 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 extent of the seismic line
Seismic Lines are indexed by j and k. i will always be None.
- 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 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