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

Add ability to skip record with invalid type #435

Closed Charles-HL closed 3 months ago

Charles-HL commented 5 months ago

I have multiple LIS files with this error:

Problem: iodevice::index_record: Found invalid record type (150) when reading header at ptell (4)
Where: dlisio.lis.load: file /data/XXXXXXXXXXX.lis
Severity: critical Action taken: Indexing stopped at physical tell 6 (dec)

It would be nice to have the possibility to skip records with invalid type when reading the files.

achaikou commented 5 months ago

Hi,

Any critical error means that something is wrong with the guide information that is used to parse the file. We don't know what is the underlying problem, why we don't see the value protocol specifies. Thus the only sane thing to do is to stop parsing. Anyway we have no clue anymore where to search for the next record.

It can be that these files are not LIS 79 files at all as problems already at byte 4 usually happen when opening random non-LIS file. Here you can find a valid LIS file. You can try to open it (or any of your own files that were read correctly) and your questionable file in the binary editor and check if their structures are somewhat similar.