Skip to content

Drillholes🍋

Drillholes 🍋

Bases: GeoRefObject

Object representing a 3D group of drillhole. Each drillhole is identified by a unique holeid.

Parameters:

Name Type Description Default
name str

object name.

required
xyz Optional[Data]

geometry data, respectively X, Y and Z.

None
holeid Optional[Data]

unique identifier for each drillhole.

None
start Optional[Data]

starting depth of edges. Sorted by ascending holeid and descending z.

None
end Optional[Data]

ending depth of edges. Sorted by ascending holeid and descending z.

None

Raises:

Type Description
ValueError
  • Holeid is not defined at all points.
  • Holeid are not grouped.
  • Start is defined but not end or vice-versa.
  • Start greater than end when provided.
  • Start or end values are not sorted.

Example

import geolime as geo
import numpy as np
import pandas as pd
hid = np.array(
    ["A", "A", "C", "F", "A", "B", "C", "A", "E", "D", "B", "C", "E"]
)
xyz = np.array([
    [0,   0,   2,   5,   0,   1,   2,   0,   4,   3,   1,   2,   4],  # noqa
    [0,   0,   2,   5,   0,   1,   2,   0,   4,   3,   1,   2,   4],  # noqa
    [0,  -2,  -4,   1,  -5,   0,  -3,  -3,  -2,   2,  -3,  -2,   0]   # noqa
])
df = pd.DataFrame({
    geo.Attribute.HOLEID: hid,
    geo.Coord.X: xyz[0],
    geo.Coord.Y: xyz[1],
    geo.Coord.Z: xyz[2]
})
df.sort_values([geo.Attribute.HOLEID, geo.Coord.Z], ascending=[True, False], inplace=True)

dh = geo.Drillholes("test", df[['X', 'Y', 'Z']].to_numpy(), df.HOLEID)

aggregate(properties=None, agg_methods=[AggregationMethod.SUM, AggregationMethod.MIN, AggregationMethod.MAX, AggregationMethod.MEAN, AggregationMethod.FIRST]) 🍋

Return the object data grouped by location (X, Y) and hole ID.

Parameters:

Name Type Description Default
properties Optional[List[str]]

list of properties name to transfer to the GIS Object. Setting to None or empty list will select all existing properties.

None
agg_methods List[Union[AggregationMethod, Callable]]

aggregation data methods. See pandas.DataFrame.groupby to find out supported methods.

[SUM, MIN, MAX, MEAN, FIRST]

Returns:

Type Description
DataFrame

DataFrame of XY coordinates with aggregated data.

Raises:

Type Description
ValueError
  • No aggregation method is provided.
  • 'X', 'Y' or 'HOLEID' are part of the properties.
AttributeError

One of the aggregation methods is not supported.

Example

import geolime as geo

dh = geo.datasets.load("rocklea_dome/dh_hyper.geo")
dh.aggregate(properties=["Fe_pct"], agg_methods=["first"])
Output
    HOLEID         X          Y      Z  Fe_pct_first
0    RKC278  548001.3  7474002.1  453.5          10.0
1    RKC279  547804.6  7474004.5  453.4          11.0
2    RKC280  547310.8  7474002.2  453.8          19.0
3    RKC281  547100.8  7474003.4  453.4           7.0
4    RKC282  547199.0  7474801.2  456.0           NaN
..      ...       ...        ...    ...           ...
187  RKC482  547748.8  7475997.8  465.5          11.0
188  RKC483  547825.6  7473716.0  452.7           8.0
189  RKC484  547866.5  7473820.9  452.4           8.0
190  RKC485  547913.3  7473917.2  452.4          12.0
191  RKD015  547905.0  7476800.0  470.0           NaN

[192 rows x 5 columns]

collar_coords() 🍋

Return only coordinates of collars, being top location of each drillhole.

Returns:

Type Description
ndarray

XYZ coordinates of collars.

Example

import geolime as geo

dh = geo.datasets.load("rocklea_dome/dh_hyper.geo")
dh.collar_coords()
Output
array([[5.4800130e+05, 7.4740021e+06, 4.5350000e+02],
    [5.4780460e+05, 7.4740045e+06, 4.5340000e+02],
    [5.4731080e+05, 7.4740022e+06, 4.5380000e+02],
    ...,
    [5.4786650e+05, 7.4738209e+06, 4.5240000e+02],
    [5.4791330e+05, 7.4739172e+06, 4.5240000e+02],
    [5.4790500e+05, 7.4768000e+06, 4.7000000e+02]])

coords(region=None) 🍋

Provided for convenience, return the composites mid-points (see mid_coords()).

Parameters:

Name Type Description Default
region Optional[str]

Object region or condition to select data from.

None

Returns:

Type Description
ndarray

XYZ of the mid-points of each composite.

Example

import geolime as geo

dh = geo.datasets.load("rocklea_dome/dh_hyper.geo")
dh.coords()
Output
array([[5.4800130e+05, 7.4740021e+06, 4.5300000e+02],
    [5.4800130e+05, 7.4740021e+06, 4.5200000e+02],
    [5.4800130e+05, 7.4740021e+06, 4.5100000e+02],
    ...,
    [5.4790500e+05, 7.4768000e+06, 4.6950000e+02],
    [5.4790500e+05, 7.4768000e+06, 4.6950000e+02],
    [5.4790500e+05, 7.4768000e+06, 4.6950000e+02]])

delete_composites(region) 🍋

Delete composites in region.

Parameters:

Name Type Description Default
region str

Region to select composites.

required

delete_holes(region, method=RegionAggregationMethod.ALL) 🍋

Delete Holes in region.

Selections are any or all composites from a hole in a region.

Parameters:

Name Type Description Default
region str

Region to select holes.

required
method RegionAggregationMethod

Method of selection of holes, might be any composite or all composites.

ALL

Raises:

Type Description
ValueError
  • A dynamic expression is provided instead of a region.
  • Region does not exist.
  • Selection method is not supported.

element_count() 🍋

Return the number of drillholes in the Drillholes group.

Returns:

Type Description
int

Number of drillholes.

Example

import geolime as geo

dh = geo.datasets.load("rocklea_dome/dh_hyper.geo")
dh.element_count()
Output
7134

holeids() 🍋

Return the holeids present in this Drillholes object

Returns:

Type Description
ndarray

List of Hold ID names.

Example

import geolime as geo

dh = geo.datasets.load("rocklea_dome/dh_hyper.geo")
dh.holeids()
Output
array(['RKC278', 'RKC279', 'RKC280', 'RKC281', 'RKC282', 'RKC283',
    'RKC284', 'RKC285', 'RKC286', 'RKC287', 'RKC288', 'RKC289',
    'RKC290', 'RKC291', 'RKC292', 'RKC293', 'RKC294', 'RKC295',
    'RKC296', 'RKC297', 'RKC298', 'RKC299', 'RKC300', 'RKC301',
    ...,
    'RKC469', 'RKC470', 'RKC471', 'RKC472', 'RKC473', 'RKC474',
    'RKC475', 'RKC476', 'RKC477', 'RKC478', 'RKC479', 'RKC480',
    'RKC481', 'RKC482', 'RKC483', 'RKC484', 'RKC485', 'RKD015'],
    dtype=object)

keep_composites(region) 🍋

Keep composites in region.

Parameters:

Name Type Description Default
region str

Region to select composites.

required

keep_holes(region, method=RegionAggregationMethod.ALL) 🍋

Keep Holes in region.

Selections are any or all composites from a hole in a region.

Parameters:

Name Type Description Default
region str

Region to select holes.

required
method RegionAggregationMethod

Method of selection of holes, might be any composite or all composites.

ALL

Raises:

Type Description
ValueError
  • A dynamic expression is provided instead of a region.
  • Region does not exist.
  • Selection method is not supported.

mid_coords(region=None) 🍋

Return Mid-Points of each composite.

Parameters:

Name Type Description Default
region Optional[str]

Object region or condition to select data from.

None

Returns:

Type Description
ndarray

Barycentric coordinates.

Example

import geolime as geo

dh = geo.datasets.load("rocklea_dome/dh_hyper.geo")
dh.mid_coords()
Output
array([[5.4800130e+05, 7.4740021e+06, 4.5300000e+02],
    [5.4800130e+05, 7.4740021e+06, 4.5200000e+02],
    [5.4800130e+05, 7.4740021e+06, 4.5100000e+02],
    ...,
    [5.4790500e+05, 7.4768000e+06, 4.7000000e+02],
    [5.4790500e+05, 7.4768000e+06, 4.7000000e+02],
    [5.4790500e+05, 7.4768000e+06, 4.6950000e+02]])

node_coords(region=None) 🍋

Return the object node coordinates, respectively X, Y, and Z as data arrays. Node coordinates correspond to beginning and end of each composite.

Parameters:

Name Type Description Default
region Optional[str]

Object region to select data from.

None

Returns:

Type Description
ndarray

XYZ coordinates.

Example

import geolime as geo

dh = geo.datasets.load("rocklea_dome/dh_hyper.geo")
dh.node_coords()
Output
array([[5.4800130e+05, 7.4740021e+06, 4.5350000e+02],
    [5.4800130e+05, 7.4740021e+06, 4.5250000e+02],
    [5.4800130e+05, 7.4740021e+06, 4.5150000e+02],
    ...,
    [5.4790500e+05, 7.4768000e+06, 4.7000000e+02],
    [5.4790500e+05, 7.4768000e+06, 4.7000000e+02],
    [5.4790500e+05, 7.4768000e+06, 4.6900000e+02]])

sample_count() 🍋

Return the total number of samples for all drillholes.

Returns:

Type Description
int

Number of samples for all drillholes.

Example

import geolime as geo

dh = geo.datasets.load("rocklea_dome/dh_hyper.geo")
dh.sample_count()
Output
7326

to_pyvista(properties=None) 🍋

Export Drillholes and selected properties to Pyvista PolyData.

Parameters:

Name Type Description Default
properties Optional[Union[str, List[str]]]

Property or list of properties to export to Pyvista.

None

Returns:

Type Description
PolyData

PolyData object.

transform(properties=None, agg_methods=AggregationMethod.FIRST, support=AttributeSupportType.ELEMENT) 🍋

Return the object data grouped by location (X, Y) and hole ID.

Parameters:

Name Type Description Default
properties Optional[List[str]]

list of properties name to transfer to the GIS Object. Setting to None or empty list will select all existing properties.

None
agg_methods Union[AggregationMethod, Callable]

aggregation data methods. See pandas.DataFrame.groupby to find out supported methods.

FIRST
support AttributeSupportType

type supporting the transformation (e.g. node = points, element = segments)

ELEMENT

Returns:

Type Description
DataFrame

DataFrame of XY coordinates with aggregated data.

Raises:

Type Description
ValueError
  • No aggregation method is provided.
  • 'X', 'Y' or 'HOLEID' are part of the properties.
ValueError

if one of the aggregation methods is not supported.

Example

import geolime as geo

dh = geo.datasets.load("rocklea_dome/dh_hyper.geo")
dh.transform(properties=["Fe_pct"], agg_methods="mean")
Output
    Fe_pct_mean
0       41.000000
1       41.000000
2       41.000000
3       41.000000
4       41.000000
...           ...
7129    41.542857
7130    41.542857
7131          NaN
7132          NaN
7133          NaN

[7134 rows x 1 columns]

translate_by(coord, expr, region=None) 🍋

Shift the given existing X, Y or Z coordinate by the given expression or value.

Parameters:

Name Type Description Default
coord Union[Attribute, Coord]

coordinate property.

required
expr str

expression use to compute the property values. Use backquotes when attribute names contains whitespace.

required
region Optional[str]

region or condition in which to set the property data.

None

Raises:

Type Description
ValueError

Coord doesn't exist.


Last update: 2022-01-06