JustinGOSSES / wellioviz

d3.js v5 visualization of well logs
https://justingosses.github.io/wellioviz/#introduction
Apache License 2.0
49 stars 12 forks source link

Cannot read property 'DEPT' of undefined #112

Closed almersawi closed 1 year ago

almersawi commented 3 years ago

Describe the bug When trying to display a log after .Las file read I face this error. But this doesn't happen in all Las files I tried

ERROR TypeError: Cannot read property 'DEPT' of undefined at Object.curveBox (index.js:940)

dcslagel commented 3 years ago

Could you paste an example LAS file that will cause the error? An example will help to analyze the issue. Thanks.

JustinGOSSES commented 3 years ago

Thanks for the error report @almersawi

I suspect the name of the depth curve is hard coded somewhere in the code that you're trying to run. I've gotten the same error before when I've done that.

Something in the code you're running states that the name of the depth curve is 'DEPT'. When that curve name doesn't exist in a LAS file, your code can't find it and will produce that error.

I've loaded a well into the demo webpage that had a depth curve named "DEPTH2" and it didn't produce the error, so I suspect the problem isn't there? https://justingosses.github.io/wellioviz/demo.html

Can you tell us whether you get this error in one of the demos or how you're using wellioviz? It would help debug. Thank you.

almersawi commented 3 years ago

Thanks for reply @JustinGOSSES this is my code workflow:

  1. The user upload his .Las file
  2. After parsing it I load the las headers into a select-option drop down where the user choose the depth header he wants. So of course the depth header is not hard coded.
  3. The user choose the log he wants to view. Then all the data is sent to wellioviz where I make a template and get data depending on the chosen depth header and chosen log header
almersawi commented 3 years ago

@JustinGOSSES NOTE: the file las file that produces this error can not be read with wellio and gives me this error when I try to load it to wellioviz demo page

Uncaught TypeError: Cannot read property 'split' of undefined at splitLineofType1 (bundle.js:22171) at las2json (bundle.js:22199) at convert_and_startHelpers (main.js:139) at HTMLButtonElement.onclick (demo.html:98)

So, I used another package to read this file. The parsing process succeeds but wellioviz gives me the mentioned error regarding to depth header

JustinGOSSES commented 3 years ago

Hmm, sounds like maybe you have an edge case in terms of how the LAS file is built. Could you share the file? If log is proprietary, maybe change the name and replace all the curve values with random numbers?

dcslagel commented 3 years ago

@almersawi, Is there an error message when trying to read the file with Wellio.js instead of Wellioviz?

Also if the file is proprietary, you could run it through LasCheck, https://github.com/MandarJKulkarni/lascheck, and see if it reports any LAS non-conformities. LasCheck is a python based tool so you would need python install for this to work.

pip install lascheck
python
 >>> las = lascheck.read('sample.las')
 >>> las.check_conformity()
 >>> las.get_non_conformities()

Thanks, DC

dcslagel commented 3 years ago

Triage notes for Uncaught TypeError: Cannot read property 'split' of undefined at splitLineofType1 (bundle.js:22171) at las2json (bundle.js:22199) at convert_and_startHelpers (main.js:139) at HTMLButtonElement.onclick (demo.html:98)

This looks like it is occurring after wellio (via wellioviz) parses the ~V section then parses the 'WRAP' line. However the 'WRAP' line seems to be undefined causing the 'split' to be undefined on an empty object at splitLineofType1().

Is it possible the LAS file is in an encoding that wellio.js/wellioviz is unfamiliar with?

JustinGOSSES commented 3 years ago

One example of determining encoding: https://stackoverflow.com/questions/3710374/get-encoding-of-a-file-in-windows @almersawi

JustinGOSSES commented 1 year ago

closing as got now response enabling full debugging