resqpy.well.DeviationSurvey
- class resqpy.well.DeviationSurvey(parent_model, uuid=None, title=None, represented_interp=None, md_datum=None, md_uom='m', angle_uom='dega', measured_depths=None, azimuths=None, inclinations=None, station_count=None, first_station=None, is_final=False, originator=None, extra_metadata=None)
Bases:
BaseResqpyClass for RESQML wellbore deviation survey.
RESQML documentation:
Specifies the station data from a deviation survey.
The deviation survey does not provide a complete specification of the geometry of a wellbore trajectory. Although a minimum-curvature algorithm is used in most cases, the implementation varies sufficiently that no single algorithmic specification is available as a data transfer standard.
Instead, the geometry of a RESQML wellbore trajectory is represented by a parametric line, parameterized by the MD.
CRS and units of measure do not need to be consistent with the CRS and units of measure for wellbore trajectory representation.
Public Data Attributes:
resqml_typeInherited from
BaseResqpyDefinition of which RESQML object the class represents.
Standard part name corresponding to self.uuid.
XML node corresponding to self.uuid.
Citation block title equivalent to self.title.
Commonly Used Methods:
__init__(parent_model[, uuid, title, ...])Load or create a DeviationSurvey object.
Methods:
from_data_frame(parent_model, data_frame[, ...])Load MD, aximuth & inclination data from a pandas data frame.
from_ascii_file(parent_model, ...[, ...])Load MD, aximuth & inclination data from an ascii deviation survey file.
create_xml([ext_uuid, md_datum_root, ...])Creates a deviation survey representation xml element from this DeviationSurvey object.
write_hdf5([file_name, mode])Create or append to an hdf5 file, writing datasets for the measured depths, azimuths, and inclinations.
Inherited from
BaseResqpy__init__(model[, uuid, title, originator, ...])Load an existing resqml object, or create new.
Look for an equivalent existing RESQML object and modify the uuid of this object if found.
create_xml([title, originator, ...])Write citation block to XML.
append_extra_metadata(meta_dict)Append a given dictionary of metadata to the existing metadata.
__eq__(other)Implements equals operator; uses is_equivalent() otherwise compares class type and uuid.
__ne__(other)Implements not equal operator.
__repr__()String representation.
- __init__(parent_model, uuid=None, title=None, represented_interp=None, md_datum=None, md_uom='m', angle_uom='dega', measured_depths=None, azimuths=None, inclinations=None, station_count=None, first_station=None, is_final=False, originator=None, extra_metadata=None)[source]
Load or create a DeviationSurvey object.
If uuid is given, loads from XML. Else, create new. If loading from disk, other parameters will be overwritten.
- Parameters:
parent_model (
model.Model) – the model which the new survey belongs touuid (
uuid.UUID) – If given, loads from disk. Else, creates new.title (
str) – Citation title – often the well namerepresented_interp (
WellboreInterpretation, optional) – if present, is noted as the wellbore interpretation object which this deviation survey relates tomd_datum (
MdDatum) – the datum that the depths for this survey are measured frommd_uom (
string, default'm') – a resqml length unit of measure applicable to the measured depths; should be ‘m’ or ‘ft’angle_uom (
string) – a resqml angle unit; should be ‘dega’ or ‘rad’measured_depths (
np.array) – 1d arrayazimuths (
np.array) – 1d arrayinclinations (
np.array) – 1d arraystation_count (
int) – length of measured_depths, azimuths & inclinationsfirst_station (
tuple) – (x, y, z) of first point in survey, in crs for md datumis_final (
bool) – whether survey is a finalised deviation surveyoriginator (
str) – name of authorextra_metadata (
dict, optional) – extra metadata key, value pairs
- Returns:
DeviationSurvey
Notes
this method does not create an xml node, nor write hdf5 arrays
- append_extra_metadata(meta_dict)
Append a given dictionary of metadata to the existing metadata.
- property citation_title
Citation block title equivalent to self.title.
- create_xml(ext_uuid=None, md_datum_root=None, md_datum_xyz=None, add_as_part=True, add_relationships=True, title=None, originator=None)[source]
Creates a deviation survey representation xml element from this DeviationSurvey object.
- Parameters:
ext_uuid (
uuid.UUID) – the uuid of the hdf5 external part holding the deviation survey arraysmd_datum_root – the root xml node for the measured depth datum that the deviation survey depths are based on
md_datum_xyz – TODO: document this
add_as_part (
boolean, defaultTrue) – if True, the newly created xml node is added as a part in the modeladd_relationships (
boolean, defaultTrue) – if True, a relationship xml part is created relating the new deviation survey part to the measured depth datum parttitle (
string) – used as the citation Title text; should usually refer to the well name in a human readable wayoriginator (
string, optional) – the name of the human being who created the deviation survey part; default is to use the login name
- Returns:
the newly created deviation survey xml node
- classmethod from_ascii_file(parent_model, deviation_survey_file, comment_character='#', space_separated_instead_of_csv=False, md_col='MD', azimuth_col='AZIM_GN', inclination_col='INCL', x_col='X', y_col='Y', z_col='Z', md_uom='m', angle_uom='dega', md_datum=None, title=None, represented_interp=None)[source]
Load MD, aximuth & inclination data from an ascii deviation survey file.
- Parameters:
parent_model (
model.Model) – the parent resqml modeldeviation_survey_file (
string) – the filename of an ascii file holding the deviation survey datacomment_character (
string) – the character to be treated as introducing commentsspace_separated_instead_of_csv (
boolea, defaultFalse) – if False, csv format expected; if True, columns are expected to be seperated by white spacemd_col (
string, default'MD') – the name of the column holding measured depth valuesazimuth_col (
string, default'AZIM_GN') – the name of the column holding azimuth values relative to the north direction (+ve y axis) of the coordinate reference systeminclination_col (
string, default'INCL') – the name of the column holding inclination valuesx_col (
string, default'X') – the name of the column holding an x value in the first rowy_col (
string, default'Y') – the name of the column holding an Y value in the first rowz_col (
string, default'Z') – the name of the column holding an z value in the first rowmd_uom (
string, default'm') – a resqml length unit of measure applicable to the measured depths; should be ‘m’ or ‘ft’angle_uom (
string, default'dega') – a resqml angle unit of measure applicable to both the azimuth and inclination datamd_datum (
MdDatum object) – the datum that the depths for this survey are measured fromtitle (
string) – the citation title for the deviation survey – often the well namerepresented_interp (
WellboreInterpretation, optional) – if present, is noted as the wellbore interpretation object which this deviation survey relates to
- Returns:
DeviationSurvey
Note
The X, Y & Z columns are only used to set the first station location (from the first row)
- classmethod from_data_frame(parent_model, data_frame, md_datum=None, md_col='MD', azimuth_col='AZIM_GN', inclination_col='INCL', x_col='X', y_col='Y', z_col='Z', md_uom='m', angle_uom='dega', title=None, represented_interp=None)[source]
Load MD, aximuth & inclination data from a pandas data frame.
- Parameters:
parent_model (
model.Model) – the parent resqml modeldata_frame – a pandas dataframe holding the deviation survey data
md_datum (
MdDatum object) – the datum that the depths for this survey are measured frommd_col (
string, default'MD') – the name of the column holding measured depth valuesazimuth_col (
string, default'AZIM_GN') – the name of the column holding azimuth values relative to the north direction (+ve y axis) of the coordinate reference systeminclination_col (
string, default'INCL') – the name of the column holding inclination valuesx_col (
string, default'X') – the name of the column holding an x value in the first rowy_col (
string, default'Y') – the name of the column holding an Y value in the first rowz_col (
string, default'Z') – the name of the column holding an z value in the first rowmd_uom (
string, default'm') – a resqml length unit of measure applicable to the measured depths; should be ‘m’ or ‘ft’angle_uom (
string, default'dega') – a resqml angle unit of measure applicable to both the azimuth and inclination datatitle (
string) – the citation title for the deviation survey – often the well namerepresented_interp (
WellboreInterpretation, optional) – if present, is noted as the wellbore interpretation object which this deviation survey relates to
- Returns:
DeviationSurvey
Note
The X, Y & Z columns are only used to set the first station location (from the first row)
- property part
Standard part name corresponding to self.uuid.
- property root
XML node corresponding to self.uuid.
- try_reuse()
Look for an equivalent existing RESQML object and modify the uuid of this object if found.
- Returns:
boolean – True if an equivalent object was found, False if not
Note
by design this method may change this object’s uuid as a side effect
- write_hdf5(file_name=None, mode='a')[source]
Create or append to an hdf5 file, writing datasets for the measured depths, azimuths, and inclinations.
- title
Citation title
- originator
Creator of object. By default, user id.
- uuid
Unique identifier