QA-QC of Kriging results#

import geolime as geo
import numpy as np
from pyproj import CRS
import pyvista as pv

pv.set_jupyter_backend('panel')


geo.Project().set_crs(CRS("EPSG:20350"))
/tmp/ipykernel_4981/3172071959.py:6: PyVistaDeprecationWarning: `panel` backend is deprecated and is planned for future removal.
  pv.set_jupyter_backend('panel')
dh = geo.read_file("../data/dh_pop_classif.geo")
domain_solid = geo.datasets.load("rocklea_dome/domain_mesh.dxf")
bm = geo.read_file("../data/block_model.geo")
domain_solid.contains(dh)
dh.set_region_condition("HighGrade", "in_OreZone and (Fe_pct == Fe_pct)")
dh.set_region_condition('valid_holes', "HighGrade")
geo.histogram_plot(data=[{"object":bm, "property":"Fe_kriged"}],nbins=20)
geo.plot_2d(bm, "Fe_kriged", "mean")
dh.keep_composites('valid_holes')
bm.keep_only_cells('Ore')
dh_pv = dh.to_pyvista('Fe_pct')
bm_pv = bm.to_pyvista('Fe_kriged')
/opt/hostedtoolcache/Python/3.9.17/x64/lib/python3.9/site-packages/pyvista/core/grid.py:873: PyVistaDeprecationWarning:

`UniformGrid` is deprecated. Use `ImageData` instead.
p = pv.Plotter()

p.add_mesh(dh_pv.tube(radius=10))
p.add_mesh_threshold(bm_pv,show_edges=True, opacity=0.7)
p.set_scale(zscale=20)
p.show()
slices = bm_pv.slice_orthogonal(x=547.8e3, y=7.4760e6, z=430)
p = pv.Plotter()
p.add_mesh(dh_pv.tube(radius=10))
p.add_mesh(slices,show_edges=True, opacity=1)
p.set_scale(zscale=20)
p.show()
geo.swath_plot(bm, "Fe_kriged", 50, "Y", "blue")
geo.swath_plot(bm, "Fe_kriged", 50, "Y", "blue")
geo.swath_plot(
    [
        {"obj":bm, "attribute":"Fe_kriged", "swath_interval":50, "axis":"Y", "color": "blue"},
        {"obj":dh, "attribute":"Fe_pct", "swath_interval":50, "axis":"Y_M", "color": "red"}
    ]
)
grades = np.linspace(30, 60, 30)
bm.set_property_expr('density', '4')
fig = geo.gtc(bm, 'Fe_kriged', 'density', grades)
fig.update_layout(
    {
        "xaxis":{"range":[28, 60]},
         "yaxis2":{"range":[45, 60]}
    }
)