# Examples from pyvista.examples.downloads.download_reservoir
# ===========================================================

# Load and plot dataset.
from pyvista import examples
import pyvista as pv
dataset = examples.download_reservoir()
dataset

# The `'BLOCK_I'`, `'BLOCK_J'` and `'BLOCK_K'` cell arrays are the structured
# indices of each cell. Plot the grid colored by its layer index `'BLOCK_K'`.
pl = pv.Plotter()
_ = pl.add_mesh(dataset, scalars='BLOCK_K', show_edges=True)
camera = pl.camera
camera.position = (312452, 7474760, 3507)
camera.focal_point = (314388, 7481520, -2287)
camera.up = (0.09, 0.63, 0.77)
camera.distance = 9112
camera.clipping_range = (595, 19595)
pl.show()

# Show the layers in a cross-section, with the elevation exaggerated.
section = dataset.extract_cells(dataset.cell_data['BLOCK_J'] == 34)
pl = pv.Plotter()
_ = pl.add_mesh(section, scalars='BLOCK_K', show_edges=True)
pl.set_scale(zscale=5)
pl.view_xz()
pl.camera.zoom(2)
pl.show()

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code
