resqpy.well.MdDatum

class resqpy.well.MdDatum(parent_model, uuid=None, crs_uuid=None, location=None, md_reference='mean sea level', title=None, originator=None, extra_metadata=None)

Bases: BaseResqpy

Class for RESQML measured depth datum.

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.

Methods:

__init__(parent_model[, uuid, crs_uuid, ...])

Initialises a new MdDatum object.

extract_crs_uuid()

Returns uuid for coordinate reference system, as stored in reference node of this md datum's xml tree.

create_part()

Creates xml for this md datum object and adds to parent model as a part; returns root node for part.

create_xml([add_as_part, add_relationships, ...])

Creates xml for a measured depth datum element; crs node must already exist; optionally adds as part.

is_equivalent(other)

Implements equals operator, comparing metadata items deemed significant.

Inherited from BaseResqpy

__init__(parent_model[, uuid, crs_uuid, ...])

Initialises a new MdDatum object.

try_reuse()

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

create_xml([add_as_part, add_relationships, ...])

Creates xml for a measured depth datum element; crs node must already exist; optionally adds as part.

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, crs_uuid=None, location=None, md_reference='mean sea level', title=None, originator=None, extra_metadata=None)[source]

Initialises a new MdDatum object.

Parameters
  • parent_model (model.Model object) – the model which the new md datum belongs to

  • uuid – If not None, load from existing object. Else, create new.

  • crs_uuid (uuid.UUID) – required if initialising from values

  • location – (triple float): the x, y, z location of the new measured depth datum; ignored if uuid is not None

  • md_reference (string) – human readable resqml standard string indicating the real world nature of the datum, eg. ‘kelly bushing’; the full list of options is available as the global variable valid_md_reference_list in this module; ignored if uuid is not None

  • title (str, optional) – the citation title to use for a new datum; ignored if uuid is not None

  • originator (str, optional) – the name of the person creating the datum, defaults to login id; ignored if uuid is not None

  • extra_metadata (dict, optional) – string key, value pairs to add as extra metadata for the datum; ignored if uuid is not None

Returns

the newly instantiated measured depth datum object

Note

this function does not create an xml node for the md datum; call the create_xml() method afterwards if initialising from data other than an existing RESQML object

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_part()[source]

Creates xml for this md datum object and adds to parent model as a part; returns root node for part.

create_xml(add_as_part=True, add_relationships=True, title=None, originator=None)[source]

Creates xml for a measured depth datum element; crs node must already exist; optionally adds as part.

Parameters
  • 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 md datum part to the crs

  • title (string) – used as the citation Title text for the new md datum node

  • originator (string, optional) – the name of the human being who created the md datum part; default is to use the login name

Returns

the newly created measured depth datum xml node

extract_crs_uuid()[source]

Returns uuid for coordinate reference system, as stored in reference node of this md datum’s xml tree.

is_equivalent(other)[source]

Implements equals operator, comparing metadata items deemed significant.

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

title

Citation title

originator

Creator of object. By default, user id.

uuid

Unique identifier