In [1]:
import lasio
import os
l = lasio.read(os.path.join("..", "tests", "examples", "6038187_v1.2_short.las"))
The information in a LAS file's header is all parsed and available through the sections of the header.
So to start at the top and view the ~Version section:
In [2]:
l.version
Out[2]:
each item here is a HeaderItem, which is a kind of attribute dictionary - very easy to use either through items or attributes:
In [3]:
l.version.VERS
Out[3]:
In [4]:
l.version['VERS']
Out[4]:
In [5]:
l.well
Out[5]:
Let's say we'd like to add some information about the country this log was taken in.
We can do it easily by directly assigning the values:
In [6]:
l.well.CTRY = 'Australia'
In [7]:
l.well.CTRY
Out[7]:
Now let's have a look at the curves
In [8]:
l.curves
Out[8]:
Notice the units for PR are incorrect - to change that access the unit attribute directly:
In [9]:
l.curves.PR.unit = 'ohmm'
In [10]:
l.curves.PR
Out[10]:
And finally the Parameter section:
In [11]:
l.params
Out[11]:
If you'd prefer to see a section as a dictionary you can with the dictview() method:
In [12]:
l.params.dictview()
Out[12]:
In [ ]:
In [ ]:
In [ ]: