Skip to main content

LAS 2.0 Reader and Converter to JSON

This package useful for reading and converting the LAS file to python dict and json.

LAS (Log ASCII Standard) is a structured ASCII file containing log curve data and header information. For more detail.

LAS File Example

~VERSION INFORMATION
 VERS.                 2.0 :   CWLS LOG ASCII STANDARD - VERSION 2.0
 WRAP.                  NO :   SINGLE LINE PER DEPTH STEP
 CREA.                 1/30/2018 12:24:47 PM
#CREATED USING IP VERSION 3.6.2010.102 BY LELY ON 1/30/2018 12:24:47 PM
~WELL INFORMATION
#MNEM.UNIT       DATA                          DESCRIPTION MNEMONIC
#---------      ---------------------------   --------------------------
 STRT    .M         23.6220                   : START DEPTH
 STOP    .M         1522.1713                 : STOP DEPTH
 STEP    .M         0.1524                    : STEP VALUE
 NULL    .      -999.0000                     : NULL VALUE
 SRVC    .      SCH                           : Service Company/Logging company
 DATE    .      1/30/2018                     : LAS file Creation Date
 WELL    .      JPN-A                         : Well Name
 COMP    .      PT. Pertamina EP              : Company
 FLD     .      JEPON                         : Field
 STATE   .      JAWA TENGA                    : State
 COUNT   .      Indonesia                     : Country
 LOC     .      X                             : Location
 LATI    .      -6.9952777778                 : Latitude/Northing
 LONG    .      111.5247222222                : Longitude/Easting
 PDAT    .      MSL                           : Permanent Datum
 EPDAT   .      0.0000                        : Elevation of Permanent Datum
 LGMEA   .      KB                            : Log Measured from
 APDAT   .      169.0000                      : Elevation Above Permanent Datum
 RWS     .      -999                          : Def_Rw
 WST     .      -999                          : Def_Rwt
 CNTY    .      OW 700/39                     : County

~CURVE INFORMATION
#MNEM          UNIT     API CODE   Curve Type Comments
#---------- ---------- ----------  ---------- --------
 DEPTH     .M                    : Depth
 Perm      .md                   : perm

~A Log data section
#  DEPTH      Perm
  23.6220    0.0000
  23.7744 3001.4817
  23.9268 3001.4556
  24.0792 3030.4937
  24.2316 3028.0435
  24.3840 2960.1401

 ~Other  Information Section
The log digits for this well were hand digitized from poor half scale log
prints.  This  was  the  best  information  available  at  the  time.  Every attempt should be made to track down the original films. .Dec. 12,1990  John Doe, Petrophysics

see full LAS file here.

Installation

pip install las-converter

How to use

LAS converter with file input. see here.

from LAS import Converter

c = Converter() # create converter object

log = c.set_file("file.las") #return LogWrapper

# get section
data      = log.data
version   = log.version
curve     = log.curve
parameter = log.parameter
well      = log.well
other     = log.other

# or get dictionary
log_in_dict = log.get_dict()
# or print on json format and save to disk
log_in_json = log.get_json("outfile_name")

Server app (Flask)

LAS converter with stream input. see here.

# server app for handling upload
from flask import request
from LAS import Converter

@app.route('/upload', methods=['GET', 'POST'])
def upload_file():
    if request.method == "POST":
        f = request.files['file']

        # read stream
        stream = f.stream.readlines()

        # code for Las Converter
        c = Converter()
        log  = c.set_stream(stream)

        # or get only assci/data
        data = log.data

Output

JSON
(log = {
  "data": {
    "depth": [23.622, 23.7744, 23.9268, 24.0792, 24.2316, 24.384],
    "perm": [0.0, 3001.4817, 3001.4556, 3030.4937, 3028.0435, 2960.1401]
  }
})
Python dict

see detail.

log.data = {
    'depth': [23.622, 23.7744, 23.9268, 24.0792, 24.2316, 24.384],
    'perm': [0.0, 3001.4817, 3001.4556, 3030.4937, 3028.0435, 2960.1401]
}

see detail.

Contributors

Metadata

Release files for las-converter 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for las-converter 0.4.0
File Size Uploaded
las-converter-0.4.0.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for las-converter 0.4.0
File Interpreter ABI Platform
las_converter-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.2 kB

Release files / las-converter-0.4.0.tar.gz

Download URL las-converter-0.4.0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9976d5b57c233e177fb6f72974bce5005ab3212796f1b5c7a344e796dcd1e0e6
BLAKE2b-256 checksum
How to use checksums
4c40f94b12de149c2c777a28322cb22226b0b9bf625a6e31217561fc33366f15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

Release files / las_converter-0.4.0-py3-none-any.whl

Download URL las_converter-0.4.0-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f05c087c9bdaff8ab6513bb3203f8efb3fa482f3966871cbb6b4e9d0d6c9b5b
BLAKE2b-256 checksum
How to use checksums
17d8bffaca0d1da761522abae79a5df48eb397e94bed808290b9569f698efa70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page