maptek.drillhole_database

An interface to create and edit data within drillhole databases.


read(cls, filename) -> drillhole_database

Loads an existing drillhole database from file in read-only mode.

Parameters - The filename of the database to load.

Returns the loaded database.

Raises OSError If the database fails to load.

edit(cls, filename) -> drillhole_database

Loads an existing drillhole database from file in edit mode.

Parameters - The filename of the database to load.

Returns the loaded database.

Raises OSError If the database fails to load.

create(cls, filename, design) -> drillhole_database

Creates a new drillhole database. Optionally uses an existing Isis design (.dsf). If no design is given, the database is created with collar, survey and geological tables.

Parameters - The filename for the new database, the design to construct the database from.

Note:  The design can be either an isis_design object or a file path to a (.dsf) file.

Returns the newly created database.

Raises TypeError if design is not an isis_design or the path to the design.

is_read_only()

Checks whether the database is open in read-only mode.

Returns bool: True if the database is open in read-only mode, False otherwise.

add_drillhole()

Adds a new drillhole to the database, using the existing scheme.

Parameters - The name (HoleId) to assign to the hole.

Returns the newly created drillhole.

delete_drillhole()

Removes a drillhole from the database.

Parameters - The name (HoleId) of the drillhole to delete.

Returns bool: True if successful; false otherwise.

drillhole_ids()

Gets the list of drillholes in the database.

Returns the names (HoleIds) of all the drillholes in the database.

get_drillhole()

Gets a drillhole.

Parameters - The name (HoleId) of the hole to get.

Returns the requested drillhole.

database_table_names()

The names of all tables in the database.

list_fields()

Gets the list of fields in a table.

Parameters - The name of the table to retrieve the fields from.

Returns the names of the fields.

interval_table_names()

The names of all interval tables in the database.

tables()

The list of tables in the database and their associated fields.

add_assay_table()

Adds an Assay table to a newly created database.

This table initially contains only 'FROM' and 'TO' fields.

Note:  This is only callable on a database which has not yet been populated with drillholes.

Parameters - The name to assign to the table.

See also:

  • add_text_field_to_table : Add a new text field to the table.

  • add_float_field_to_table : Add a new float field to the table.

  • add_int_field_to_table : Add a new integer field to the table.

add_geology_table()

Adds a Geology table to a newly created database.

This table initially contains only 'FROM' and 'TO' fields.

Note:  This is only callable on a database which has not yet been populated with drillholes.

Parameters - The name to assign to the table.

See also:

  • add_text_field_to_table : Add a new text field to the table.

  • add_float_field_to_table : Add a new float field to the table.

  • add_int_field_to_table : Add a new integer field to the table.

add_analytical_table()

Adds an Analytical table to a newly created database.

This table initially contains only 'FROM' and 'TO' fields.

Note:  This is only callable on a database which has not yet been populated with drillholes.

Parameters - The name to assign to the table.

See also:

  • add_text_field_to_table : Add a new text field to the table.

  • add_float_field_to_table : Add a new float field to the table.

  • add_int_field_to_table : Add a new integer field to the table.

add_text_field_to_table()

Adds a new text field to an existing interval table.

Parameters

  • table_name : str - The name of the table to add the field to.

  • field_name : str - The name to assign to the field.

  • field_length : int (optional) - The number of characters to allow in the field.

  • description : str (optional) - The description to assign to the field.

add_float_field_to_table()

Adds a new float field to an existing interval table.

Parameters

  • table_name : str - The name of the table to add the field to.

  • field_name : str - The name to assign to the field.

  • field_length : int (optional) - The number of characters to allow in the field.

  • description : str (optional) - The description to assign to the field.

add_int_field_to_table()

Adds a new integer field to an existing interval table.

Parameters

  • table_name : str - The name of the table to add the field to.

  • field_name : str - The name to assign to the field.

  • field_length : int (optional) - The number of characters to allow in the field.

  • description : str (optional) - The description to assign to the field.

save_drillhole()

Saves a drillhole after any data changes have been made.

Important:  Any changes will NOT be saved back to the database unless this is called.

Parameters - The drillhole with changes to save.

Returns bool - True if the drillhole is successfully saved; false otherwise.

collar_fields()

Returns a list of the collar fields in the database.

collar_scheme()

Returns the scheme of the collar table.

collar_scheme()

Sets the scheme for the collar table.

drillhole_count()

Returns the number of drillholes in the database.