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: BaseResqpy

Class 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_type

Inherited from BaseResqpy

resqml_type

part

Standard part name corresponding to self.uuid.

root

XML node corresponding to self.uuid.

citation_title

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__(parent_model[, uuid, title, ...])

Load or create a DeviationSurvey object.

try_reuse()

Look for an equivalent existing RESQML object and modify the uuid of this object if found.

create_xml([ext_uuid, md_datum_root, ...])

Creates a deviation survey representation xml element from this DeviationSurvey object.

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 to

  • uuid (uuid.UUID) – If given, loads from disk. Else, creates new.

  • title (str) – Citation title – often the well name

  • represented_interp (WellboreInterpretation, optional) – if present, is noted as the wellbore interpretation object which this deviation survey relates to

  • md_datum (MdDatum) – the datum that the depths for this survey are measured from

  • md_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 array

  • azimuths (np.array) – 1d array

  • inclinations (np.array) – 1d array

  • station_count (int) – length of measured_depths, azimuths & inclinations

  • first_station (tuple) – (x, y, z) of first point in survey, in crs for md datum

  • is_final (bool) – whether survey is a finalised deviation survey

  • originator (str) – name of author

  • extra_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 arrays

  • md_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, default True) – if True, the newly created xml node is added as a part in the model

  • add_relationships (boolean, default True) – if True, a relationship xml part is created relating the new deviation survey part to the measured depth datum part

  • title (string) – used as the citation Title text; should usually refer to the well name in a human readable way

  • originator (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.

qrguments:

parent_model (model.Model): the parent resqml model deviation_survey_file (string): the filename of an ascii file holding the deviation survey data comment_character (string): the character to be treated as introducing comments space_separated_instead_of_csv (boolea, default False): if False, csv format expected;

if True, columns are expected to be seperated by white space

md_col (string, default ‘MD’): the name of the column holding measured depth values azimuth_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 system

inclination_col (string, default ‘INCL’): the name of the column holding inclination values x_col (string, default ‘X’): the name of the column holding an x value in the first row y_col (string, default ‘Y’): the name of the column holding an Y value in the first row z_col (string, default ‘Z’): the name of the column holding an z value in the first row md_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 data

md_datum (MdDatum object): the datum that the depths for this survey are measured from title (string): the citation title for the deviation survey – often the well name represented_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 model

  • data_frame – a pandas dataframe holding the deviation survey data

  • md_datum (MdDatum object) – the datum that the depths for this survey are measured from

  • md_col (string, default 'MD') – the name of the column holding measured depth values

  • azimuth_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 system

  • inclination_col (string, default 'INCL') – the name of the column holding inclination values

  • x_col (string, default 'X') – the name of the column holding an x value in the first row

  • y_col (string, default 'Y') – the name of the column holding an Y value in the first row

  • z_col (string, default 'Z') – the name of the column holding an z value in the first row

  • md_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 data

  • title (string) – the citation title for the deviation survey – often the well name

  • represented_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