Null Values
RP66 V1 has no universal null/absent value. Each logging company uses its own sentinel values to indicate absent, invalid, or out-of-range samples.
Built-in null set
The library exports a NULL_VALUES Set<number> containing the most
common vendor sentinels:
import { NULL_VALUES } from '@geoharkat/dlis-parser';
console.log(NULL_VALUES.has(-9999.25)); // true
console.log(NULL_VALUES.has(1e30)); // true
The complete built-in set:
Applying null masking
The library does not replace null values with NaN automatically —
all values are returned as decoded. Apply your own mask after decoding:
import { NULL_VALUES } from '@geoharkat/dlis-parser';
function maskNulls(arr) {
return arr.map(v =>
!Number.isFinite(v) || NULL_VALUES.has(v) ? NaN : v
);
}
const result = frame.decode();
const gr = maskNulls(Array.from(result.data['GR']));
Custom null values
If your file uses a non-standard null sentinel, add it before decoding:
import { NULL_VALUES } from '@geoharkat/dlis-parser';
NULL_VALUES.add(-999.0); // add a custom sentinel
NULL_VALUES.add(9998.0);
Note
NULL_VALUES is a module-level singleton. Changes persist for the
lifetime of the module instance. Avoid mutating it in library code that
might be consumed by other users.