Everything in lasio
is available from a basic import, so all you need to do is:
import lasio
The read()
function accepts a filename, string, URL, or file-like object
import os
l = lasio.read(os.path.join("..", "tests", "examples", "6038187_v1.2_short.las"))
it returns a LASFile
object
type(l)
lasio.las.LASFile
Curves are available as numpy 1D arrays
l.keys()
['DEPT', 'CALI', 'DFAR', 'DNEAR', 'GAMN', 'NEUT', 'PR', 'SP', 'COND']
so to see the NEUT data use:
l['NEUT']
array([ 1152.01 , 1233.99 , 1212. , 1161.01 , 1080.02 , 1188.98 , 1164. , 1169. , 1202. , 1168.01 , 1179. , 1146. , 1169. , 1182. , 1156.01 , 1154. , 1142. , 1146. , 1171. , 1119.01 , 1070.01 , 1150.99 , 1256.98 , 1291. , 1301. , 1371.99 , 1358. , 1368. , 1482.99 , 1423.01 , 1350.01 , 1156.02 , 1013.03 , 876.016, 798.016, 629.026, 618.001, 659.992, 689.997, 765.984, 753.002, 741.001, 734.001, 767.996, 730.008, 747.997, 762.999, 793.994, 776.002, 854.983, 827.004, 886.994, 869.003, 863.001, 869.999, 884.998, 919.997, 879.008, 909.996, 931.995, 954.996, 986.997, 970.003, 953.002, 925.006, 899.004, 952.995, 967.997, 926.005, 924. , 936.998, 968.997, 922.009, 934.999, 931.001, 945.998, 913.003, 903.002, 964.993, 937.006, 925.002, 909.001, 920.998, 924. , 906.004, 980.989, 949.002, 908.008, 899.001, 934.992, 956.997, 969.999, 954.003, 933.002, 1023.98 , 950.011, 1002. , 1030.99 , 1074. , 1161.98 , 1113.01 , 1051. , 1067. , 1167.99 , 1312.97 , 1478.97 , 1536. , 1584.99 , 1592. , 1483.02 , 1557.99 , 1546. , 1604.99 , 1546.01 , 1518.01 , 1469.01 , 1438. , 1403.01 , 1413. , 1316.02 , 1347. ])
You can also access curves by index (remembering that the first index is zero but the first curve is the reference curve, usually depth.
So for example the first data curve in this file is CALI:
l['CALI']
array([ 101.78 , 101.738, 101.738, 101.858, 101.798, 101.756, 101.804, 101.798, 101.852, 101.87 , 101.906, 101.816, 101.714, 101.768, 101.816, 101.828, 101.696, 101.69 , 101.744, 101.66 , 101.6 , 101.708, 101.78 , 101.792, 101.618, 101.576, 101.606, 101.504, 101.516, 101.54 , 101.546, 101.45 , 101.612, 101.744, 101.762, 101.762, 101.792, 101.816, 101.696, 101.696, 101.666, 101.69 , 101.858, 101.81 , 101.792, 101.828, 101.81 , 101.54 , 101.54 , 101.516, 101.516, 101.498, 101.504, 101.54 , 101.348, 101.366, 101.42 , 101.408, 101.36 , 101.318, 101.324, 101.348, 101.307, 101.283, 101.378, 101.295, 101.283, 101.396, 101.36 , 101.372, 101.348, 101.408, 101.402, 101.498, 101.432, 101.516, 101.594, 101.528, 101.534, 101.528, 101.528, 101.528, 101.66 , 101.732, 101.696, 101.714, 101.696, 101.66 , 101.666, 101.78 , 101.72 , 101.624, 101.696, 101.696, 101.684, 101.708, 101.69 , 101.69 , 101.762, 101.84 , 101.636, 101.612, 101.576, 101.618, 101.492, 102.715, 101.157, 101.432, 101.636, 101.594, 101.474, 101.546, 101.366, 101.318, 101.384, 101.384, 101.295, 101.223, 101.241, 101.235, 101.259])
which is the same as using the index 1:
l[1]
array([ 101.78 , 101.738, 101.738, 101.858, 101.798, 101.756, 101.804, 101.798, 101.852, 101.87 , 101.906, 101.816, 101.714, 101.768, 101.816, 101.828, 101.696, 101.69 , 101.744, 101.66 , 101.6 , 101.708, 101.78 , 101.792, 101.618, 101.576, 101.606, 101.504, 101.516, 101.54 , 101.546, 101.45 , 101.612, 101.744, 101.762, 101.762, 101.792, 101.816, 101.696, 101.696, 101.666, 101.69 , 101.858, 101.81 , 101.792, 101.828, 101.81 , 101.54 , 101.54 , 101.516, 101.516, 101.498, 101.504, 101.54 , 101.348, 101.366, 101.42 , 101.408, 101.36 , 101.318, 101.324, 101.348, 101.307, 101.283, 101.378, 101.295, 101.283, 101.396, 101.36 , 101.372, 101.348, 101.408, 101.402, 101.498, 101.432, 101.516, 101.594, 101.528, 101.534, 101.528, 101.528, 101.528, 101.66 , 101.732, 101.696, 101.714, 101.696, 101.66 , 101.666, 101.78 , 101.72 , 101.624, 101.696, 101.696, 101.684, 101.708, 101.69 , 101.69 , 101.762, 101.84 , 101.636, 101.612, 101.576, 101.618, 101.492, 102.715, 101.157, 101.432, 101.636, 101.594, 101.474, 101.546, 101.366, 101.318, 101.384, 101.384, 101.295, 101.223, 101.241, 101.235, 101.259])
All the curves are stored as a two-dimensional ndarray
under the data
attribute:
type(l.data)
numpy.ndarray
l.data.shape
(121, 9)
l.data
array([[ 1.20000000e+01, 1.01780000e+02, 8.83000000e-01, ..., 5.04999000e+04, 1.00592000e+02, 8.22680000e+02], [ 1.20500000e+01, 1.01738000e+02, 8.83000000e-01, ..., 5.04999000e+04, 1.00510000e+02, 8.10824000e+02], [ 1.21000000e+01, 1.01738000e+02, 8.73000000e-01, ..., 5.04999000e+04, 1.00580000e+02, 8.01439000e+02], ..., [ 1.79000000e+01, 1.01241000e+02, 1.41700000e+00, ..., 5.04999000e+04, 1.00537000e+02, 6.88347000e+01], [ 1.79500000e+01, 1.01235000e+02, 1.37800000e+00, ..., 5.04999000e+04, 1.00558000e+02, 6.93289000e+01], [ 1.80000000e+01, 1.01259000e+02, 1.38100000e+00, ..., 5.04999000e+04, 1.00562000e+02, 6.53776000e+01]])
You can always see the text of the original LAS file loaded here:
type(l._text)
str
len(l._text)
15307
print(l._text)
#------------------------------------------------------------ ~VERSION INFORMATION VERS. 2.0 :CWLS LOG ASCII STANDARD - VERSION 2.0 WRAP. NO :ONE LINE PER DEPTH STEP #------------------------------------------------------------ ~WELL INFORMATION STRT.M 0.0500000 :FIRST INDEX VALUE STOP.M 136.600 :LAST INDEX VALUE STEP.M 0.0500000 :STEP NULL. -99999 :NULL VALUE COMP. :COMP WELL. Scorpio E1 :WELL FLD. : LOC. Mt Eba :LOC SRVC. : CTRY. : STAT. SA :STAT CNTY. : DATE. 15/03/2015 :DATE UWI. 6038-187 :WUNT #------------------------------------------------------------ ~CURVE INFORMATION DEPT.M :DEPTH CALI.MM :CALI DFAR.G/CM3 :DFAR DNEAR.G/CM3 :DNEAR GAMN.GAPI :GAMN NEUT.CPS :NEUT PR.OHM/M :PR SP.MV :SP COND.MS/M :COND #------------------------------------------------------------ ~PARAMETER INFORMATION BS. 216 mm :BS JOBN. :JOBN WPMT. :WPMT AGL. :AGL PURP. Cased hole stratigraphy :PURP X. 0560160 :X CSGL. 0 m - 135 m :CSGL UNIT. :UNIT Y. 6686430 :Y TDL. 135.2 m :TDL PROD. :PROD MUD. Water :MUD CSGS. 100 mm :CSGS ENG. :ENG STEP. 5 cm :STEP FluidLevel. 54 m :FluidLevel CSGT. PVC :CSGT WIT. :WIT EREF. :EREF PROJ. :PROJ ZONE. 53J :ZONE DREF. GL :DREF TDD. 136 m :TDD #------------------------------------------------------------ ~OTHER #------------------------------------------------------------ ~A DEPT[M] CALI DFAR DNEAR GAMN NEUT PR SP COND 12.0000 101.780 0.883000 0.814000 65.0846 1152.01 50499.9 100.592 822.680 12.0500 101.738 0.883000 0.843000 65.0800 1233.99 50499.9 100.510 810.824 12.1000 101.738 0.873000 0.808001 53.4612 1212.00 50499.9 100.580 801.439 12.1500 101.858 0.878000 0.813000 79.0231 1161.01 50499.9 100.555 796.745 12.2000 101.798 0.878000 0.787000 41.8448 1080.02 50499.9 100.552 785.137 12.2500 101.756 0.869000 0.765000 81.3450 1188.98 50499.9 100.537 772.293 12.3000 101.804 0.882000 0.811000 67.4063 1164.00 50499.9 100.580 757.966 12.3500 101.798 0.880000 0.823000 74.3767 1169.00 50499.9 100.543 757.965 12.4000 101.852 0.877000 0.823000 62.7573 1202.00 50499.9 100.543 735.738 12.4500 101.870 0.878000 0.826000 58.1080 1168.01 50499.9 100.586 716.967 12.5000 101.906 0.870000 0.850000 60.4316 1179.00 50499.9 100.540 715.481 12.5500 101.816 0.883000 0.862000 69.7281 1146.00 50499.9 100.510 713.999 12.6000 101.714 0.864001 0.815002 53.4621 1169.00 50499.9 100.549 730.545 12.6500 101.768 0.863000 0.802000 81.3478 1182.00 50499.9 100.519 738.698 12.7000 101.816 0.869000 0.808000 51.1413 1156.01 50499.9 100.537 757.467 12.7500 101.828 0.875000 0.797000 83.6700 1154.00 50499.9 100.540 775.746 12.8000 101.696 0.865000 0.907000 58.1094 1142.00 50499.9 100.543 790.321 12.8500 101.690 0.867000 0.808004 65.0787 1146.00 50499.9 100.516 790.322 12.9000 101.744 0.851000 0.826000 72.0522 1171.00 50499.9 100.494 806.869 12.9500 101.660 0.851000 0.796000 53.4629 1119.01 50499.9 100.528 816.749 13.0000 101.600 0.837000 0.815000 67.4029 1070.01 50499.9 100.531 826.383 13.0500 101.708 0.839000 0.813000 74.3773 1150.99 50499.9 100.519 835.522 13.1000 101.780 0.838000 0.827999 81.3497 1256.98 50499.9 100.531 848.858 13.1500 101.792 0.837000 0.809000 79.0263 1291.00 50499.9 100.513 861.210 13.2000 101.618 0.847000 0.761000 97.6171 1301.00 50499.9 100.531 861.211 13.2500 101.576 0.846000 0.797000 65.0850 1371.99 50499.9 100.543 881.462 13.3000 101.606 0.845000 0.767000 85.9970 1358.00 50499.9 100.528 885.417 13.3500 101.504 0.822001 0.838997 65.0840 1368.00 50499.9 100.482 885.911 13.4000 101.516 0.793000 0.876000 85.9966 1482.99 50499.9 100.540 889.616 13.4500 101.540 0.726000 0.896000 65.0844 1423.01 50499.9 100.519 895.296 13.5000 101.546 0.725000 0.897000 111.559 1350.01 50499.9 100.510 900.730 13.5500 101.450 0.725000 0.894000 74.3815 1156.02 50499.9 100.543 905.671 13.6000 101.612 0.762999 0.899000 90.6449 1013.03 50499.9 100.485 906.659 13.6500 101.744 0.755000 0.835000 81.3521 876.016 50499.9 100.473 894.804 13.7000 101.762 0.793000 0.809000 58.1119 798.016 50499.9 100.497 883.196 13.7500 101.762 0.836000 0.783000 62.7553 629.026 50499.9 100.476 915.546 13.8000 101.792 0.959000 0.683000 69.7283 618.001 50499.9 100.476 945.188 13.8500 101.816 1.04500 0.657001 76.7007 659.992 50499.9 100.470 945.932 13.9000 101.696 1.13300 0.800000 58.1091 689.997 50499.9 100.476 922.717 13.9500 101.696 1.23100 1.11100 79.0216 765.984 50499.9 100.491 757.012 14.0000 101.666 1.34000 1.43400 60.4348 753.002 50499.9 100.433 941.705 14.0500 101.690 1.38600 1.46300 67.4043 741.001 50499.9 100.424 1071.64 14.1000 101.858 1.35800 1.46200 74.3767 734.001 50499.9 100.400 1215.13 14.1500 101.810 1.35700 1.47100 53.4614 767.996 50499.9 100.381 863.968 14.2000 101.792 1.35400 1.55800 55.7825 730.008 50499.9 100.342 699.707 14.2500 101.828 1.37800 1.66600 67.4032 747.997 50499.9 100.360 333.181 14.3000 101.810 1.37200 1.74200 62.7564 762.999 50499.9 100.296 36.2593 14.3500 101.540 1.42300 1.77800 62.7560 793.994 50499.9 100.314 26.8468 14.4000 101.540 1.42500 1.66700 53.4601 776.002 50499.9 100.275 24.3753 14.4500 101.516 1.41700 1.60800 74.3736 854.983 50499.9 100.299 89.3224 14.5000 101.516 1.41600 1.54200 46.4903 827.004 50499.9 100.214 479.289 14.5500 101.498 1.41200 1.55700 60.4307 886.994 50499.9 100.214 282.756 14.6000 101.504 1.44800 1.67200 60.4320 869.003 50499.9 100.375 398.805 14.6500 101.540 1.43000 1.59000 69.7279 863.001 50499.9 100.555 411.670 14.7000 101.348 1.41300 1.57800 32.5478 869.999 50499.9 100.607 697.637 14.7500 101.366 1.43600 1.58100 88.3145 884.998 50499.9 100.610 1003.44 14.8000 101.420 1.38200 1.51400 85.9992 919.997 50499.9 100.598 1050.16 14.8500 101.408 1.39100 1.54300 92.9707 879.008 50499.9 100.601 944.470 14.9000 101.360 1.40900 1.50600 81.3523 909.996 50499.9 100.562 819.729 14.9500 101.318 1.38400 1.51600 60.4364 931.995 50499.9 100.562 805.886 15.0000 101.324 1.38200 1.43900 72.0512 954.996 50499.9 100.568 758.219 15.0500 101.348 1.39000 1.51000 76.7016 986.997 50499.9 100.562 733.761 15.1000 101.307 1.39800 1.50000 123.179 970.003 50499.9 100.574 685.356 15.1500 101.283 1.42300 1.52900 60.4392 953.002 50499.9 100.549 647.066 15.2000 101.378 1.42700 1.53800 67.4035 925.006 50499.9 100.592 631.504 15.2500 101.295 1.41800 1.54000 106.912 899.004 50499.9 100.574 613.226 15.3000 101.283 1.40900 1.46800 83.6772 952.995 50499.9 100.562 589.513 15.3500 101.396 1.39800 1.47900 85.9986 967.997 50499.9 100.662 570.743 15.4000 101.360 1.43800 1.47100 74.3793 926.005 50499.9 100.604 560.366 15.4500 101.372 1.43700 1.55000 58.1104 924.000 50499.9 100.616 544.560 15.5000 101.348 1.42900 1.54300 95.2903 936.998 50499.9 100.610 528.504 15.5500 101.408 1.42000 1.53700 69.7314 968.997 50499.9 100.632 525.291 15.6000 101.402 1.43700 1.55300 76.7007 922.009 50499.9 100.601 510.721 15.6500 101.498 1.44800 1.51100 97.6186 934.999 50499.9 100.586 505.038 15.7000 101.432 1.46600 1.55000 81.3544 931.001 50499.9 100.595 504.049 15.7500 101.516 1.43700 1.48500 72.0544 945.998 50499.9 100.598 495.405 15.8000 101.594 1.43700 1.48100 69.7292 913.003 50499.9 100.613 492.193 15.8500 101.528 1.43100 1.50900 76.7007 903.002 50499.9 100.571 481.327 15.9000 101.534 1.45200 1.52400 72.0535 964.993 50499.9 100.586 478.855 15.9500 101.528 1.44000 1.53900 67.4060 937.006 50499.9 100.607 471.940 16.0000 101.528 1.46300 1.56800 69.7286 925.002 50499.9 100.601 466.259 16.0500 101.528 1.47800 1.55900 65.0804 909.001 50499.9 100.616 465.023 16.1000 101.660 1.49200 1.55600 69.7281 920.998 50499.9 100.629 453.663 16.1500 101.732 1.48700 1.56800 85.9971 924.000 50499.9 100.629 449.709 16.2000 101.696 1.47100 1.60600 95.2939 906.004 50499.9 100.641 448.968 16.2500 101.714 1.49700 1.58000 113.888 980.989 50499.9 100.632 448.968 16.3000 101.696 1.48700 1.60000 74.3810 949.002 50499.9 100.632 444.275 16.3500 101.660 1.47800 1.58700 90.6449 908.008 50499.9 100.613 437.854 16.4000 101.666 1.50300 1.58500 88.3233 899.001 50499.9 100.616 433.901 16.4500 101.780 1.48700 1.55700 83.6761 934.992 50499.9 100.616 432.913 16.5000 101.720 1.48800 1.56800 60.4355 956.997 50499.9 100.604 423.528 16.5500 101.624 1.49100 1.57600 104.590 969.999 50499.9 100.629 413.648 16.6000 101.696 1.48600 1.57200 123.184 954.003 50499.9 100.653 399.571 16.6500 101.696 1.50100 1.59800 88.3270 933.002 50499.9 100.641 386.478 16.7000 101.684 1.49500 1.54700 51.1435 1023.98 50499.9 100.598 381.538 16.7500 101.708 1.49300 1.58200 79.0217 950.011 50499.9 100.632 374.128 16.8000 101.690 1.48300 1.53000 58.1086 1002.00 50499.9 100.626 362.766 16.8500 101.690 1.49000 1.53400 74.3749 1030.99 50499.9 100.601 349.430 16.9000 101.762 1.47400 1.52500 67.4058 1074.00 50499.9 100.595 345.475 16.9500 101.840 1.50500 1.54300 120.852 1161.98 50499.9 100.616 334.609 17.0000 101.636 1.48200 1.56200 69.7368 1113.01 50499.9 100.604 328.927 17.0500 101.612 1.48900 1.52700 69.7290 1051.00 50499.9 100.629 303.487 17.1000 101.576 1.47600 1.52400 99.9392 1067.00 50499.9 100.620 270.887 17.1500 101.618 1.45500 1.52200 55.7881 1167.99 50499.9 100.607 256.557 17.2000 101.492 1.48200 1.53200 83.6686 1312.97 50499.9 100.595 221.489 17.2500 102.715 1.48700 1.49900 109.238 1478.97 50499.9 100.531 227.902 17.3000 101.157 1.47700 1.45600 76.7045 1536.00 50499.9 100.555 199.253 17.3500 101.432 1.45500 1.54800 83.6737 1584.99 50499.9 100.531 168.876 17.4000 101.636 1.44400 1.53000 69.7306 1592.00 50499.9 100.519 128.614 17.4500 101.594 1.45500 1.48000 62.7576 1483.02 50499.9 100.562 125.646 17.5000 101.474 1.46000 1.46000 76.6999 1557.99 50499.9 100.519 108.852 17.5500 101.546 1.41800 1.48700 76.7020 1546.00 50499.9 100.543 101.934 17.6000 101.366 1.42900 1.48900 81.3501 1604.99 50499.9 100.549 98.2287 17.6500 101.318 1.37400 1.49000 85.9985 1546.01 50499.9 100.537 85.1385 17.7000 101.384 1.40100 1.47700 90.6469 1518.01 50499.9 100.549 76.2470 17.7500 101.384 1.39100 1.46600 81.3524 1469.01 50499.9 100.565 78.4677 17.8000 101.295 1.37400 1.49000 104.591 1438.00 50499.9 100.555 65.1310 17.8500 101.223 1.38200 1.46500 88.3261 1403.01 50499.9 100.555 66.1178 17.9000 101.241 1.41700 1.48200 90.6477 1413.00 50499.9 100.537 68.8347 17.9500 101.235 1.37800 1.45100 95.2949 1316.02 50499.9 100.558 69.3289 18.0000 101.259 1.38100 1.42600 88.3241 1347.00 50499.9 100.562 65.3776