Block Models

Block models represent 3D data, typically via a 3D array. 3D arrays can be flattened into a 2D tabular representation that can be stored in a parquet file.

import tempfile

import pandas as pd
from pathlib import Path

from parq_blockmodel import ParquetBlockModel

Create a Parquet Block Model

We leverage the create_demo_block_model class method to create a Parquet Block Model.

temp_dir = Path(tempfile.gettempdir()) / "block_model_example"
temp_dir.mkdir(parents=True, exist_ok=True)

pbm: ParquetBlockModel = ParquetBlockModel.create_demo_block_model(
    filename=temp_dir / "demo_block_model.parquet")
pbm
ParquetBlockModel(name=demo_block_model, path=/tmp/block_model_example/demo_block_model.pbm.parquet)

Create Report

We’ll create a report for the Parquet Block Model.

pbm.create_report(open_in_browser=True, show_progress=True)
Profiling columns:   0%|          | 0/7 [00:00<?, ?it/s]
Profiling columns:  86%|████████▌ | 6/7 [00:00<00:00, 14.68it/s]
Profiling columns: 100%|██████████| 7/7 [00:00<00:00, 10.09it/s]

  0%|          | 0/6 [00:00<?, ?it/s]
100%|██████████| 6/6 [00:00<00:00, 929.73it/s]

PosixPath('/tmp/block_model_example/demo_block_model.pbm.html')

Visualise the Model

p = pbm.plot(scalar='depth', threshold=False, enable_picking=True)
p.show()
03 visualise blockmodel

Total running time of the script: (0 minutes 3.124 seconds)

Gallery generated by Sphinx-Gallery