Skip to content

Add "rename_descriptions" method to SectionItems #305

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

Open
MSZeftawy opened this issue Mar 3, 2020 · 2 comments
Open

Add "rename_descriptions" method to SectionItems #305

MSZeftawy opened this issue Mar 3, 2020 · 2 comments

Comments

@MSZeftawy
Copy link

MSZeftawy commented Mar 3, 2020

Hi Kent,

I have been using LASIO for a week now and I think it has a large potential. Great job!

Some of the files I open has header and parameters section description same as mnemonic (150 to be exact). such as below;

~PARAMETER INFORMATION
BHT. N/A :BHT
BIT1. 127 :BIT1
BIT2. :BIT2
BIT3. :BIT3
BS. 127 :BS
BTF1. 0 :BTF1
BTF2. :BTF2
BTF3. :BTF3
BTT1. 269.01 :BTT1
BTT2. :BTT2
BTT3. :BTT3
CIRC. N/A :CIRC
CIRCT. N/A :CIRCT
CRES. N/A :CRES

As all the lasses I have got the same parameters, I defined a function to rename the description of them, sample of the code;

def moddescr():
las.well.STRT.descr='START DEPTH'
las.well.STOP.descr='STOP DEPTH'
las.well.STEP.descr='STEP INTERVAL'
las.well.COMP.descr='COMPANY'
las.well.FLD.descr='FIELD'
las.well.LOC.descr='LOCATION'
las.well.SRVC.descr='SERVICE COMPANY'
las.well.CTRY.descr='CTRY'
las.well.STAT.descr='STATE'
las.well.CNTY.descr='COUNTRY'
las.well.DATE.descr='LOGGING DATE'
las.params.BHT.descr='BOREHOLE TEMPERATURE AT TD'
las.params.BIT1.descr='BIT 1 SIZE MM'
las.params.BIT2.descr='BIT 2 SIZE MM'
las.params.BIT3.descr='BIT 3 SIZE MM'
las.params.BS.descr='BIT SIZE'
las.params.BTF1.descr='BIT 1 START DEPTH'
las.params.BTF2.descr='BIT 2 START DEPTH'
las.params.BTF3.descr='BIT 3 START DEPTH'
las.params.BTT1.descr='BIT 1 END DEPTH'
las.params.BTT2.descr='BIT 2 END DEPTH'
las.params.BTT3.descr='BIT 3 END DEPTH'
las.params.CIRC.descr='STOP CIRCULATION TIME'
las.params.CIRCT.descr='TIME SINCE CIRCULATION'
las.params.CRES.descr='MUD CACKE RESISTIVITY'

You may have noticed that CNTY is used as COUNTRY instead of CTRY.

Then I called the function just before writing the new files and it worked great. A sample below;

las=lasio.read(filename)
moddescr()
lasio.writer.write(las,newlas,version=2,wrap=None,STRT=None,STOP=None,STEP=None,fmt='%.2f',len_numeric_field=11, data_width=None, header_width=60)

And the output;

~Params ----------------------------------------------------
BHT . N/A : BOREHOLE TEMPERATURE AT TD
BIT1 . 127 : BIT 1 SIZE MM
BIT2 . : BIT 2 SIZE MM
BIT3 . : BIT 3 SIZE MM
BS . 127 : BIT SIZE
BTF1 . 0 : BIT 1 START DEPTH
BTF2 . : BIT 2 START DEPTH
BTF3 . : BIT 3 START DEPTH
BTT1 . 269.01 : BIT 1 END DEPTH
BTT2 . : BIT 2 END DEPTH
BTT3 . : BIT 3 END DEPTH
CIRC . N/A : STOP CIRCULATION TIME
CIRCT . N/A : TIME SINCE CIRCULATION
CRES . N/A : MUD CACKE RESISTIVITY

It would be great if you could add a header/parameters tables that contain standard mnemonics and corresponding description with a new separate function to apply the description upon user request. Or as optional input in las.writer function.

Plesase let me know if I can help.

Cheers
Moustafa

@MSZeftawy MSZeftawy changed the title Parameters describtion Automation Parameters description Automation Mar 4, 2020
@kinverarity1
Copy link
Owner

Thanks for the suggestion @MSZeftawy!

I think that lasio could help with this by providing a keyword argument to map descriptions against mnemonics, using a dict-like object, similar to how pandas does in many places. Very similar to your function.

@kinverarity1 kinverarity1 changed the title Parameters description Automation Add "rename_descriptions" method to SectionItems Apr 9, 2021
@kinverarity1
Copy link
Owner

Note to self: stay aligned to whatever welly chooses to do in this space (e.g. related: renaming curves agilescientific/welly#213)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants