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

More debugging tools/information for dealing with issues in bytes processing #102

Open achaikou opened 5 years ago

achaikou commented 5 years ago

Let say DLISIO throws an error on opening some file. If user wants to dig deeper into binary and figure out where is the problem, user might appreciate more information than is currently provided.

Hence it might be worth considering to extend support for binary debug.

achaikou commented 4 years ago

More useful points for issues investigation:

  1. Include failure offset in error messages. Make all the main methods (findoffsets, stream.at, _readfdata, parse functions, etc) return offset of the failure point. When figuring out what exactly is wrong with the data this is the main point for manual investigation (one needs to jump to the correct point in the file). Major problem is however that this data is lost during high levels of processing.

  2. Fail early if virtual record header doesn't contain bytes "FF01". Currently _dlisvrl completely ignores 'FF' bytes and majorly ignores version (01). If we process these bytes, we might fail early when they are not as expected (so this is not start of new VR). Right now we do nothing with them probably with consideration of other possible versions of dlis. However in all seen files bytes always were "FF01", so it might be beneficial to drop that all together.

  3. Introduce the check "current logical record length (len) should be bigger than data remaining in VR (remaining)" in findoffsets. Without this check we often end up with negative value of remaining variable, which already is a clear indication that something went wrong.