lasio icon indicating copy to clipboard operation
lasio copied to clipboard

Warn/check for ~ASCII header row

Open kinverarity1 opened this issue 8 years ago • 5 comments

Most software puts the curve names as column headers on the line beginning with "~A". We should have scripts to check for this, cross-check to see if they match the curve mnemonics in ~C, and create or delete the row.

kinverarity1 avatar Jul 25 '15 03:07 kinverarity1

:+1:

VelizarVESSELINOV avatar Aug 05 '15 13:08 VelizarVESSELINOV

Bump. I need this soon.

kinverarity1 avatar Oct 09 '18 07:10 kinverarity1

Some discussion...

If we add this feature would it be always on? Or would it be controlled by a flag/parameter and what would be the default (off|on)?


If a ~A section includes curve-names and they match the curve-mnemonics in ~C then everything is okay.

If we checked and found that ~A curve-name differ from the ~C curve-mnemonics, what would be the rules for handling the difference? As an initial iteration we could display a WARNING that the ~A curve-names are found and differ.

Here are some of the possible differences that might be handled in future iterations:

  • a ~A curve-name or ~C curve-mnemonic is spelled the same except a few letters less than its counter-part
  • a ~A curve-name or ~C curve-mnemonic doesn't exist but its counter-part does
  • a ~A curve-name or ~C curve-mnemonic is a different name but meaning the same content as its counterpart. Would we even know? (AlasKA: The las file aliases: handles this, it could be an optional 'plugin' : https://github.com/FRI-Energy-Analytics/alaska)
  • either ~A curve-names or ~C curve-mnemonics has more names than the other. This is a case @harry-allerston mentions in https://github.com/kinverarity1/lasio/issues/83#issuecomment-881313094
the curve section defines:

curve_a
curve_b
curve_c
curve_d

but the ascii section defines

curve_a curve_c curve_d

dcslagel avatar Jul 16 '21 15:07 dcslagel

@dcslagel I think it would be dangerous to make things like this on by default in case users are not aware and data is ingested incorrectly. For example in my case I'm using lasio within my own batch process with it's own loader.. I have to suppress warnings from lasio to keep the log files readable. (maybe a bad idea but hey..)

ghost avatar Jul 27 '21 10:07 ghost

@dcslagel I'm thinking a kwarg on LASFile.read like curves_definition with options:

  • 'curves-only': read mnemonics from the ~Curves section only (current behaviour)
  • 'curves-then-data-header': read mnemonics from the ~Curves section. If there are additional undefined columns in the ~ASCII section, look for mnemonics in those defined on the ~A row (if they exist)

And then also a method on LASFile like add_data_section_header_row, which could replace the header row with whatever mnemonics are defined by the LASFile.curves section.

kinverarity1 avatar Jul 27 '21 22:07 kinverarity1