Skip to content

Example 6: Porosity Computed Channels With pandas

This guide follows the executed user notebook examples/notebooks/user/computed_pandas/forge16b_porosity_example_pandas_computed.ipynb.

It starts from the same public LAS source used by Example 2, but uses pandas to compute porosity and gas-crossover channels before generating the layout.

Use this example when you want to:

  • load source channels from the open-hole porosity example
  • compute porosity and gas-crossover curves with pandas
  • attach those derived channels to a working WellDataset
  • generate the report YAML with LogBuilder and SectionBuilder
  • render from the in-memory report so the computed channels are available

Install and runtime model

Install the published package with LAS, pandas, and notebook support:

python -m pip install "wellplot[las,pandas,notebook]"

Run the notebook from a checkout of this repository so the example files and public sample data are available.

Recipe structure

The notebook is organized in four steps:

  1. inspect the source channels from the LAS-backed production example
  2. compute new channels in pandas and add them to the working dataset
  3. create the YAML layout with LogBuilder, SectionBuilder, and save_report(...)
  4. render the computed report from the in-memory report object

This is the tabular version of the porosity workflow. It is useful when your team prefers table-oriented calculations, QC columns, and pandas-based transforms before plotting.

What changes relative to Example 2

Example 2 keeps the packet YAML-first and source-backed. This notebook changes two things:

  • the porosity and gas-crossover channels are computed in pandas
  • the layout is generated with builder functions rather than edited directly in YAML

The saved YAML remains a layout artifact only. To reproduce the computed channels, rerun the notebook or export the computed dataset separately.

Adapt this example safely

When you copy this recipe to your own well:

  • keep the pandas computation cell separate from the layout cell
  • replace the matrix and fluid density constants with values appropriate for your reservoir
  • add every derived channel to working_dataset before creating the report builder
  • use LogBuilder for repeatable YAML generation instead of copying and editing YAML by hand
  • export computed data separately if you need a standalone file-only workflow