maptek.vulcan.drillholes module
An interface to create and edit data within drillhole tables.
This includes classes for managing the database itself, the holes within the database, as well as tables, fields and intervals associated with individual drillholes.
- class collar_scheme(db_table_name: str, holeid_field: str, easting_field: str, northing_field: str, elevation_field: str, total_depth_field: str | None = None)
Bases:
object
Class containing information about the collar scheme, including the database table name of the collar table, as well as the names of the HoleId, Easting, Northing, Elevation and Total Depth fields.
- __init__(db_table_name: str, holeid_field: str, easting_field: str, northing_field: str, elevation_field: str, total_depth_field: str | None = None)
Class containing information about the collar scheme, including the database table name of the collar table, as well as the names of the HoleId, Easting, Northing, Elevation and Total Depth fields.
- Parameters:
db_table_name (
str
) – The name for the collar table in the database.holeid_field (
str
) – The name for the hole ID field in the collar table.easting_field (
str
) – The name for the Easting (X) field in the collar table.northing_field – The name for the Northing (Y) field in the collar table.
elevation_field – The name for the elevation (Z) field in the collar table.
total_depth_field (
str
, optional) – The name for the table depth field in the collar table.
- property db_table_name
- property holeid_field
- property easting_field
- property northing_field
- property elevation_field
- property total_depth_field
- class survey_scheme(db_table_name: str, bearing_field: str, inclination_field: str, depth_field: str)
Bases:
object
Class containing information about the survey scheme, including the database table name of the survey table, as well as the names of the Bearing, Inclination, and Depth fields.
- __init__(db_table_name: str, bearing_field: str, inclination_field: str, depth_field: str)
Class containing information about the survey scheme, including the database table name of the survey table, as well as the names of the HoleId, Easting, Northing, Elevation and Total Depth fields.
- Parameters:
- property db_table_name
- property bearing_field
- property inclination_field
- property depth_field
- class interval_scheme(bearing_field: str, inclination_field: str, depth_field: str)
Bases:
object
Class containing information about a basic interval scheme, including the names of the From, To, and Thickness fields.
- __init__(bearing_field: str, inclination_field: str, depth_field: str)
Class containing information about a basic interval scheme, including the names of the From, To, and Thickness fields.
- property from_field
- property to_field
- property thickness_field
- class drillhole_database(other)
Bases:
object
An interface to create and edit data within drillhole databases.
- __init__(other)
Exposes an interface to edit data within drillhole databases.
- classmethod read(filename: str | PathLike) Self
Loads an existing drillhole database from file in read-only mode.
- Parameters:
filename (
str
oros.PathLike
) – The filename of the database to load.- Returns:
The loaded database.
- Return type:
- Raises:
OSError – If the database fails to load.
- classmethod edit(filename: str | PathLike) Self
Loads an existing drillhole database from file in edit mode.
- Parameters:
filename (
str
oros.PathLike
) – The filename of the database to load.- Returns:
The loaded database.
- Return type:
- Raises:
OSError – If the database fails to load.
- classmethod create(filename: str | PathLike, design: isis_design | str | PathLike | None = None, *, collar_name: str = 'COLLAR', survey_name: str = 'SURVEY') Self
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:
filename (
str
oros.PathLike
) – The filename for the new database.design (
isis_design
orstr
oros.PathLike
, optional) – The design to construct the database from. This can be either an isis_design object or a filepath to a .dsf file.
- Returns:
The newly created database.
- Return type:
- Raises:
TypeError – If design is not an isis_design or the path to the design.
- is_read_only() bool
Checks whether the database is open in read-only mode.
- Returns:
True if the database is open in read-only mode, False otherwise.
- Return type:
- new_hole(hole_name: str, ignore_no_interval_tables: bool = False) Iterator[drillhole]
Adds a new drillhole to the database, using the existing scheme.
- copy_hole(hole_to_clone: str, new_hole_name: str, ignore_no_interval_tables: bool = False) Iterator[drillhole]
Create a copy of a drillhole under a different name.
This function is intended for use with a context manager; where the drillhole will automatically save when exiting context.
- Parameters:
- Returns:
The newly created drillhole.
- Return type:
- hole_ids() list[str]
Gets the list of drillholes in the database.
- Returns:
The names (HoleIds) of all the drillholes in the database.
- Return type:
list[str]
- read_holes()
- edit_holes()
- read_hole(hole_name: str, ignore_no_interval_tables: bool = False) Iterator[drillhole]
Gets a read-only drillhole.
Intended for use in a ‘with’ block:
>>> with database.read_drillhole("HoleName") as hole: >>> hole.raw_collar (27562.1, 2391.6, 875.4)
- edit_hole(hole_name: str) Iterator[drillhole]
Gets an editable drillhole.
Intended for use in a ‘with’ block:
>>> with database.edit_drillhole("HoleName") as hole: >>> hole.raw_collar = (1, 2, 3)
The hole will automatically save changes when exiting scope, unless an error is raised.
- Parameters:
hole_name – The name (HoleId) of the hole to get.
- Yields:
drillhole
– The requested drillhole.- Raises:
PermissionError – If the database is open in read-only mode.
- list_fields(table_name) list[str]
Gets the list of fields in a table.
- Parameters:
table_name (
str
) – The name of the table to retrieve the fields from.- Returns:
The names of the fields.
- Return type:
list[str]
- property tables: list[table_information]
The list of tables in the database and their associated fields.
- get_table_interval_scheme(table_name: str) interval_scheme
Gets the interval scheme information for a table (interval table only). result will be empty if not valid.
- Parameters:
table_name (
str
) – The name of the interval table.- Returns:
interval_scheme object with the from/to/thickness fields if set.
All fields will be blank in invalid tables.
- set_table_for_interval_reading(table_name: str, from_field: str | None, to_field: str, thickness_field: str | None = None) bool
Sets up a non-interval table for reading as an interval table by defining at least the ‘TO’ field for depth calculations.
- Parameters:
table_name (
str
) – The name of the non-interval table.from_field (
str|None
) – The field that defines the FROM or top of interval. None if not applicable.to_field (
str
) – The field that defines the TO or bottom of the intervalthickness_field (
str|None (Optional)
) – The thickness field, describing the total thickness for the interval.
- Return type:
True if successfully set.
See also
database_table_names
The list of all tables in the database.
interval_table_names
The list of all interval tables in the database.
- add_assay_table(table_name: str)
Adds an Assay table to a newly created database.
This table initially contains only ‘FROM’ and ‘TO’ fields.
This is only callable on a database which has not yet been populated with drillholes.
- Parameters:
table_name (
str
) – 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(table_name: str)
Adds a Geology table to a newly created database.
This table initially contains only ‘FROM’ and ‘TO’ fields.
This is only callable on a database which has not yet been populated with drillholes.
- Parameters:
table_name (
str
) – 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(table_name: str)
Adds an Analytical table to a newly created database.
This table initially contains only ‘FROM’ and ‘TO’ fields.
This is only callable on a database which has not yet been populated with drillholes.
- Parameters:
table_name (
str
) – 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_table(table_name: str, from_field: str | None, to_field: str, description: str | None)
Adds an interval table to a newly created database.
This table requires at least the TO field to be assigned.
This is only callable on a database which has not yet been populated with drillholes.
- Parameters:
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(table_name: str, field_name: str, field_length: int = 10, description: str = 'Created via Python script.')
Adds a new text field to an existing interval table.
- add_float_field_to_table(table_name: str, field_name: str, field_length: int = 10, decimals: int = 3, description: str = 'Created via Python script.')
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.decimals (
int
, optional) – The number of decimal places to display in the field.description (
str
, optional) – The description to assign to the field.
- add_int_field_to_table(table_name: str, field_name: str, field_length: int = 10, description: str = 'Created via Python script.')
Adds a new integer field to an existing interval table.
- save_hole(drillhole: drillhole) bool
Saves a drillhole after any data changes have been made. Any changes will NOT be saved back to the database unless either this is called.
Note this is called automatically when exiting drillhole context managers if no exceptions are raised.
- property collar_scheme: collar_scheme
Returns the scheme of the collar table.
- property survey_scheme: survey_scheme
Returns the scheme of the survey table.
- class table_information(database, name)
Bases:
object
Class representing the mapping of fields to tables in the database.
- class drillhole(drillhole)
Bases:
object
Class representing a single drillhole object within a database.
All drillholes that originate from the same database will have the same tables and fields, but have no restrictions on containing the same intervals.
- get_interval_table(table_name: str) drillhole_table
Get an interval table from the drillhole.
- Parameters:
table_name – The name of the table to get.
- Raises:
IndexError – If table_name is not an existing table.
- property raw_collar: point
The raw collar of the drillhole.
Note that this value is not adjusted for any coordinate systems applied to the hole.
- point_at_depth(depth: float) tuple[float, float, float]
Gets the coordinates of the drillhole at a given depth.
- class drillhole_table(other)
Bases:
object
Class representing a table in a drillhole_database which contains interval data.
- get_interval(index: int) interval
Gets an interval from the table.
- Parameters:
index (
int
) – The index of the interval to get.- Returns:
The interval.
- Return type:
- Raises:
IndexError – If the index is less than 0 or greater than the number of intervals.
- append_interval() interval
Adds a new interval with the appropriate empty fields to the interval table.
- Returns:
The newly added interval.
- Return type:
- remove_interval(index: int)
Removes an interval from the table. Note that this dynamically updates the indexes of all other intervals in the table.
Therefore it is not possible to do something like
>>> for i in range(0, table.interval_count): ... table.remove_interval(i)
Instead, this can be achieved by doing
>>> for _ in range(0, table.interval_count): ... table.remove_interval(0)
- Parameters:
index (
int
) – The index of the interval to remove.- Raises:
IndexError – If the given index is not a valid interval index.
- get_field_values(field_name: str) list[str] | list[float]
Gets the list of values in a field for all intervals.
- Parameters:
field_name (
str
) – The name of the field to get values from.- Returns:
The values in the field for all intervals.
- Return type:
list[str]
orlist[float]
- class interval
Bases:
object
Class representing a region between two depths in a drillhole.
- set_name(interval_name)
- __getitem__(field_name)
Accesses interval field values using the index operator.
>>> from_value = interval["FROM"]
- __setitem__(field_name, value)
Sets interval field values using the index operator.
>>> interval["FROM"] = 34.67