转换器的LAS文件到Python字典和JSON文件

las-converter的Python项目详细描述


LAS 2.0读卡器和JSON转换器

这个包对于读取las文件并将其转换为pythondictjson非常有用。

las(log ascii标准)是一个结构化的ascii文件,包含日志曲线数据和头信息。更多detail

LAS文件示例

~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

请参阅完整的las文件here

安装

pip install las-converter

如何使用

具有file输入的LAS转换器。见here

fromLASimportConverterc=Converter()# create converter objectlog=c.set_file("file.las")#return LogWrapper# get sectiondata=log.dataversion=log.versioncurve=log.curveparameter=log.parameterwell=log.wellother=log.other# or get dictionarylog_in_dict=log.get_dict()# or print on json format and save to disklog_in_json=log.get_json("outfile_name")

服务器应用程序(烧瓶)

输入为stream的las转换器。见here

# server app for handling uploadfromflaskimportrequestfromLASimportConverter@app.route('/upload',methods=['GET','POST'])defupload_file():ifrequest.method=="POST":f=request.files['file']# read streamstream=f.stream.readlines()# code for Las Converterc=Converter()log=c.set_stream(stream)# or get only assci/datadata=log.data

输出

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]}})
Pythondict

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]}

detail

贡献者

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java在ArrayList中比较数字   java在Kotlin中使异步调用同步   让“Scala编程”junit示例在IntelliJ中工作的java问题   java Servlet侦听器未在ContextListener中设置属性   将Microsoft SQL Server数据库连接到我的Java项目   加载资源时出现java“需要注册工厂”异常   java如何使用POI检查excel中的重复记录?   java如何更改机器生成的代码   java如何确保重写的方法是同步的   用Spring编写Hibernate时的java XML奥秘   java管理mysql数据库中存储的用户权限   java如何运行。来自Javascript的jar方法   java我想在Web应用程序中进行身份验证&对桌面应用程序使用相同的凭据。我该怎么做?