maptek.labs.blasts module
An interface to create and edit data within drill and blast layers.
This includes classes for managing design databases containing drill and blast information, blast layers and blast holes.
- class blast_hole_interval(*args)
Bases:
object
Object representing a blast hole interval.
This contains information about the interval’s rock type and density, as well as its end position or end surface.
- property rock_type
- property density
- property end_position
- property end_surface
- property depth
- __init__(*args)
Default construct a blast hole interval with empty values.
- class blast_hole
Bases:
object
Object representing a blast hole.
- __init__()
Blast holes may only be read or created from a blast layer.
- property collar: vulcan.point
The collar point of the blast hole.
- property toe: vulcan.point
The toe point of the blast hole.
- property name: str
The name of the blast hole.
This is the same as the suffix if the hole is using special naming, otherwise it is a combination of the hole’s row name and suffix.
- property drill_depth: float
The drill depth of the blast hole, in metres.
This is equivalent to the difference in elevation between the collar and toe.
- property charge_depth: float
The depth of the charge for this blast hole.
A return of 0 indicates no measurement has been recorded.
- property drillrig: str
The name of the drill rig associated with the blast hole.
Note that when setting a drill rig, the rig must already exist in the blast source.
See also
- property diameter: float
The diameter of the blast hole, in metres.
This measurement is defined by the drill rig associated with the hole.
- property intervals: list[blast_hole_interval]
The list of intervals associated with this blast hole.
- class blast_layer
Bases:
object
Object representing a design layer containing blast information.
- __init__()
Blast layers may only be read or created from a blast source.
- cancel_changes()
Cancel any pending changes to the layer, and cause it NOT to save on exiting scope.
- hole_names_in_blast(blast_name: str) list[str]
Get the names of the holes belonging to a given blast.
- Parameters:
blast_name – The name of the blast to get the hole names from.
- read_blast_hole(blast_name: str, hole_name: str) blast_hole
Get an existing read-only blast hole from the layer.
- Parameters:
blast_name – The name of the blast to get the hole from.
hole_name – The name of the hole to get.
- edit_blast_hole(blast_name: str, hole_name: str) blast_hole
Get an existing editable blast hole from the layer.
- Parameters:
blast_name – The name of the blast to get the hole from.
hole_name – The name of the hole to get.
- Raises:
PermissionError – If the layer was opened in read-only mode.
- new_blast_hole(blast_name: str, hole_name: str, collar_point: vulcan.point) blast_hole
Add a new blast hole to the layer.
- Parameters:
blast_name – The name of the blast to add the hole to.
hole_name – The name to assign to the new hole.
collar_point – The collar point to assign to the new hole.
- Return type:
The newly created blast hole
,which may be modified with appropriate values.
- Raises:
PermissionError – If the layer was opened in read-only mode.
Example
>>> hole = layer.new_blast_hole("BlastName4", "BlastHole6", point(0,0,0)) >>> hole.bearing = 72 >>> hole.horizontal_dip = 84
- remove_blast_hole(blast_name: str, hole_name: str)
Remove an existing blast hole from the layer.
- Parameters:
blast_name – The name of the blast to remove the hole from.
hole_name – The name of the hole to remove.
- Raises:
PermissionError – If the layer was opened in read-only mode.
- class blast_source
Bases:
object
An interface to create and edit data within drill and blast layers.
- __init__()
Blast sources must be created or read from file using other class methods.
- classmethod read(database: str | PathLike, specifications: str | PathLike | None = None) blast_source
Opens a drill and blast database for read.
- Parameters:
database – The file path to load as a blast source.
specifications – The file path to an associated drill and blast specifications file.
- classmethod edit(database: str | PathLike, specifications: str | PathLike | None = None) blast_source
Opens a drill and blast database for editing.
- Parameters:
database – The file path to load as a blast source.
specifications – The file path to an associated drill and blast specifications file.
- classmethod create(database: str | PathLike) blast_source
Creates a new drill and blast database.
- Parameters:
database – The file path to save the blast source to. This should end with the extension ‘.dgd.isis’.
- add_drillrig(drillrig_name: str, diameter: int | float)
Add a new drill rig to the blast source.
- Parameters:
drillrig_name – The name of the new drill rig to add.
diameter – The diameter of the drill.
- property drillrigs: dict[str, float]
The drill rigs associated with this blast source. This returns a dictionary of the drill rig names and their diameters.
- read_blast_layer(layer_name: str)
Get an existing read-only blast layer from the database.
- Parameters:
layer_name – The name of the layer to get.
- Yields:
ContextManager(blast_layer)
– Yields a read-only blast_layer object
- edit_blast_layer(layer_name: str)
Get an existing editable blast layer from the database.
This layer will automatically save changes on leaving scope.
- Parameters:
layer_name – The name of the layer to get.
- Yields:
ContextManager(blast_layer)
– Yields an editable blast_layer object
- new_blast_layer(layer_name: str, description: str = 'Created via Python Script.')
Create a new blast layer in the database.
- Parameters:
- Yields:
ContextManager(blast_layer)
– Yields an editable blast_layer object
Note
See
vulcan.is_valid_layer_name()
andvulcan.get_valid_layer_name()
for layer name validation functions.