-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when LAS data contains text with spaces enclosed in double quotes #271
Comments
I've found a workaround which seems to be okay, passing a couple of regex substitutions with the LAS_CLEANERS = [
# matches two words within double quotes
(r'"([a-zA-Z]*) ([a-zA-Z]*)"', r'\1_\2'),
# matches three words within double quotes
(r'"([a-zA-Z]*) ([a-zA-Z]*) ([a-zA-Z]*)"', r'\1_\2_\3')
]
las = lasio.read('data/test_file.las', null_policy=LAS_CLEANERS) I'm not sure how to generalise this to further number of words. But this works for now :) |
Thanks for the report! That's a neat work-around. Unfortunately lasio is still only written to support numerical data sections (i.e. LAS v2), so I wouldn't expect that to work yet. I'd like to support text data sections but haven't had time to work on it. |
OK, fair enough. I'll close the issue for now then, as we have a simple workaround. |
No worries - it's certainly something I'd like to have implemented. Thanks for the example! |
Hi @kinverarity1 , I've realised my solution above has a major disadvantage - it turns off the default NULL_POLICY, so regular null values are ignored! Is there a way to use some custom regex substitutions, in combination with a NULL_POLICY from lasio.defaults? |
At the moment, if one or more of the columns are non-numeric, the NULL_POLICY fails to replace missing values with This is because when the below array is created Lines 456 to 458 in 817fb82
the array will be of type string (<U32), and the missing numbers in lasio.defaults.NULL_SUBS won't be matched, since we are comparing as string e.g. "-999" against a number like -999 .
|
Thanks @Anjum48 - I have opened a new issue for that. |
I am encountering an error trying to load a LAS file that has a paramaeter that sometimes contains spaces. This seem to occur for many LAS files that contain picks: the pick name is a text field which may contain spaces.
It is possible to replace these spaces with underscores, or something like that?
Here's an example LAS file:
Here is what I get from LASIO
The result is badly parsed:
PS thanks for your work on the library so far, it is proving tremendously useful!
The text was updated successfully, but these errors were encountered: