Your own data¶
The quickstart ran a bundled LAS; your own data rarely arrive that way. Read your logs, attach formation and lithology tables, check that their depths agree, then interpret and export. Files cut from the bundled 30/6-5 well stand in for yours: a CSV of logs, the same tops in feet, and a supplier workbook.
Your logs¶
The stand-in file, my_logs.csv, holds 400 m of 30/6-5 logs: a depth column
called MD and eleven log curves, and, like any CSV, no units or header.
import pandas as pd
import petrophys as pp
pd.read_csv("my_logs.csv").head(3)
| MD | GR | CALI | BS | RHOB | NPHI | DTC | RDEP | RMED | SP | PEF | DRHO | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2700.049 | 64.750 | 13.094 | 12.25 | 2.496 | 0.282 | 92.994 | 6.156 | 7.578 | 50.081 | NaN | -0.011 |
| 1 | 2700.202 | 60.875 | 13.086 | 12.25 | 2.524 | 0.286 | 92.756 | 6.301 | 7.590 | 53.333 | NaN | -0.011 |
| 2 | 2700.354 | 60.688 | 13.086 | 12.25 | 2.538 | 0.298 | 92.456 | 6.563 | 7.551 | 55.573 | NaN | -0.008 |
Read them¶
A CSV or Excel table does not record its depth unit, so give depth_unit, or write the unit in the
depth header (DEPTH (m)). The separator and a decimal comma are detected, so a semicolon file
exported in a European locale reads as it is.
well = pp.read("my_logs.csv", depth_column="MD", depth_unit="m", well_name="30/6-5")
well
Well(30/6-5, curves=11, samples=2625)
Option of |
Applies to |
What it does |
|---|---|---|
|
CSV, TSV, Excel (required unless the depth header gives the unit) |
|
|
CSV, TSV, Excel |
Depth column name; default |
|
CSV, TSV, Excel |
Name of the well |
|
Excel |
Sheet holding the logs; default the only sheet, else the first with the depth column |
|
CSV, TSV, Excel |
Values to read as missing, such as |
|
CSV, TSV |
Passed to |
|
LAS, CSV, TSV |
Text encoding of the file, for example |
|
DLIS ( |
Frame, channels and grid step; see |
|
all |
Geology table: a path or a DataFrame |
|
all |
|
|
all |
The well’s depth reference and datum, e.g. |
Excel logs read the same way: pp.read("my_logs.xlsx", depth_unit="m"). A table already
in pandas becomes a well with Well.from_dataframe.
Several wells in one table: petrophys.io.read_csv_wells().
Attach formations and lithology¶
Pass your tables as formations= and lithology=. Copy a template’s columns
and fill in your picks; Input templates lists every template. Here the
bundled 30/6-5 tops and lithology intervals stand in for yours. pp.plot then
draws them beside the logs, as in the Quickstart, and the import report
below says what was read.
well = pp.read("my_logs.csv", depth_column="MD", depth_unit="m", well_name="30/6-5",
formations=pp.sample("formations_30_6-5"),
lithology=pp.sample("lithology_30_6-5"))
Curve names no alias table knows¶
Petrophys recognizes the common mnemonics of the main service companies and software packages, but no table holds every company’s names. Map yours once:
pp.read("my_logs.las", curve_aliases={"GAMMA_RAY_1": "GR", "DEEP_RES": "RDEP"})
pp.read("my_logs.las", curve_aliases="my_curve_names.csv") # columns: curve, standard
The mapping is stored on the well, so pp.interpret and pp.plot use it too;
both also take curve_aliases= directly, and petrophys-context takes
--curve-aliases FILE. Standard names are the library’s (GR, RDEP,
RHOB, NPHI, DTC, CALI, …); an unknown one raises an error that lists
them. To plot only some curves, pass pp.plot(well, curves=["GR", "RDEP"]), by
your names or the standard ones. The visualization masterclass (tutorial 17) and
the visualization guide show both on the Teapot Dome well, whose SPR curve no
alias table knows.
Common service-company curve names¶
The interpretation workflow recognizes these names and retains the source curves alongside its canonical working curves by default:
Measurement |
Standard |
Examples of recognized names |
|---|---|---|
Caliper |
|
|
Density correction |
|
|
Bulk density |
|
|
Neutron porosity |
|
|
Compressional sonic |
|
|
Shear sonic |
|
|
Deep resistivity |
|
|
Medium resistivity |
|
|
Shallow resistivity |
|
|
Photoelectric factor |
|
|
Definitions can be checked against the service-company-supplied
Energistics PWLS catalogue
and the IODP logging-tool table.
Names are not universal: EDE-01 uses CALA in inches for ultrasonic caliper,
whereas SLB also defines CALA as calibration waveform amplitude. Automatic
caliper selection therefore requires a recognized length unit for CALA;
a voltage or missing unit leaves it under its original name. Check the header
before correcting a missing unit. Differential DCAL remains subject to the
existing differential-caliper check.
Orthogonal calipers remain separate source curves; selecting a working CALI
does not average them. Stoneley DTST is not shear DTS, and acquisition
suffixes such as EDE-01’s _CH are not stripped automatically. Verify the
tool, units, neutron matrix reference and acquisition conditions before using
an explicit mapping for a specialized curve.
Warnings and invalid measurements¶
Petrophys uses DataQualityWarning for suspect numerical inputs and impossible
calculated results. Messages identify the quantity, affected sample count and
up to five zero-based array positions. They say whether values were retained,
replaced, clipped or converted to missing values.
These checks include saturation fractions and resistivity, BVW, NMR permeability,
Timur fallback inputs, core elastic properties, GR baseline ordering, density
contrast and MHI classification. A warning does not repair a retained value:
review the input before using that result. Ordinary missing NaN samples alone
do not trigger these numerical range warnings, nor does a porosity of zero,
the effective porosity of shale.
Capture warnings in a user interface or automated job:
import warnings
from petrophys.exceptions import DataQualityWarning
with warnings.catch_warnings(record=True) as notices:
warnings.simplefilter("always", DataQualityWarning)
result = pp.interpret(well)
messages = [str(item.message) for item in notices]
To turn data-quality warnings into exceptions, use
warnings.simplefilter("error", DataQualityWarning). A workflow can record an
exception as a failed step; call result.raise_for_errors() when a job must
fail if any step failed. Invalid types, incompatible
survey arrays and unusable scalar parameters raise descriptive ValueError
exceptions instead of continuing an undefined calculation.
The core-table reader also records nonnumeric cells converted to NaN in
core.metadata["import_report"]["invalid_numeric_cells"], with the source
column, count and zero-based data row positions. Empty cells and recognized
missing-value tokens are distinguished from malformed text.
Read the import report¶
Every geology reader returns a table plus a report of what it accepted, mapped and assumed. Here it notes that no depth reference or datum was declared, and the rows outside the logged interval.
tops = pp.read_formations(pp.sample("formations_30_6-5"), well=well)
tops.attrs["import_report"]
{'input_rows': 20,
'accepted_rows': 20,
'filtered_rows': 0,
'well': None,
'column_mapping': {'formation_name': 'formation_name',
'top_depth': 'top_depth',
'bottom_depth': 'bottom_depth',
'lithology': 'lithology',
'rank': 'rank',
'parent': 'parent',
'depth_unit': 'depth_unit'},
'ignored_columns': [],
'diagnostics': ['No geology depth_reference supplied; assumed to match the well (not independently verified).',
'No geology datum supplied; assumed to match the well (not independently verified).',
'12 of 20 geology rows lie outside the logged interval 2700.05-3099.95 m.'],
'outside_logged_interval': 12}
Check depth reference and datum¶
Declare the depth unit, reference and datum of each table. Units are then
converted, and a table on a different reference is rejected instead of silently
misplaced. The well declares its own with depth_reference= and datum=.
Here the same formation picks arrive in feet, in formations_ft.csv:
well = pp.read("my_logs.csv", depth_column="MD", depth_unit="m", well_name="30/6-5",
depth_reference="MD", datum="RKB")
tops = pp.read_formations("formations_ft.csv", well=well,
depth_unit="ft", depth_reference="MD", datum="RKB")
tops.attrs["import_report"]["depth_conversion"]
{'from': 'ft', 'to': 'm', 'factor': 0.3048}
tops.tail(3)
| formation_name | top_depth | bottom_depth | rank | |
|---|---|---|---|---|
| 9 | Cook Fm. | 3071.0 | 3123.0 | formation |
| 10 | Amundsen Fm. | 3123.0 | 3223.0 | formation |
| 11 | Statfjord Fm. | 3223.0 | 3556.0 | formation |
Situation |
What Petrophys does |
|---|---|
Table in feet, well in metres (or the reverse) |
Converts, and records |
No |
Assumes the well’s unit and notes it in the report |
No |
Assumes they match the well and notes the assumption in the report |
A |
Read by its values: a datum (KB, RKB, DF, RT, GL, MSL, SL, LAT) as |
A datum the well does not declare |
Compared with the datum of the |
Different reference (MD, TVD, TVDSS) or datum |
Raises |
Some rows outside the logged interval |
Counts them in the report |
No row overlaps the logs |
Warns with |
pp.read takes the same declarations for its tables through
formation_options and lithology_options, for example
formation_options={"depth_unit": "ft", "depth_reference": "MD", "datum": "RKB"}.
A supplier workbook¶
Suppliers often deliver one Excel workbook with several sheets and several
wells, under their own column names. Here the 30/6-5 Brent Group picks share
the Tops sheet with the Kharaib-2 pick of the COSTA well HW-3, in feet:
pd.read_excel("supplier_tops.xlsx", sheet_name="Tops")
| Well ID | Marker | Pick ft | |
|---|---|---|---|
| 0 | 30/6-5 | Ness Fm. | 9320.866 |
| 1 | 30/6-5 | Etive Fm. | 9399.606 |
| 2 | HW-3 | KHARAIB-2 | 7805.000 |
Name the sheet, map the columns (from the template’s name to the supplier’s)
and pass the well: rows of other wells are filtered out and counted in the
report (filtered_rows).
tops = pp.read_formations(
"supplier_tops.xlsx", sheet_name="Tops", well=well,
columns={"well": "Well ID", "formation_name": "Marker", "top_depth": "Pick ft"},
depth_unit="ft", depth_reference="MD", datum="RKB",
)
tops
| formation_name | top_depth | well | rank | |
|---|---|---|---|---|
| 0 | Ness Fm. | 2841.0 | 30/6-5 | formation |
| 1 | Etive Fm. | 2865.0 | 30/6-5 | formation |
Without sheet_name, a workbook with several sheets raises an error that
lists them. Lithology intervals take the same sheet_name, columns and
well options, also from a delimited text file with sep=";"; mapped columns
keep vendor comment columns out, and the report lists them.
Errors you will meet¶
Petrophys stops with a message that says what to fix. Each call below is a common mistake, run as it stands.
A CSV without its depth unit:
pp.read("my_logs.csv", depth_column="MD")
ValueError: CSV logs do not record their depth unit; read the file with petrophys.read(path, depth_unit='m') or depth_unit='ft', or give the depth column header its unit, e.g. 'DEPTH (m)'.
Tops on another depth reference than the well’s:
pp.read_formations("formations_ft.csv", well=well, depth_unit="ft", depth_reference="TVDSS")
ValueError: Incompatible depth_reference: geology=TVDSS, well=MD; a survey/datum transformation is required.
A misspelt setting:
pp.interpret(well, rw=0.07, rw_meas_temp="230 degF")
DynamicWorkflowResult(well=Well(30/6-5, curves=50, samples=2625), config=DynamicWorkflowConfig(standardize_input=None, rename_input_curves=False, allow_default_rw=True, surface_temp=None, bht=None, td=None, temperature_gradient=None, mud_type='WBM', mud_has_clay_or_kcl=False, rmf_at_meas_temp=None, rmf_meas_temp=None, rmf_salinity_ppm=None, rmf_chlorides_mg_l=None, rm=None, rm_meas_temp=None, mud_water='fresh', rw=0.07, rw_meas_temp='230 degF', salinity_ppm=None, matrix_type='sandstone', rho_ma=None, nphi_ma=None, rho_fl=1.0, rho_cl=2.45, dt_ma=None, dt_fl=189.0, lithology_domain='clastic', lithology='clastic', lithology_csv=None, lithology_intervals=None, lithology_source='auto', lithology_curve=None, lithology_codes=None, carbonate_calibration=None, mineral_endpoints=None, raise_on_error=False, a=None, m=None, n=None, cec=None, b_coeff=None, m_star=2.0, rwb=None, phi_cl=None, depth_check=False, apply_hc_correction=False, hc_type='oil', rho_hc=None, hc_hydrogen_index=None, vcl_cutoff=None, sw_cutoff=None, phie_cutoff=None, gr_min=None, gr_max=None, gr_method='linear', sp_min=None, sp_max=None, nd_clay=None, bad_hole=None, perm_method='auto', perm_fallback_method='coates', perm_coefficients=None, swirr=None, swirr_flag_phi_cl='workflow', calculation_profile='current', reuse_input_resflag=False, peer_wells=None, formation_tops=None, use_peer_core=False, sw_model='auto', sw_routing_vcl_cutoff=None, rtsh=None, vsh_exp=1.6, shale_exp=1.6, zones=None, skip_steps=[]), steps_executed=[StepResult(step='normalization', success=True, message='', method='curve_alias_and_unit_standardization', input_curves=['BS', 'CALI', 'DRHO', 'DTC', 'GR', 'NPHI', 'PEF', 'RDEP', 'RHOB', 'RMED', 'SP'], output_curves=['PEF'], parameters={'rename_curves': False, 'convert_units': True, 'rename_map': {}, 'working_aliases': {}, 'unit_changes': {}, 'core_saturation_normalization': {}, 'range_screening': {'PEF': {'standard_curve': 'PEF', 'low': 0.0, 'high': 15.0, 'unit': '', 'source_unit': '', 'masked': 35, 'finite': 2073, 'fraction': 0.01688374336710082, 'hint': '', 'whole_curve': False, 'source_channel': 'PEF'}}}, decisions=['Curve units, null values and plausible ranges standardized before interpretation', 'No standard curve names needed adding: the logs use them already'], data=None, also_written=[], curves_removed=[], parameter_notes={}, written_by={}), StepResult(step='input_context', success=True, message='', method='validated_geology_selection', input_curves=[], output_curves=[], parameters={'requested_source': 'auto', 'selected_source': 'computed', 'external_available': False, 'vendor_available': False, 'vendor_curve': None}, decisions=['Selected computed lithology; alternate sources were retained'], data=None, also_written=[], curves_removed=[], parameter_notes={}, written_by={}), StepResult(step='temperature', success=True, message='', method='fallback_geothermal_gradient', input_curves=[], output_curves=['TEMP'], parameters={'surface_temp_f': 68.0, 'bht_f': None, 'td': 3099.9473, 'td_unit': 'm', 'gradient_f_per_100ft': 1.64592, 'gradient_c_per_km': 30.000000000000004}, decisions=['No bottom-hole temperature: temperatures follow an assumed 30 C/km gradient', 'Gradient = 1.6459 F/100ft (30.00 C/km)', 'Temp range: 213.8 - 235.4 F'], data=None, also_written=[], curves_removed=[], parameter_notes={}, written_by={}), StepResult(step='bad_hole', success=True, message='', method='caliper_drho_flags', input_curves=['CALI', 'BS', 'DRHO', 'RHOB', 'PEF'], output_curves=['BAD_HOLE'], parameters={'bit_size_used': 8.5, 'bit_size_source': 'BS_curve_depth_by_depth', 'bit_size_unique_values': [8.5, 12.25], 'bit_size_depth_dependent': True, 'no_bit_size_samples': 0, 'caliper_test_samples': 2625, 'not_assessed_samples': 0}, decisions=['330 bad-hole samples flagged out of 2625'], data=None, also_written=[], curves_removed=[], parameter_notes={}, written_by={}), StepResult(step='vclay', success=True, message='', method='linear', input_curves=['GR', 'SP', 'NPHI', 'RHOB'], output_curves=['VCL', 'VCLAY', 'VCL_GR', 'VCLGR', 'VCL_SP', 'VCLSP', 'VCL_ND', 'VCLND'], parameters={'gr_min': 35.16674, 'gr_max': 113.188, 'gr_min_used': 20.0, 'gr_max_used': 113.188, 'gr_bounded': {'gr_min': [35.16674, 20.0]}, 'gr_curve': 'GR', 'gr_method': 'linear', 'use_sp': True, 'use_nd': True, 'sp_min': 87.65387999999999, 'sp_max': 51.17024, 'sp_min_source': 'auto', 'sp_max_source': 'auto', 'nd_matrix': 'sandstone', 'nd_clean1_density': 2.65, 'nd_clean1_neutron': -0.02, 'nd_clean2_density': 1.99, 'nd_clean2_neutron': 0.38, 'nd_clay_density': 2.58495, 'nd_clay_neutron': 0.3077, 'active_vcl_source': 'workflow_calculation', 'computed_vcl_curve': 'VCL', 'lithology_domain': 'clastic', 'vcl_rule': 'min(GR, ND)', 'sp_in_vcl': False, 'sp_polarity': None, 'nd_clay_source': 'shale_samples', 'nd_clay_basis': 'vcl_gr_gt_0.9', 'nd_clay_samples': 484, 'nd_clay_depth_range': [2806.1196, 3059.866], 'nd_clay_picked': [2.58495, 0.3077], 'nd_clay_fallback_reason': None, 'nd_in_vcl': True, 'nd_outside_triangle_samples': 112}, decisions=['GR_min = 35.2 (auto, P5 of GR)', 'GR_max = 113.2 (auto, P95 of GR)', 'Gamma-ray clay input: GR', 'GR method: linear', 'SP method: enabled', 'N-D method: enabled', 'SP_clean = 51.2 (auto, P5 of SP)', 'SP_shale = 87.7 (auto, P95 of SP)', 'Applied GR endpoints: 20 to 113.188 API', 'GR baseline bound on automatic picks (clean at most 20 API, shale at least 100 API): the clean GR pick 35.2 API was lowered to 20', 'Final VCL = min(GR, ND) at each depth, range: 0.000 - 1.000', 'VCL_SP is reported but left out of the minimum: SP baselines picked over the whole log mostly measure SP baseline drift, so it only fills depths with no GR or N-D value. Set both sp_min and sp_max to include it; they apply to the whole log, so only for an SP without baseline drift', 'N-D clean line (sandstone): RHOB 2.65 g/cm3 at NPHI -0.02 to RHOB 1.99 g/cm3 at NPHI 0.38', 'N-D clay point: RHOB 2.585 g/cm3, NPHI 0.308, the median of 484 good-hole VCL_GR > 0.9 samples at 2806.12-3059.87 m', "VCL_ND undefined at 112 samples with NPHI above 0.380, beyond the clean line's end point and the clay point (outside the neutron-density triangle); VCL there comes from the other indicators"], data=None, also_written=[], curves_removed=[], parameter_notes={}, written_by={}), StepResult(step='rcl', success=True, message='', method='vcl_gt_0.9_median_rt', input_curves=['RDEP', 'VCL'], output_curves=[], parameters={'vcl_threshold': 0.9, 'default_rcl': 5.0, 'statistic': 'median', 'rcl_computed': 4.234, 'source': 'vcl_gt_0.9_median_rt', 'shale_sample_count': 423, 'shale_lithology_groups': []}, decisions=['Rcl = 4.23 ohm.m (median RT where VCL > 0.9, n=423)'], data=None, also_written=[], curves_removed=[], parameter_notes={}, written_by={}), StepResult(step='porosity', success=True, message='', method='component_based', input_curves=['NPHI', 'RHOB', 'DTC', 'VCL'], output_curves=['PHIN', 'PHID', 'PHIS', 'PHIT', 'PHIE', 'PHI_SEC'], parameters={'matrix_type': 'sandstone', 'matrix_mode': 'constant', 'matrix_source': 'config_or_default[sandstone]', 'porosity_pass': 'initial', 'uses_computed_lithology': False, 'matrix_groups_used': [], 'matrix_endpoints': [], 'nphi_ma': -0.02, 'nphi_ma_min': -0.02, 'nphi_ma_max': -0.02, 'rho_ma': 2.65, 'rho_ma_min': 2.65, 'rho_ma_max': 2.65, 'rho_fl': 1.0, 'dt_ma': 55.5, 'dt_ma_min': 55.5, 'dt_ma_max': 55.5, 'dt_fl': 189.0, 'phi_cl': 0.17189370298732, 'phi_cl_source': 'vcl_gt_0.9_average_phit_nd', 'phi_cl_basis': 'vcl_gt_0.9_average_phit_nd', 'phi_cl_basis_count': 423, 'phi_cl_fallback_reason': None, 'phie_basis': 'PHIT', 'phit_method': 'adaptive_nd', 'phit_source_counts': {'density_from_missing_phin': 0, 'density_from_gas_crossover': 0, 'weighted_nd': 2625, 'neutron_from_missing_phid': 0, 'nan': 0}, 'phit_nd_average_samples': 2625, 'phit_apparent': False, 'phie_apparent': False, 'apparent_porosity_source': None}, decisions=['Porosity used the configured matrix endpoints; it is computed once and is not recomputed if the workflow later infers LITHO', 'PHIN = clip(NPHI - nphi_ma, 0, 0.6) using nphi_ma=-0.020', 'PHID = (rho_ma - RHOB) / (rho_ma - rho_fl)', 'PHIS from Wyllie time-average equation', 'PHIT from neutron and density: both logs at 2625 samples', 'PHIE = PHIT - VCL * phi_cl (0.172)', 'PHI_SEC = PHIT - PHIS'], data=None, also_written=[], curves_removed=[], parameter_notes={}, written_by={}), StepResult(step='lithology', success=True, message='', method='multi_mineral_solver', input_curves=['RHOB', 'VCL', 'NPHI', 'PHIE', 'PEF', 'DTC'], output_curves=['VQUAR', 'VCALC', 'VDOLO', 'VANHY', 'LITHO'], parameters={'equation_revision': 'canonical', 'row_uncertainty': {'unity': 0.01, 'rhob': 0.02, 'nphi': 0.02, 'u': 0.5, 'dt': 2.0}, 'porosity_solved_samples': 0, 'lithology_curve_written': True, 'lithology_source_priority': 'multi_mineral_fallback', 'multi_mineral_solved_samples': 2625, 'multi_mineral_qc_flagged_samples': 0, 'multi_mineral_total_samples': 2625, 'lithology_domain': 'clastic'}, decisions=['PEF set aside: in 92% of 357 clean porous samples the apparent matrix density is quartz-like (< 2.67 g/cm3) but the apparent matrix U calcite-like (> 10 b/cm3), the signature of barite-weighted mud; minerals solved without PEF', 'No lithology curve or lithology intervals were available -> inferred LITHO from mineral volumes', 'PEF screened for plausibility; without PEF the minerals are solved from RHOB and NPHI (sonic is used beside PEF, not in its place)', 'Clastic minerals solved per sample from the logs, with a check that minerals, clay and porosity add up to one', 'Equation rows weighted by nominal one-sigma tool uncertainty: unity 0.01 v/v, rhob 0.02 g/cm3, nphi 0.02 v/v, u 0.5 b/cm3, dt 2 us/ft', 'Multi-mineral solved 2625/2625 samples; QC flagged 0'], data=None, also_written=[], curves_removed=[], parameter_notes={}, written_by={}), StepResult(step='rw', success=True, message='', method='user_provided_temperature_profile_corrected', input_curves=[], output_curves=['RW'], parameters={'rw_at_measured_temp': 0.07, 'measured_temp_f': 230.0, 'salinity_ppm_estimated': 30488.716214457203, 'source_priority': 'config.rw', 'rw_min': 0.06843991727429734, 'rw_max': 0.07514031809151374, 'formation_temp_min_f': 213.80266220000001, 'formation_temp_max_f': 235.39715420000002, 'rwa_median_over_rw': 1.6029539718685868, 'rwa_p5_over_rw': 0.6109348098965149, 'rwa_check_samples': 494}, decisions=['Rw corrected from 0.0700 ohm.m @ 230F along the temperature profile'], data=None, also_written=[], curves_removed=[], parameter_notes={'rwa_median_over_rw': 'a check of the Rw in use, on any Rw route: the median apparent water resistivity Rwa = Rt x phi^m / a of the clean porous rock, over Rw (Rwa is not written as a curve); the Rw is questioned when this is below 0.5', 'rwa_p5_over_rw': 'the same check: the 5th percentile of Rwa over Rw; the Rw is questioned when this is above 2 (no clean porous rock reads as water)', 'rwa_check_samples': 'the clean porous samples of that check'}, written_by={}), StepResult(step='invasion', success=True, message='', method='rxo_rt_ratio', input_curves=['RDEP', 'RMED'], output_curves=['INVASION_RATIO'], parameters={'mean_ratio': 1.2570125924195645, 'median_ratio': 1.2514354789966757, 'min_ratio': 0.2490794824399261, 'max_ratio': 4.4837518763438675, 'valid_percent': 100.0, 'conductive_percent': 2.5904761904761906, 'minimal_percent': 35.42857142857142, 'resistive_percent': 61.98095238095238, 'total_samples': 2625, 'valid_samples': 2625, 'nan_samples': 0, 'rt_min_used': 0.0, 'max_ratio_used': 100.0, 'nonfinite_rxo_samples': 0, 'nonfinite_rt_samples': 0, 'nonpositive_rxo_samples': 0, 'rt_below_min_samples': 0, 'ratio_above_max_samples': 0, 'rxo_curve': 'RMED', 'rt_curve': 'RDEP', 'rxo_source_counts': {'RMED': 2625}, 'rt_source_counts': {'RDEP': 2625}, 'shallow_source_counts': {}, 'medium_proxy_source_counts': {'RMED': 2625}, 'medium_deep_proxy_samples': 2625, 'true_shallow_samples': 0, 'fallback_proxy_used': True, 'rxo_curve_order': ['RXO', 'RSHA', 'RESS', 'RMED', 'RESM']}, decisions=['INVASION_RATIO reads RMED at 2625 samples over RDEP; curve preference RXO, RSHA, RESS, then the RMED/RESM medium/deep proxy', 'INVASION_RATIO from RMED/RDEP where no shallow resistivity (RXO, RSHA or RESS) was read', 'INVASION_RATIO valid for all 2625 samples'], data=None, also_written=[], curves_removed=[], parameter_notes={}, written_by={}), StepResult(step='saturation', success=True, message='', method='simandoux+archie', input_curves=['RDEP', 'PHIE', 'VCL'], output_curves=['SW', 'SXO'], parameters={'sw_model': 'simandoux+archie', 'sw_model_requested': 'auto', 'sw_model_sample_counts': {'simandoux': 2124, 'archie': 501}, 'a': 0.81, 'm': 2.0, 'n': 2.0, 'archie_coefficients': {'SANDSTONE': {'a': np.float64(0.81), 'm': np.float64(2.0), 'n': np.float64(2.0), 'closest_lithology': 'granular_sandstone', 'samples': 2625}}, 'archie_lithology_source': 'config', 'archie_a_source': 'ArchieParameterDefaults', 'archie_m_source': 'ArchieParameterDefaults', 'archie_n_source': 'ArchieParameterDefaults', 'rw_min': 0.06843991727429734, 'rw_max': 0.07514031809151374, 'rcl': 4.234, 'salinity_ppm': 30488.716214457203, 'cec': None, 'cec_present': False, 'b_coeff': None, 'b_coeff_present': False, 'm_star': 2.0, 'rwb': None, 'phi_cl': 0.17189370298732, 'phi_cl_source': 'vcl_gt_0.9_average_phit_nd', 'phi_cl_basis': 'vcl_gt_0.9_average_phit_nd', 'phi_cl_basis_count': 423, 'phi_cl_fallback_reason': None, 'rtsh': 4.234, 'vsh_exp': 1.6, 'shale_exp': 1.6, 'vcl_cutoff_for_routing': 0.3, 'lithology_type': 'clastic', 'sxo_method': 'fifth_root_quicklook', 'sxo_reason': 'RSHA/RXO/RESS and RMF unavailable', 'sxo_method_counts': {'fifth_root_quicklook': 2625}, 'sxo_input_sources': {'rt': {'RDEP': 2625}, 'rxo': {}}, 'source_sw_curve': None, 'source_sw_samples_used': 0, 'archie_sw_samples_used': 2625, 'source_sw_input_sources': {}, 'lithology_domain': 'clastic', 'shaly_sand_equations': 'published', 'sw_model_fallback_counts': {}, 'cec_meq_per_g': None, 'waxman_smits_sw_basis': 'effective', 'total_porosity_basis': 'PHIT', 'waxman_smits_clipped_to_zero': 0, 'sw_one_below_porosity': 0.01}, decisions=['Saturation equations: Simandoux + Archie', 'SW = 1 at 714 samples whose porosity is below 0.01 v/v, about what porosity tools resolve: without pore space no hydrocarbon is held, and a shaly-sand equation would otherwise read an Sw from its clay term alone', "Saturation equation chosen at each depth from the clay volume and lithology (sw_model='auto')", 'Simandoux selected for shaly samples at routing salinity 30,489 ppm (>= 20,000 ppm)', 'Samples per equation: Simandoux 2124, Archie 501', 'Archie coefficients from lithology (the lithology setting)', 'Rw range = 0.0684 to 0.0751, Rcl = 4.234 ohm.m', 'SXO = SW^(1/5), the quick-look estimate, because RSHA/RXO/RESS and RMF unavailable', 'Sw range: 0.091 - 1.000'], data=None, also_written=[], curves_removed=[], parameter_notes={}, written_by={}), StepResult(step='permeability', success=True, message='', method='auto', input_curves=['PHIE', 'SWIRR/SW', 'SW', 'RDEP', 'RESFLAG'], output_curves=['RESFLAG', 'PERM', 'SWIRR_APP'], parameters={'method': 'auto', 'fallback_method': 'coates', 'swirr_source': 'buckles_bvw_irr', 'swirr_app_method': 'buckles_bvw_irr', 'bvw_irr': 0.05976834848894636, 'swirr_metadata': {'resflag_source': 'RESFLAG', 'sw_curve': 'SW', 'rt_curve': 'RDEP', 'rt_source_counts': {'RDEP': 2625}, 'rt_cutoff': 5.0, 'min_samples': 10, 'hc_mask_samples': 215, 'bvw_irr': 0.05976834848894636, 'swirr_app_method': 'buckles_bvw_irr'}, 'strategy': 'coates', 'same_well_core_models': 0, 'peer_core_models': 0, 'peer_wells_considered': 0, 'peer_core_enabled': False, 'core_min_points': 3, 'core_models': [], 'core_rejected_models': [{'source_well': '30/6-5', 'source_field': '', 'source_formation': None, 'reason': 'no_core_curves'}], 'empirical_method': 'coates', 'empirical_error': None, 'empirical_attempted_methods': ['coates'], 'empirical_method_metadata': {'equation': '10000 * PHIE^4 * ((1 - SWIRR) / SWIRR)^2', 'coefficient': 10000.0, 'porosity_exponent': 4.0}, 'perm_max_clip_md': 10000.0, 'pre_permeability_resflag': {'source_curve': 'NetPayModule.net_reservoir', 'created': True, 'vcl_curve': 'VCL', 'phie_curve': 'PHIE', 'sw_curve': 'SW', 'vcl_cutoff': 0.3, 'phie_cutoff': 0.08, 'sw_cutoff': 0.6, 'excluded_samples': {'bad_hole': 330}, 'reservoir_samples': 470}, 'core_porosity_fits': []}, decisions=['RESFLAG, the net-reservoir flag from VCL, PHIE and SW, set before permeability (470 samples)', 'SWIRR_APP = BVWirr / PHIE (Buckles), BVWirr = median(PHIE x SW where resflag and RDEP > 5) = 0.0598 (n=215)', 'Coates-Denoo empirical permeability: k = 10000 * PHIE^4 * ((1 - SWIRR) / SWIRR)^2', 'Permeability clipped to <= 10000 mD', 'Empirical permeability curve stored as PERM (coates)', 'Permeability: Coates', 'Perm range: 0.000 - 1270.6 mD'], data=None, also_written=[], curves_removed=[], parameter_notes={}, written_by={}), StepResult(step='rock_quality', success=True, message='', method='RQI_FZI_phi_z', input_curves=['PERM', 'PHIE'], output_curves=['RQI', 'FZI', 'PHI_Z'], parameters={}, decisions=['RQI = 0.0314*sqrt(k/phi), PHI_Z = phi/(1-phi), FZI = RQI/PHI_Z; k is PERM; phi is PHIE'], data=None, also_written=[], curves_removed=[], parameter_notes={}, written_by={}), StepResult(step='bvw', success=True, message='', method='PHIE_x_SW', input_curves=['PHIE', 'SW'], output_curves=['BVW'], parameters={}, decisions=['BVW = PHIE * SW'], data=None, also_written=[], curves_removed=[], parameter_notes={}, written_by={}), StepResult(step='mhi', success=True, message='', method='moveable_HC_index', input_curves=['SW', 'SXO'], output_curves=[], parameters={'diagnostic_sxo_samples': 0, 'total_samples': 2625, 'rule': 'MHI only where SXO has invaded-zone support from RSHA/RXO/RESS plus RMF'}, decisions=['MHI not computed: SXO here is only the SW^(1/5) estimate, without invaded-zone resistivity'], data=None, also_written=[], curves_removed=[], parameter_notes={}, written_by={}), StepResult(step='net_pay', success=True, message='', method='cutoff_flags', input_curves=['VCL', 'PHIE', 'SW'], output_curves=['NET_ROCK', 'NET_RES', 'NET_PAY', 'RESFLAG', 'SEALFLAG', 'NET_EXCLUSION', 'CROSSOVER_FLAG', 'PRIME_OIL_TARGET'], parameters={'vcl_cutoff': 0.4, 'phie_cutoff': 0.08, 'sw_cutoff': 0.6, 'lithology': 'clastic', 'seal_vcl_cutoff': 0.8, 'cutoff_source': {'vcl_cutoff': 'lithology_family_standard', 'phie_cutoff': 'lithology_family_standard', 'sw_cutoff': 'lithology_family_standard'}, 'cutoffs_by_family': {'clastic': {'vcl_cutoff': 0.4, 'phie_cutoff': 0.08, 'sw_cutoff': 0.6, 'samples': 2625}}, 'excluded_from_net_reservoir_and_pay': {'bad_hole': {'samples': 330, 'net_rock_samples_removed': 0, 'net_reservoir_samples_removed': 31, 'net_pay_samples_removed': 7, 'net_rock_removed': 0.0, 'net_reservoir_removed': 4.72, 'net_pay_removed': 1.07, 'depth_unit': 'm'}}}, decisions=['NET_ROCK: VCL < 0.4 -> 648 samples (98.8 m)', 'NET_RES: NET_ROCK and porosity > 0.08 -> 559 samples (85.2 m); porosity is PHIE', 'NET_PAY: NET_RES and SW < 0.6 -> 230 samples (35.1 m)', 'vcl_cutoff, phie_cutoff, sw_cutoff not set: lithology-family standards (STANDARD_CUTOFFS) for 2625 clastic samples', 'Bad hole (BAD_HOLE = 1): density, neutron, PHIE and SW are unreliable: 330 samples left out of NET_RES and NET_PAY, removing 4.7 m of net reservoir and 1.1 m of net pay', 'SEALFLAG: VCL >= 0.8 -> 736 samples (112.2 m)', 'CROSSOVER_FLAG from hydrocarbon analysis -> 0 samples (0.0 m)', 'Hydrocarbon indicators computed: petrophysical hydrocarbon indicators, geophysical hydrocarbon indicators, reservoir quality for hydrocarbons, integrated hydrocarbon potential'], data=None, also_written=[], curves_removed=[], parameter_notes={}, written_by={'CROSSOVER_FLAG': 'hydrocarbon analysis', 'PRIME_OIL_TARGET': 'hydrocarbon analysis'})], steps_skipped=['spectral_gamma', 'elemental_spectroscopy', 'rmf', 'hc_correction', 'porosity_refinement', 'core_correction'], specific_steps_skipped={'spectral_gamma': 'Not run by the interpretation workflow; use petrophys.interpretation.geochemistry.interpret_spectral_gamma directly', 'elemental_spectroscopy': 'Not run by the interpretation workflow; use petrophys.interpretation.geochemistry.interpret_elemental_spectroscopy directly', 'rmf': "No mud-filtrate resistivity source: set mud_type='OBM', rmf_at_meas_temp, rmf_salinity_ppm, rmf_chlorides_mg_l or rm, or provide RMF, CLFL or RM in the LAS header", 'hc_correction': 'apply_hc_correction=False (hydrocarbon correction is opt-in)', 'porosity_refinement': 'Not run by the interpretation workflow; porosity is computed once in the porosity step', 'core_correction': 'Missing core porosity (PHIC/CPOR/CPOR-AMB) or peer-well core (use_peer_core with peer_wells)'}, errors=[], warnings=['No bottom-hole temperature (bht or header BHT): temperatures follow an assumed 30 C/km gradient, which sets the Rw and Rmf temperature corrections.', 'vclay: the clean GR pick 35.2 API (P5) was lowered to 20, so GR reads rock at that level as clay. If clean rock here is radioactive (feldspathic or volcanic sands), set gr_min from a known clean sand (per zone with GR_MIN_Z1); a value you set is used as given.', 'lithology: PEF set aside: in 92% of 357 clean porous samples the apparent matrix density is quartz-like (< 2.67 g/cm3) but the apparent matrix U calcite-like (> 10 b/cm3), the signature of barite-weighted mud; minerals solved without PEF', "Bad hole removed 1.07 m of net pay (BAD_HOLE at 330 of 2625 samples). Check the flag against the caliper and DRHO; bad_hole={'drho': ..., 'cali': ...} sets its thresholds and skip_steps=['bad_hole'] keeps the pay.", 'Net pay where the gamma ray reads shale and neutron-density clean, VCL_GR above VCL_ND by more than 0.5: 2804.9-2805.66 m (VCL_GR 0.78, VCL_ND 0.11), 2851.99-2852.75 m (VCL_GR 0.66, VCL_ND 0.01). VCL takes the lower value, so these beds count as clean rock; check the density and neutron there (a density read too light in bad hole or near a casing shoe, gas, heavy minerals).'], lithology_domain='clastic', rw_computed=array([0.07514032, 0.07513751, 0.07513471, ..., 0.06844457, 0.06844224,
0.06843992], shape=(2625,)), rmf_computed=None, rcl_computed=4.234, temperature_gradient=1.64592, context_profile=None, preparatory_steps=[], post_workflow_steps=[], zone_results=[], zone_names=[], zone_intervals=[])
Interpret¶
Interpreting, summarizing and exporting work as in the Quickstart. What
differs is what your files leave out. A CSV has no header, so there is no
bottom-hole temperature or mud-filtrate resistivity; result.warnings and the
skipped steps say what was assumed or left out.
well = pp.read("my_logs.csv", depth_column="MD", depth_unit="m", well_name="30/6-5",
formations=pp.sample("formations_30_6-5"),
lithology=pp.sample("lithology_30_6-5"))
result = pp.interpret(well, rw=0.07, rw_meas_temp="230 degF")
result.warnings
['Marl uses the limestone matrix and carbonate cutoff family. This is a routing convention, not a calibrated marl model; check clay correction and supply project-specific cutoffs.',
'No bottom-hole temperature (bht or header BHT): temperatures follow an assumed 30 C/km gradient, which sets the Rw and Rmf temperature corrections.',
'vclay: the clean GR pick 35.2 API (P5) was lowered to 20, so GR reads rock at that level as clay. If clean rock here is radioactive (feldspathic or volcanic sands), set gr_min from a known clean sand (per zone with GR_MIN_Z1); a value you set is used as given.',
'lithology: PEF set aside: in 92% of 356 clean porous samples the apparent matrix density is quartz-like (< 2.67 g/cm3) but the apparent matrix U calcite-like (> 10 b/cm3), the signature of barite-weighted mud; minerals solved without PEF',
"Bad hole removed 0.76 m of net pay (BAD_HOLE at 330 of 2625 samples). Check the flag against the caliper and DRHO; bad_hole={'drho': ..., 'cali': ...} sets its thresholds and skip_steps=['bad_hole'] keeps the pay.",
'Net pay where the gamma ray reads shale and neutron-density clean, VCL_GR above VCL_ND by more than 0.5: 2804.9-2805.66 m (VCL_GR 0.78, VCL_ND 0.11), 2851.99-2852.75 m (VCL_GR 0.66, VCL_ND 0.01). VCL takes the lower value, so these beds count as clean rock; check the density and neutron there (a density read too light in bad hole or near a casing shoe, gas, heavy minerals).']
The second warning is the missing temperature: an assumed 30 °C/km gradient
sets the Rw and Rmf temperature corrections. The rmf step did not run:
result.specific_steps_skipped["rmf"]
"No mud-filtrate resistivity source: set mud_type='OBM', rmf_at_meas_temp, rmf_salinity_ppm, rmf_chlorides_mg_l or rm, or provide RMF, CLFL or RM in the LAS header"
Supply the values with bht and rmf_at_meas_temp (or the mud report’s
filtrate chlorides, rmf_chlorides_mg_l), or write the CSV well to LAS with
those values in its header (Input templates lists the parameters).
The input_context step records where the lithology came from. By default
attached lithology intervals come first, then a recognized lithology log in the
LAS, then the lithology computed from the logs; lithology_source="external",
"vendor", "computed" or "config" selects one, and a source you request
that is missing fails the run. Here the attached intervals were selected:
result.step("input_context").decisions
['Selected external lithology; alternate sources were retained',
'Using 20 attached formation intervals for formation-specific core permeability calibration']
result.formation_summary(), result.to_las(...) and result.to_json(...)
then give the per-formation answer and the files, as in the Quickstart.
Next¶
What Petrophys can do maps the rest of the library, and Workflows takes the interpretation further: the trace, the settings, and the review of an answer before you use it.
The tutorials go deeper on loading and inspecting data and on formation and interval analysis: ranks, nested groups and per-formation results.