PETROPHYSICS.IO
DOCUMENTATION · RELEASE 22

LAS formats and datasets

Import versions through 3.0, choose the active table and retain typed fields.

All four tools use the same local LAS reader. A file's version and table structure are interpreted together; changing VERS alone is not a valid conversion.

Inputv22 reader behavior
LAS 1.0Legacy header-order compatibility; numeric log records.
LAS 1.2Legacy well-header conventions; wrapped or unwrapped records.
LAS 2.0Numeric logs; wrapped/unwrapped SPACE, TAB or COMMA records.
LAS 2.1Compatible extension of 2.0; an import note identifies this path.
LAS 3.0Associated data/definition sections, multiple tables and runs, typed fields and flattened array channels.

The reader handles section names case-insensitively. In LAS 3.0 it uses full names and explicit associations, so a core table is never mistaken for a curve-definition section. Duplicate mnemonics retain separate column IDs.

Import and choose a table

Choose a LAS in Log Viewer, Crossplot, Histogram or Python. The LAS dataset selector appears for a file with more than one table. Its entries show names and row counts. Numeric log data is preferred initially; other tables remain available for inspection.

Selecting another table resets calculated curves and the view in that tool. Your Python script stays in the editor; the kernel resets. Save a project first if you need the current settings/results. Project JSON includes the selected dataset identity, so equally sized tables are not interchangeable. Lock dock shares the selected table along with the complete source file. A tool that cannot use that table reports the reason and retains its previous usable data.

Download original LAS downloads the full decoded source text as UTF-8. It includes all source tables and metadata, with no calculated additions. It is separate from exporting the parsed dataset with calculated results. It does not preserve an input file's original byte encoding.

Numeric plots and typed fields

Crossplot and Histogram use numeric columns. A file with one numeric column can still be imported; Crossplot initially uses it on both axes. Log Viewer requires a usable depth channel; loading date/time data does not turn its index into depth. Array members such as NMR[1], NMR[2] appear as separate channels with array/spacing metadata.

Text, date/time and DMS fields are preserved. They are not silently converted to zero or inferred as numeric plotting curves. Date/time values keep the original spelling/format rather than an assumed timezone. Integers outside JavaScript's safe integer range are retained exactly in typed table data and Python; their unsafe plotting values are missing instead of rounded silently.

Python syntax

import pandas as pd

print(well.las_version, well.dataset_id, well.dataset_name)
for table in well.datasets:
    print(table.id, table.name, table.kind, table.row_count)

table = well.dataset(well.datasets[-1].id)
frame = table.to_dataframe()
print(frame.head())
print(table.headers)

# Current numeric calculations still use the active table's rows.
gr = well.curve("GR").values
well.add_curve("GR_DOUBLE", gr * 2, unit="API", description="GR multiplied by two")

well.dataset(id_or_unique_name) returns a snapshot accessor; it does not switch the website's active table. Each table has .curves, .curve(id_or_mnemonic), .index, .headers, .warnings and .to_dataframe(). Numeric values use NumPy arrays; text/date values use object arrays. Use pandas.to_datetime with the correct explicit format when conversion is needed.

well.index preserves the source index. well.depth remains numeric for numeric index/depth data; a nonnumeric index produces missing depth values, and well.interval(...) does not manufacture a depth mask. Published result curves must contain one finite number or NaN per active source row.

Browser API syntax

const tables = Petrophysics.list_las_datasets();
const id = tables.datasets[0].id;
const table = Petrophysics.get_las_dataset({datasetId: id});
// table.values preserves typed source cells; table.columns is numeric projection.
await Petrophysics.select_las_dataset({datasetId: id});
const report = await Petrophysics.inspect_dataset();

// Choose a table during import, or omit datasetId for the preferred default.
await Petrophysics.import_las({text: lasText, filename: "well.las", datasetId: id});
const original = await Petrophysics.download_original_las({download: false});

The dataset APIs require a loaded file. Returned table arrays are copies. Dataset IDs are local to their source LAS and should be read from list_las_datasets(). Importing another file must not reuse an unrelated table ID.

Export with calculated curves

Legacy numeric inputs export LAS 2.0. Nonnumeric legacy data cannot be exported as numeric 2.0; the exporter reports the limitation instead of replacing text with missing values. LAS 3.0 inputs retain their source tables, text fields, definitions and metadata on export. Adding committed calculations updates the active table using a separate definition when needed, so other tables sharing the old definition keep their column count.

The export uses parsed active rows; any malformed active rows skipped during import are reported. The original-source download keeps the source text independently. A calculated value equal to the declared NULL code is ambiguous in a source-preserving 3.0 export and is rejected with an explanation. Unwrapped LAS 3.0 is required to export calculated additions from a 3.0 file.

Limits and import notes

Sources

CWLS's LAS 3.0 File Structure specification defines the added table/association structures and types. lasio's official API documentation documents its 1.2/2.0 coverage, partial 3.0 coverage, legacy header ordering and dtype behavior. The matrix above describes this website's implementation and limits, rather than claiming that lasio certifies it.