Project

The Project class lets us handle groups of wells. It is really just a list of Well objects.


In [1]:
from welly import Project

In [2]:
!ls *.LAS


P-129_out.LAS  P-130_out.LAS  P-135_out.LAS  P-135_time.LAS

In [3]:
p = Project.from_las("P-*.LAS")


4it [00:03,  1.14it/s]

In [4]:
len(p)


Out[4]:
4

In [5]:
p


Out[5]:
IndexUWIDataCurves
0100/N14A/11E0518 curvesCALI, DT, NPHI_SAN, NPHI_LIM, NPHI_DOL, DPHI_LIM, DPHI_SAN, DPHI_DOL, M2R9, M2R6, M2R3, M2R2, M2R1, GR, SP, PEF, DRHO, RHOB
1Long = 63* 45'24.460 W24 curvesCALI, HCAL, PEF, DT, DTS, DPHI_SAN, DPHI_LIM, DPHI_DOL, NPHI_SAN, NPHI_LIM, NPHI_DOL, RLA5, RLA3, RLA4, RLA1, RLA2, RXOZ, RXO_HRLT, RT_HRLT, RM_HRLT, DRHO, RHOB, GR, SP
2-999.2522 curvesCALI, DT, DTS, DPHI_SAN, DPHI_LIM, DPHI_DOL, NPHI_SAN, NPHI_LIM, NPHI_DOL, AMF, AF90, AF10, AF20, AF60, AF30, RXOZ, GR, POTA, THOR, URAN, SP, RHOB
33 curvesSONIC_DESPIKED, RHOB_DESPIKED, TWT

Typical, the UWIs are a disaster. Let's ignore this for now.

The Project is really just a list-like thing:


In [6]:
for w in p:
    print(w.uwi)


100/N14A/11E05
Long = 63* 45'24.460  W
-999.25

Plot curves from several wells


In [7]:
%matplotlib inline
import matplotlib.pyplot as plt

In [8]:
alias = {'GR': ['GR', 'GRC', 'NGT']}

In [13]:
fig, axs = plt.subplots(figsize=(7, 14), ncols=len(p))

for i, (ax, w) in enumerate(zip(axs, p)):
    gr = w.get_curve('GR', alias=alias)
    if gr is not None:
        ax = gr.plot(ax=ax)
    ax.set_title("GR for\n{}".format(w.uwi))
    
plt.show()


Export data to pandas DataFrame

This makes a DataFrame using a dual index of UWI and Depth.


In [17]:
keys = ['GR', 'DT']

df = p.df(keys=keys, alias=alias)

In [21]:
df.describe()


Out[21]:
GR DT
count 43068.000000 40840.000000
mean 99.688700 70.503936
std 33.663215 11.057708
min 3.894070 40.583134
25% 76.377998 63.458676
50% 106.260002 68.167877
75% 125.804001 74.454033
max 267.940430 134.012634

In [22]:
df.loc['100/N14A/11E05'].DT.plot()


Out[22]:
<matplotlib.axes._subplots.AxesSubplot at 0x7f022e2c6898>

In [23]:
x = df.loc['100/N14A/11E05'].index
idx = df.loc['100/N14A/11E05'].loc[(28<x) & (x<30)].index
idx


Out[23]:
Float64Index([28.099999999999547,  28.19999999999954, 28.299999999999535,
               28.39999999999953, 28.499999999999524,  28.59999999999952,
              28.699999999999513, 28.799999999999507,   28.8999999999995,
              28.999999999999496,  29.09999999999949, 29.199999999999484,
               29.29999999999948, 29.399999999999473, 29.499999999999467,
               29.59999999999946, 29.699999999999456,  29.79999999999945,
              29.899999999999444,  29.99999999999944],
             dtype='float64', name='Depth')

Quality

We can make some tests of curve quality.


In [24]:
import welly.quality as q

In [25]:
tests = {
#    'Each': [q.no_gaps],
    'GR': [q.no_monotonic, q.no_flat, q.all_positive],
    'DT': [q.all_positive, q.all_between(50, 200)],
}

In [26]:
from IPython.display import HTML

In [28]:
HTML(p.curve_table_html(keys=['CALI', 'GR', 'DT', 'SP'], tests=tests, alias=alias))


Out[28]:
IdxUWIDataPassingCALIGRDTSP
%3/4 wells3/4 wells3/4 wells3/4 wells
0100/N14A/11E054/18 curves100CALI

8.90 in
GR

103.74 gAPI
DT

74.90 us/ft
SP

101.60 mV
1Long = 63* 45'24.460 W4/24 curves40CALI

7.97 in
GR

78.99 gAPI
DT

63.08 us/ft
SP

52.47 mV
2-999.254/22 curves100CALI

6.42 in
GR

133.38 gAPI
DT

63.38 us/ft
SP

-416.47 mV
30/3 curves





In [ ]: