equinor / dlisio

Python library for working with the well log formats Digital Log Interchange Standard (DLIS V1) and Log Information Standard (LIS79)
https://dlisio.readthedocs.io/en/latest/
Other
121 stars 39 forks source link

Incorrect format version in Visible Record #408

Closed lucasaguiar26 closed 2 years ago

lucasaguiar26 commented 2 years ago

I'm having a problem while trying to load several dlis files. Some of them I can open normally, but others (even from the same field) I can't. I'm using version 0.3.5 of dlisio and I get the following error when I try to load them:

RuntimeError: Problem: rp66: Incorrect format version in Visible Record 5656 Where: dlis::findoffsets (indexing logical file) Severity: critical Action taken: Indexing is suspended at last valid Logical Record Debug info: Physical tell: 46313876 (dec), Logical Record tell: 46286676 (dec), Logical Record Segment tell: 46303317 (dec)

I searched about it and in dlisio documentation 2.1.13 0.2.0 - 2020.06.04 it says that " dlisio no longer accepts files where the last Visible Record is truncated, but the last Logical Record is intact. Support for such truncated files was never intended in the first place, but happened to work". But I'm not sure if this is really my case.

Is there a way that I can open these dlis files with dlisio? Maybe a way to avoid this error?

achaikou commented 2 years ago

Hi, You can use dlisio error handling to read as much data as possible from a broken file.

Below should return you all the data that was retrieved before error occurred

from dlisio.common import ErrorHandler, Actions

handler = ErrorHandler(critical=Actions.LOG_ERROR)
with dlis.load(path, error_handler=handler) as files:
    for f in files:
        ...

Please be aware that data integrity in that case would be uncertain, especially in the few latest retrieved records.

It's impossible to say what exactly causes the error in your case as there are a few possible explanations (docs are not merged yet). Only manual file investigation can decide if further data is lost completely (file is zeroed-out), or if some of it can be retrieved still. Anyway it can't be done automatically with dlisio.

lucasaguiar26 commented 2 years ago

Thanks! I managed to open them with your tip