Metadata-Version: 2.0
Name: lasio
Version: 0.7.2
Summary: Read/write well data from Log ASCII Standard (LAS) files
Home-page: https://github.com/kinverarity1/lasio
Author: Kent Inverarity
Author-email: kinverarity1@gmail.com
License: MIT
Keywords: science geophysics io
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Customer Service
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Other Audience
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: System :: Filesystems
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Dist: numpy
Requires-Dist: namedlist
Requires-Dist: ordereddict

lasio
=====

|PyPI Version| |PyPI Downloads| |Build Status| |Coverage Status| |GitHub Issues| |GitHub PRs| |Python Version| |PyPI Format| |MIT License|

This is a Python package to read and write Log ASCII Standard (LAS) files, used for borehole/well data (e.g. geophysical/geological/petrophysical logs). It is compatible with versions 1.2 and 2.0 of the LAS file specification, published by the `Canadian Well Logging Society`_. In principle it is designed to read as many types of LAS files as possible, including ones containing common errors or non-compliant formatting.

It is written entirely in Python and works on any platform. It depends on the following packages available on PyPI:

- `namedlist`_
- `ordereddict`_
- `numpy`_

Install
-------

To install from `PyPI`_ use:

.. code:: bash

    $ pip install lasio

If necessary this will download and install the package dependencies listed above.

Alternatively if you would like the latest version (which may contain bugs and errors) make sure you have `setuptools`_ and `git`_ installed and then use:

.. code:: bash

    $ git clone https://github.com/kinverarity1/lasio.git
    $ cd lasio
    $ python setup.py develop 

How to use
----------

Look at the `example IPython notebooks here <http://nbviewer.ipython.org/github/kinverarity1/lasio/tree/master/notebooks/>`__.
More detailed examples are coming.

Opening LAS files
~~~~~~~~~~~~~~~~~

To open a LAS file from disk:

.. code:: python

    >>> import lasio
    >>> l = lasio.read("example.las")

To open a LAS file from a URL:

.. code:: python

    >>> l = lasio.read("http://someplace.com/example.las")

Getting data
~~~~~~~~~~~~

The curve data are available as items:

.. code:: python

    >>> l["ILD"]
    [145, 262, 272, ...]

Or you can iterate through the curves:

.. code:: python

    >>> for c in l.curves:
    ...     print c.mnemonic, c.unit, c.data
    DEPT m [0, 0.05, 0.10, ...] 
    ILD mS/m [145, 262, 272, ...]

Character encodings
~~~~~~~~~~~~~~~~~~~

Three options:

1. Do nothing and hope for no errors_.

2. Specify the encoding (internally ``lasio`` uses the ``open`` function from `codecs`_ which is part of the standard library):

.. code:: python

    >>> l = lasio.read("example.las", encoding="windows-1252")

3. Install a third-party package like `cChardet`_ (faster) or `chardet`_ (slower) to automatically detect the character encoding. If these packages are installed this code will use whichever is faster:

.. code:: python

    >>> l = lasio.read("example.las", autodetect_encoding=True)

Note that by default ``autodetect_encoding=False``.

Development
-----------

-  0.7 (2015-08-08) - all tests passing on Python 2.6 through 3.4
-  0.6 (2015-08-05) - bugfixes and renamed from ``las_reader`` to ``lasio``
-  0.5 (2015-08-01) - Improvements to writing LAS files
-  0.4 (2015-07-26) - Improved handling of character encodings, other internal improvements
-  0.3 (2015-07-23) - Added Python 3 support, now reads LAS 1.2 and 2.0
-  0.2 (2015-07-08) - Tidied code and published on PyPI

Contributions
~~~~~~~~~~~~~

Contributions are very welcome. Please fork the project on GitHub and submit a pull request (PR) containing any changes you have made.

Suggested improvements, bug reports, shortcomings, desirable features, examples of LAS files which do not load as you expected, are all also welcome either via GitHub_ or email_.

Thanks to the following people in chronological order for their help:

-  @VelizarVESSELINOV
-  @diverdude

License
~~~~~~~

The code is freely available for any kind of use or modification under the MIT License.

.. |PyPI Version| image:: http://img.shields.io/pypi/v/lasio.svg
   :target: https://pypi.python.org/pypi/lasio/
.. |PyPI Downloads| image:: https://img.shields.io/pypi/dd/lasio.svg
   :target: https://pypi.python.org/pypi/lasio/
.. |Build Status| image:: https://travis-ci.org/kinverarity1/lasio.svg
   :target: https://travis-ci.org/kinverarity1/lasio
.. |Coverage Status| image:: https://coveralls.io/repos/kinverarity1/lasio/badge.svg?branch=master&service=github
   :target: https://coveralls.io/github/kinverarity1/lasio?branch=master
.. |GitHub Issues| image:: http://githubbadges.herokuapp.com/kinverarity1/lasio/issues.svg
   :target: https://github.com/kinverarity1/lasio/issues
.. |GitHub PRs| image:: http://githubbadges.herokuapp.com/kinverarity1/lasio/pulls.svg
   :target: https://github.com/kinverarity1/lasio/pulls
.. |Python Version| image:: https://img.shields.io/pypi/pyversions/lasio.svg
   :target: https://www.python.org/downloads/
.. |PyPI Format| image:: https://img.shields.io/pypi/format/lasio.svg
   :target: https://pypi.python.org/pypi/lasio/
.. |MIT License| image:: http://img.shields.io/badge/license-MIT-blue.svg
   :target: https://github.com/kinverarity1/lasio/blob/master/LICENSE
.. _Canadian Well Logging Society: http://www.cwls.org/las
.. _namedlist: https://pypi.python.org/pypi/namedlist
.. _ordereddict: https://pypi.python.org/pypi/ordereddict
.. _numpy: http://numpy.org
.. _PyPI: https://pypi.python.org/pypi/lasio
.. _setuptools: https://pypi.python.org/pypi/setuptools
.. _git: http://www.git-scm.com/
.. _codecs: https://docs.python.org/2/library/codecs.html#codecs.open
.. _cChardet: https://github.com/PyYoshi/cChardet
.. _chardet: https://pypi.python.org/pypi/chardet
.. _GitHub: https://github.com/kinverarity1/lasio/issues/new
.. _email: mailto:kinverarity@hotmail.com
.. _errors: https://docs.python.org/2.7/howto/unicode.html#encodings


