Frame
A Frame wraps one FRAME EFLR object plus all the FDATA IFLR records that
belong to it. Each frame defines one continuous depth (or time) track and the
set of channels recorded along it.
Properties
- Frame.key
OBNAME triplet string
"origin/copy/name"that uniquely identifies this frame within the logical file.- Type:
string
- Frame.name
The frame name as stored in the FRAME EFLR OBNAME.
- Type:
string
- Frame.description
Optional free-text description from the DESCRIPTION attribute.
- Type:
string
- Frame.indexType
The type of the index channel — typically
"BOREHOLE-DEPTH","TIME", or"VERTICAL-DEPTH". May be an empty string if the attribute is absent.- Type:
string
- Frame.direction
Recording direction of the index channel:
"INCREASING"(tool going down / time advancing) or"DECREASING"(tool pulled up).- Type:
string
- Frame.spacing
Nominal step between consecutive index values (depth increment or sampling interval).
nullwhen not specified.- Type:
number | null
- Frame.channelNames
Channel names in recording order (first channel is the index channel).
- Type:
string[]
- Frame.channels
Fully resolved ChannelInfo objects in recording order. Channels not found in the registry are omitted.
- Type:
ChannelInfo[]
Methods
- Frame.decode()
Decode all FDATA IFLR records belonging to this frame into typed arrays.
- Returns:
A DecodeResult object, or
nullif there are no FDATA records for this frame.- Return type:
DecodeResult | null
const result = frame.decode(); if (!result) { console.log('no data'); return; } console.log(result.frameCount, 'rows'); // Scalar channel const depth = result.data['DEPTH']; // Float64Array, length = frameCount // Array channel (e.g. waveform with 500 samples per row) const stride = result.strides['VDL']; // 500 const vdl = result.data['VDL']; // Float64Array, length = frameCount * 500 const row0 = vdl.slice(0, stride); // first waveform
Note
All numeric values are promoted to
Float64Arrayregardless of the original representation code. Signed 16-bit waveform samples (RC.SNORM) are faithfully preserved in the double buffer.
- Frame.toCSV([opts])
Export all scalar channels to a CSV string (one row per depth sample, header row with channel names).
- Arguments:
opts (
object) – Optional export options.opts.channels (
string[]) – Subset of channel names to include. Defaults to all scalar channels.opts.nullStr (
string) – String to emit for null/absent values. Defaults to''.
- Returns:
CSV-formatted string.
- Return type:
string
// All scalar channels const csv = frame.toCSV(); // Only specific channels, NaN shown as '-9999.25' const csv2 = frame.toCSV({ channels: ['DEPTH','GR','CALI'], nullStr: '-9999.25' }); // Save (Node.js) import { writeFileSync } from 'fs'; writeFileSync('well.csv', csv);
- Frame.toLAS([opts])
Export all scalar channels to a LAS 2.0 string. The
~WELLsection is populated fromLogicalFile.origin.- Arguments:
opts (
object) – Optional export options.opts.channels (
string[]) – Subset of channel names to include.opts.nullValue (
number) – Numeric null marker in the output. Defaults to-9999.25.
- Returns:
LAS 2.0-formatted string.
- Return type:
string
const las = frame.toLAS({ channels: ['DEPTH', 'GR', 'CALI', 'RHOB'] }); writeFileSync('well.las', las);