{"id":15358858,"url":"https://github.com/warrenweckesser/las","last_synced_at":"2025-09-04T12:49:56.270Z","repository":{"id":24288264,"uuid":"27683204","full_name":"WarrenWeckesser/las","owner":"WarrenWeckesser","description":"Python reader for Canadian Well Logging Society LAS (Log ASCII Standard) files.","archived":false,"fork":false,"pushed_at":"2025-01-11T03:36:02.000Z","size":114,"stargazers_count":38,"open_issues_count":0,"forks_count":15,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-02T04:09:37.692Z","etag":null,"topics":["io","python","well-logs"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WarrenWeckesser.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-12-07T20:15:18.000Z","updated_at":"2025-02-06T14:30:56.000Z","dependencies_parsed_at":"2025-01-01T00:11:39.781Z","dependency_job_id":"055cc140-51e5-4a57-ba69-eceebb640749","html_url":"https://github.com/WarrenWeckesser/las","commit_stats":{"total_commits":62,"total_committers":1,"mean_commits":62.0,"dds":0.0,"last_synced_commit":"525fa80c719d855af461edaeddce450ca010669b"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WarrenWeckesser%2Flas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WarrenWeckesser%2Flas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WarrenWeckesser%2Flas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WarrenWeckesser%2Flas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WarrenWeckesser","download_url":"https://codeload.github.com/WarrenWeckesser/las/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994121,"owners_count":21030050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["io","python","well-logs"],"created_at":"2024-10-01T12:43:14.704Z","updated_at":"2025-04-09T07:08:26.278Z","avatar_url":"https://github.com/WarrenWeckesser.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"las\n===\n\nThe ``las`` module implements a reader for LAS (Log ASCII Standard) well log files (LAS 2.0).\nFor more information about this format, see the Canadian Well Logging Society web page\n(https://www.cwls.org/products/).\n\nExample 1\n---------\n\nThe following file, \"example1.las\", is from \"LAS Version 2.0: A Digital Standard for\nLogs; Updated January 2014\"::\n\n    ~VERSION INFORMATION\n    VERS.                          2.0 :   CWLS LOG ASCII STANDARD -VERSION 2.0\n    WRAP.                          NO  :   ONE LINE PER DEPTH STEP\n    ~WELL INFORMATION \n    #MNEM.UNIT              DATA                       DESCRIPTION\n    #----- -----            ----------               -------------------------\n    STRT    .M              1670.0000                :START DEPTH\n    STOP    .M              1669.7500                :STOP DEPTH\n    STEP    .M              -0.1250                  :STEP \n    NULL    .               -999.25                  :NULL VALUE\n    COMP    .       ANY OIL COMPANY INC.             :COMPANY\n    WELL    .       ANY ET AL 12-34-12-34            :WELL\n    FLD     .       WILDCAT                          :FIELD\n    LOC     .       12-34-12-34W5M                   :LOCATION\n    PROV    .       ALBERTA                          :PROVINCE \n    SRVC    .       ANY LOGGING COMPANY INC.         :SERVICE COMPANY\n    DATE    .       13-DEC-86                        :LOG DATE\n    UWI     .       100123401234W500                 :UNIQUE WELL ID\n    ~CURVE INFORMATION\n    #MNEM.UNIT              API CODES                   CURVE DESCRIPTION\n    #------------------     ------------              -------------------------\n     DEPT   .M                                       :  1  DEPTH\n     DT     .US/M           60 520 32 00             :  2  SONIC TRANSIT TIME\n     RHOB   .K/M3           45 350 01 00             :  3  BULK DENSITY\n     NPHI   .V/V            42 890 00 00             :  4  NEUTRON POROSITY\n     SFLU   .OHMM           07 220 04 00             :  5  SHALLOW RESISTIVITY\n     SFLA   .OHMM           07 222 01 00             :  6  SHALLOW RESISTIVITY\n     ILM    .OHMM           07 120 44 00             :  7  MEDIUM RESISTIVITY\n     ILD    .OHMM           07 120 46 00             :  8  DEEP RESISTIVITY\n    ~PARAMETER INFORMATION\n    #MNEM.UNIT              VALUE             DESCRIPTION\n    #--------------     ----------------      -----------------------------------------------\n     MUD    .               GEL CHEM        :   MUD TYPE\n     BHT    .DEGC           35.5000         :   BOTTOM HOLE TEMPERATURE\n     BS     .MM             200.0000        :   BIT SIZE\n     FD     .K/M3           1000.0000       :   FLUID DENSITY\n     MATR   .               SAND            :   NEUTRON MATRIX\n     MDEN   .               2710.0000       :   LOGGING MATRIX DENSITY\n     RMF    .OHMM           0.2160          :   MUD FILTRATE RESISTIVITY\n     DFD    .K/M3           1525.0000       :   DRILL FLUID DENSITY\n    ~OTHER\n         Note: The logging tools became stuck at 625 metres causing the data \n         between 625 metres and 615 metres to be invalid.\n    ~A  DEPTH     DT    RHOB        NPHI   SFLU    SFLA      ILM      ILD\n    1670.000   123.450 2550.000    0.450  123.450  123.450  110.200  105.600\n    1669.875   123.450 2550.000    0.450  123.450  123.450  110.200  105.600\n    1669.750   123.450 2550.000    0.450  123.450  123.450  110.200  105.600\n\n\nSample python session::\n\n    \u003e\u003e\u003e import las\n    \u003e\u003e\u003e log = las.LASReader('example1.las')\n    \u003e\u003e\u003e log.start\n    1670.0\n    \u003e\u003e\u003e log.stop\n    1669.75\n    \u003e\u003e\u003e log.step\n    -0.125\n    \u003e\u003e\u003e log.null\n    -999.25\n    \u003e\u003e\u003e log.well.COMP\n    LASItem(name='COMP', units='', data='ANY OIL COMPANY INC.', descr='COMPANY')\n    \u003e\u003e\u003e log.well.COMP.value\n    'ANY OIL COMPANY INC.'\n    \u003e\u003e\u003e log.well.FLD.value\n    'WILDCAT'\n    \u003e\u003e\u003e print(log.other)\n         Note: The logging tools became stuck at 625 metres causing the data \n         between 625 metres and 615 metres to be invalid.\n\n\nThe log data is stored as a numpy structured array in ``log.data``::\n\n    \u003e\u003e\u003e log.data\n    array([(1670.0, 123.45, 2550.0, 0.45, 123.45, 123.45, 110.2, 105.6),\n           (1669.875, 123.45, 2550.0, 0.45, 123.45, 123.45, 110.2, 105.6),\n           (1669.75, 123.45, 2550.0, 0.45, 123.45, 123.45, 110.2, 105.6)], \n          dtype=[('DEPT', '\u003cf8'), ('DT', '\u003cf8'), ('RHOB', '\u003cf8'), ('NPHI', '\u003cf8'), ('SFLU', '\u003cf8'), ('SFLA', '\u003cf8'), ('ILM', '\u003cf8'), ('ILD', '\u003cf8')])\n    \u003e\u003e\u003e log.data['RHOB']\n    array([ 2550.,  2550.,  2550.])\n    \u003e\u003e\u003e log.data[0]\n    (1670.0, 123.45, 2550.0, 0.45, 123.45, 123.45, 110.2, 105.6)\n\nThe data is also available as a two-dimensional numpy array.  First we'll\nadjust numpy's output format.  This is not necessary, but it makes the values\neasier to read::\n\n    \u003e\u003e\u003e import numpy as np\n    \u003e\u003e\u003e np.set_printoptions(precision=4)\n\nThe two-dimensional view of the data is called ``data2d``::\n\n    \u003e\u003e\u003e log.data2d\n    array([[  1.6700e+03,   1.2345e+02,   2.5500e+03,   4.5000e-01,\n              1.2345e+02,   1.2345e+02,   1.1020e+02,   1.0560e+02],\n           [  1.6699e+03,   1.2345e+02,   2.5500e+03,   4.5000e-01,\n              1.2345e+02,   1.2345e+02,   1.1020e+02,   1.0560e+02],\n           [  1.6698e+03,   1.2345e+02,   2.5500e+03,   4.5000e-01,\n              1.2345e+02,   1.2345e+02,   1.1020e+02,   1.0560e+02]])\n    \u003e\u003e\u003e log.data2d.shape\n    (3, 8)\n\n\nExample 2\n---------\n\nThe next example reads a file from the Kansas Geological Survey and makes\na plot of the gamma ray data versus depth using ``matplotlib``.\n\nFirst, the imports::\n\n    \u003e\u003e\u003e import numpy as np\n    \u003e\u003e\u003e import matplotlib.pyplot as plt\n    \u003e\u003e\u003e import las\n    \u003e\u003e\u003e import io\n    \u003e\u003e\u003e try:\n    ...     from urllib.request import urlopen\n    ... except ImportError:\n    ...     from urllib import urlopen\n    ...\n\nNext, read the file::\n\n    \u003e\u003e\u003e url = \"http://www.kgs.ku.edu/software/DEWL/HELP/pc_read/Shamar-1.las\"\n    \u003e\u003e\u003e f = io.StringIO(urlopen(url).read().decode('iso-8859-1'))\n    \u003e\u003e\u003e log = las.LASReader(f, null_subs=np.nan)\n\nFinally, make the plot using ``matplotlib``::\n\n    \u003e\u003e\u003e plt.figure(figsize=(9, 5))\n    \u003e\u003e\u003e plt.plot(log.data['DEPT'], log.data['GR'])\n    \u003e\u003e\u003e plt.xlabel(log.curves.DEPT.descr + \" (%s)\" % log.curves.DEPT.units)\n    \u003e\u003e\u003e plt.ylabel(log.curves.GR.descr + \" (%s)\" % log.curves.GR.units)\n    \u003e\u003e\u003e plt.title(log.well.WELL.data + ', ' + log.well.DATE.data)\n    \u003e\u003e\u003e plt.grid()\n    \u003e\u003e\u003e plt.show()\n\n.. image:: https://raw.githubusercontent.com/WarrenWeckesser/las/main/examples/example2.png\n   :alt: Example 2 plot\n   :align: center\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarrenweckesser%2Flas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwarrenweckesser%2Flas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarrenweckesser%2Flas/lists"}