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

searched 200 bytes, but could not find visible record envelope pattern [0xFF 0x01] #391

Closed soso-maitha closed 3 years ago

soso-maitha commented 3 years ago

Hello,

We have been using dlisio library since a year, it works perfectly for 4 vendors (Baker, Schlumberger, Halliburton and Weatherford. However for 5th vendor we are getting the following error in the dlisio.load (dlisio.dlis.load) function. We would your support as we need to solve the issue.

Thanks in advance

`--------------------------------------------------------------------------- RuntimeError Traceback (most recent call last)

in 19 filePath = path + fileName 20 print(filePath) ---> 21 f_logical_file, *tail = dlisio.load(filePath) 22 ~\AppData\Local\Continuum\anaconda3\lib\site-packages\dlisio\load.py in load(path, error_handler) 106 try: 107 tapemarks = core.hastapemark(stream) --> 108 offset = core.findvrl(stream, offset) 109 110 # Layered File Protocol does not currently offer support for re-opening RuntimeError: searched 200 bytes, but could not find visible record envelope pattern [0xFF 0x01] `
ErlendHaa commented 3 years ago

Hi!

searched 200 bytes, but could not find visible record envelope pattern [0xFF 0x01]

A DLIS file should always start with a Visible Record Envelope, that has the unique identifier [0xFF 0x01]. Not finding it within the first 200 bytes of the file might mean one of the following:

1) The file is not actually a DLIS file (file extensions sometimes lie, and dlisio doesn't care about them. It only cares about the content of the file)

2) We have seen some DLIS files that include a whole lot of nonsense bytes at the start of the file. Sometimes it's padding, sometimes it's something else that we can't recognise.

Debugging this further is a bit hard, as you would need to know both a bit of hex and the internal byte structure of the files. A starting point would be to hexdump the first ~500 bytes and have a look at them. If you are allowed to - feel free to post the hexdump here and I'll try to add some more insights based on that.

soso-maitha commented 3 years ago

hello,

Thanks for your response. is there any function in dlisio library that extracts the first ~500 bytes using dlisio ? if i can get the piece of code that does that would be great. or i should i write it from scratch independently from dlisio library ?

ErlendHaa commented 3 years ago

Hi,

You'll have to do that without dlisio. If you are on linux or max you can run: hexdump -Cv -n 500 your_file.dlis in the terminal. On windows, I think you could get some third-party library, e.g. https://pypi.org/project/hexdump/ to do the job

soso-maitha commented 3 years ago

noted. thanks i will try

soso-maitha commented 3 years ago

hi, we tried with latest dlisio version dlisio.lis.load, we found that these files are LIS files not DLIS. Thank you so much!

regards,

ErlendHaa commented 3 years ago

Right, another case of file extensions that lie ¯_(ツ)_/¯