In [19]:
from grain_size import Grain_Size
%matplotlib notebook

Example 1

The grain size class is initiated by providing a list of tuples. Each tuple is in the format of (grain_size, percent_passing). Grain size value should be in mm and percent passing expressed as fraction * 100 (e.g. 10% is 10 not 0.1). For example, [(5.0, 100), (0.5, 80), (0.2, 60)] would indicate 100 percent pass the 5 mm size, 80 percent pass 0.5 mm and, 60 percent pass 0.2 mm.


In [3]:
data = [(0.25,100.0),(0.15,80),(0.075,60),(0.0332,40),(0.0216,20),(0.01,10),(0.005,5),(0.001,0)]
gs1 = Grain_Size(data)

The grain size curve can be plotted with the .plot function


In [4]:
gs1.plot()


The Grain_Size class has many attributes. These inlcude: data : data as provided as the data parameter

gravel_max : size provided as gravel_max parameter

hydro_min : size provided as hydro_min parameter

percents : a list of np.linspace(0,100,101).  Values of sizes from these
    percent values

sizes : list of sizes for every 1 percent cut-off from the fitted 
    grain size distribution curve

d10 : d10 grain size.

d20 : d10 grain size. 

d30 : d10 grain size. 

d40 : d10 grain size.

d50 : d50 grain size

d60 : d60 grain size

d70 : d70 grain size

d80 : d80 grain size

d90 : d90 grain size

cu : Uniformity coefficient.  d60/d10

cc : Coefficient of curvature. d30^2/(d10 * d60)

In [10]:
gs1.d50


Out[10]:
0.048751338962863343

The Grain_Size class also has several methods for extimating hydraulic conductivity based on the grain size distribution. The most basic method is the hazen method.


In [12]:
gs1.hazen() #units are in cm/sec by default


Out[12]:
0.0001

Example 2


In [29]:
data2 = [(0.25,100.0),(0.15,80),(0.075,60),(0.0332,40),(0.0216,20),(0.01,10),(0.005,6),(0.001,1)]
gs2 = Grain_Size(data2)
gs2.plot()



In [30]:
print gs2.hazen()
print gs2.kc()
print gs2.barr_k()


0.0001
2.79361013684e-05
2.29529602312e-05

Example 3


In [31]:
data3 = [(0.25,100.0),(0.15,80),(0.075,60),(0.0332,40),(0.0216,20),(0.01,10),(0.005,6)]
gs3 = Grain_Size(data3, hydro_min=0.004)
gs3.plot()
print gs3.hazen()
print gs3.kc()
print gs3.barr_k()


0.0001
0.00018381420212
0.000151026086838

In [35]:
(gs3.barr_k()-gs2.barr_k())*864  # converting to m/day


Out[35]:
0.11065518138862764

In [ ]: