Drillhole creation and quick visualiation#
import geolime as geo
from pyproj import CRS
import pyvista as pv
pv.set_jupyter_backend('panel')
geo.Project().set_crs(CRS("EPSG:20350"))
/tmp/ipykernel_2837/3471980330.py:5: PyVistaDeprecationWarning: `panel` backend is deprecated and is planned for future removal.
pv.set_jupyter_backend('panel')
Loading DrillHoles#
dh = geo.read_file("../data/dh_hyper.geo")
dh.user_properties()
['X_COLLAR',
'Y_COLLAR',
'Z_COLLAR',
'X_M',
'Y_M',
'Z_M',
'X_B',
'Y_B',
'Z_B',
'X_E',
'Y_E',
'Z_E',
'Fe_pct',
'Al2O3',
'SiO2_pct',
'K2O_pct',
'CaO_pct',
'MgO_pct',
'TiO2_pct',
'P_pct',
'S_pct',
'Mn_pct',
'Fe_ox_ai',
'hem_over_goe',
'kaolin_abundance',
'kaolin_composition',
'wmAlsmai',
'wmAlsmci',
'carbai3pfit',
'carbci3pfit',
'Sample_ID',
'Fe',
'Fe2o3',
'P',
'S',
'SiO2',
'MnO',
'Mn',
'CaO',
'K2O',
'MgO',
'Na2O',
'TiO2',
'LOI_100',
'Depth']
The basic properties of a drillholes object already have unit specify
dh.property("X_M").unit
Unit can also be specified in the Project for each property.
Property units are managed using the Pint python pacakge (https://pint.readthedocs.io/en/stable/index.html). Default unit are already available (https://github.com/hgrecco/pint/blob/master/pint/default_en.txt) and other can be added to a GeoLime project
This will allow to specify the percent property to each property of a GeoLime object.
geo.Project().unit_registry.define("percent = 1e-2 frac = pct")
Using the percent unit defined, we can now specify it to all other related property, especially the ones with _pct
in their names.
for prop in dh.properties():
if "_pct" in dh.property(prop).name:
dh.property(prop).unit = geo.Project().unit_registry.pct
dh.property("Fe_pct").unit
Graphic representations#
geo.scatter(geo_object=dh, property_x="X_M", property_y="Z_M")
geo.scatter(geo_object=dh, property_x="Y_M", property_y="Z_M")
Points with no value can be hidden using extra keywords from the folium library: https://python-visualization.github.io/folium/quickstart.html#Getting-Started
dh.plot_2d(property="Fe_pct", agg_method="mean", interactive_map=True, style_kwds={"fillColor": "none"})
geo.scatter(geo_object=dh, property_x="Fe_pct", property_y="Z_M", marginal_plot="Histogram")
Exploratory Analysis#
df_pv = dh.to_pyvista('Fe_pct')
pl = pv.Plotter()
pl.add_mesh(df_pv.tube(radius=10))
pl.set_scale(zscale=20)
pl.show()