You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
lasio incorrectly determines the number of columns in a multiline LAS file when the count of curves is a multiple of the number of columns. reader.inspect_data_section returns of "8" (number of columns in first line of pure data) istead of "-1" on my LAS File with 56 curves. I was only able to fix this by using the monkey patch by adding a check that:
# file lasio.las.LASFile
# in function read()
# How many curves should the reader attempt to find?
reader_n_columns = n_columns
len_curves = len(self.curves)
if reader_n_columns == -1 or (len_curves > reader_n_columns and len_curves % reader_n_columns == 0):
reader_n_columns = len(self.curves)
To Reproduce
Try open (or read) multiline LAS file where a count of columns data is a multiple of headers (mnemonics in '~C' sector).
Current behavior
Console write many warnings as is:
WARNING:lasio.reader:Curve #8 'DC' is defined in the ~C section but there is no data in ~A
WARNING:lasio.reader:Curve #9 'DGK' is defined in the ~C section but there is no data in ~A
WARNING:lasio.reader:Curve #10 'DN' is defined in the ~C section but there is no data in ~A
...
The number of data lines read is 7 times less than actual lines (56 // 8 = 7).
Expected behavior
LAS file readed correctly.
The text was updated successfully, but these errors were encountered:
Aycon3296
changed the title
lasio incorrectly determines the number of columns in a multiline LAS file when the length of curves is a multiple of the number of columns.
lasio incorrectly determines the number of columns in a multiline LAS file when the number of curves is a multiple of the number of columns.
Jan 25, 2024
Thanks for reporting - can you provide an example file? Also is the data section wrapped onto multiple lines and if so what is the value of the line with WRAP in the ~V section?
I had the same problem, it incorrectly determined wrong amount of columns. It was fixed by setting accept_regexp_sub_recommendations=False when reading in the file.
las = lasio.read("BOA.las", accept_regexp_sub_recommendations=False)
Describe the bug
lasio incorrectly determines the number of columns in a multiline LAS file when the count of curves is a multiple of the number of columns.
reader.inspect_data_section
returns of "8" (number of columns in first line of pure data) istead of "-1" on my LAS File with 56 curves. I was only able to fix this by using the monkey patch by adding a check that:To Reproduce
Try open (or read) multiline LAS file where a count of columns data is a multiple of headers (mnemonics in '~C' sector).
Current behavior
Console write many warnings as is:
The number of data lines read is 7 times less than actual lines (56 // 8 = 7).
Expected behavior
LAS file readed correctly.
The text was updated successfully, but these errors were encountered: