Grain Facet project:

Plot facet angle as a function of dimensionless disturbance rate and weathering (or dissolution) rate

In [1]:
import csv
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

Read in data from 124 model runs that have already been compiled into a .csv file. Read into arrays for the disturbance-rate parameter, the weathering-rate parameter, and the resulting facet slope angle.

In [2]:
filename = 'data/slope_analysis20180826.csv'
In [3]:
# Count number of lines in file
num_lines = len(open(filename).readlines(  ))

# Create data arrays
dist_param = np.zeros(num_lines - 1)  # skip 1 header line
weath_param = np.zeros(num_lines - 1)
facet_angle = np.zeros(num_lines - 1)

# Read data
with open(filename, 'r') as csvfile:
    myreader = csv.reader(csvfile)
    i = 0
    for row in myreader:
        print(', '.join(row))
        if i >= 1:
            dist_param[i-1] = row[1]
            weath_param[i-1] = row[2]
            facet_angle[i-1] = row[3]
        i += 1
Run name, Disturbance rate parameter, Weathering rate parameter, Slope angle, Slope gradient
d-30w-23, 0.001, 0.00501187233627, 29.0636804385, 0.555762878404
d-40w-36, 0.0001, 0.000251188643151, 48.7387796742, 1.13983109863
d-40w-31, 0.0001, 0.000794328234724, 35.5636262297, 0.714969885448
d-30w-24, 0.001, 0.00398107170553, 28.5455444664, 0.54398538265
d-40w-38, 0.0001, 0.000158489319246, 51.6253692569, 1.26283425238
d-30w-12, 0.001, 0.063095734448, 28.8849563451, 0.55168713405
d-30w-15, 0.001, 0.0316227766017, 28.7180031788, 0.547892475513
d-30w-14, 0.001, 0.0398107170553, 28.7539123029, 0.548707624384
d-40w-39, 0.0001, 0.000125892541179, 53.5138751285, 1.35210710802
d-30w-13, 0.001, 0.0501187233627, 28.6312243124, 0.545924874791
d-30w-25, 0.001, 0.00316227766017, 28.7390563482, 0.548370321403
d-40w-30, 0.0001, 0.001, 34.147478064, 0.67826007768
d-40w-37, 0.0001, 0.000199526231497, 50.4526909383, 1.21105824479
d-30w-22, 0.001, 0.0063095734448, 28.1363461643, 0.534765767835
d-30w-40, 0.001, 0.0001, 54.5622697427, 1.40517611037
d-20w-40, 0.01, 0.0001, 52.7881783203, 1.31688705509
d-20w-22, 0.01, 0.0063095734448, 19.6126352524, 0.356332490872
d-10w-32, 0.1, 0.00063095734448, 24.0932111102, 0.447179427095
d-20w-25, 0.01, 0.00316227766017, 21.5391845182, 0.394700704964
d-10w-35, 0.1, 0.000316227766017, 37.0188110111, 0.754068922666
d-20w-13, 0.01, 0.0501187233627, 18.7694432138, 0.339832753384
d-20w-14, 0.01, 0.0398107170553, 18.8444856762, 0.341294399635
d-20w-15, 0.01, 0.0316227766017, 18.5569428376, 0.335700791866
d-20w-12, 0.01, 0.063095734448, 18.6379581219, 0.337274872444
d-20w-24, 0.01, 0.00398107170553, 20.7589237896, 0.379044224928
d-10w-34, 0.1, 0.000398107170553, 33.9894462871, 0.674240550489
d-20w-23, 0.01, 0.00501187233627, 20.1041391448, 0.366029951577
d-10w-33, 0.1, 0.000501187233627, 28.0385730264, 0.532573298458
d-10w-11, 0.1, 0.0794328234724, 3.75032803171, 0.0655492126461
d-20w-39, 0.01, 0.000125892541179, 50.9098267664, 1.23093101209
d-10w-16, 0.1, 0.0251188643151, 3.94271849627, 0.0689222424563
d-10w-29, 0.1, 0.00125892541179, 11.8443103294, 0.209718128453
d-10w-20, 0.1, 0.01, 3.7551388438, 0.0656335383913
d-20w-30, 0.01, 0.001, 28.4074187176, 0.540865330075
d-10w-27, 0.1, 0.00199526231497, 6.51524622868, 0.114205167659
d-10w-18, 0.1, 0.0158489319246, 3.76796741664, 0.0658584070453
d-20w-37, 0.01, 0.000199526231497, 47.9996320968, 1.11059817361
d-10w-26, 0.1, 0.00251188643151, 6.32281123401, 0.110804029267
d-10w-19, 0.1, 0.0125892541179, 4.23914456684, 0.0741223300805
d-20w-36, 0.01, 0.000251188643151, 45.8914830876, 1.03161305889
d-10w-21, 0.1, 0.00794328234724, 3.70061321809, 0.0646778466117
d-20w-31, 0.01, 0.000794328234724, 30.8038673283, 0.596211127545
d-20w-38, 0.01, 0.000158489319246, 49.2449516123, 1.16035036331
d-10w-17, 0.1, 0.0199526231497, 3.74551716666, 0.0654648869008
d-10w-28, 0.1, 0.00158489319246, 9.64025791799, 0.169860159528
d-10w-10, 0.1, 0.1, 3.9683639264, 0.0693719797644
d-40w-15, 0.0001, 0.0316227766017, 29.9528704232, 0.576254034501
d-40w-12, 0.0001, 0.063095734448, 29.8621109244, 0.57414589087
d-30w-38, 0.001, 0.000158489319246, 51.4515372985, 1.25499195807
d-30w-31, 0.001, 0.000794328234724, 35.2641108947, 0.707099482558
d-40w-24, 0.0001, 0.00398107170553, 30.0, 0.57735026919
d-40w-23, 0.0001, 0.00501187233627, 29.8621109244, 0.57414589087
d-30w-36, 0.001, 0.000251188643151, 48.2700560713, 1.12119510893
d-40w-40, 0.0001, 0.0001, 54.7449923755, 1.41470491959
d-30w-37, 0.001, 0.000199526231497, 49.4220826916, 1.16763048599
d-40w-22, 0.0001, 0.0063095734448, 30.0386370201, 0.578249743806
d-40w-25, 0.0001, 0.00316227766017, 30.6741840989, 0.593147292134
d-30w-30, 0.001, 0.001, 33.3446681103, 0.657993790237
d-40w-13, 0.0001, 0.0501187233627, 30.0, 0.57735026919
d-30w-39, 0.001, 0.000125892541179, 53.1172864626, 1.33271218662
d-40w-14, 0.0001, 0.0398107170553, 29.9069062806, 0.575185908395
d-30w-18, 0.001, 0.0158489319246, 28.9466550832, 0.553092563138
d-40w-32, 0.0001, 0.00063095734448, 39.287572793, 0.818128380479
d-30w-27, 0.001, 0.00199526231497, 29.8512086704, 0.573892913634
d-30w-20, 0.001, 0.01, 28.9010050782, 0.552052545613
d-40w-35, 0.0001, 0.000316227766017, 46.002050409, 1.0356044775
d-30w-29, 0.001, 0.00125892541179, 31.2414735452, 0.606611302794
d-30w-16, 0.001, 0.0251188643151, 28.8231842116, 0.550281704962
d-30w-11, 0.001, 0.0794328234724, 28.6870272302, 0.54718976097
d-30w-10, 0.001, 0.1, 28.6907453123, 0.547274086715
d-30w-28, 0.001, 0.00158489319246, 31.1271385335, 0.603884770364
d-30w-17, 0.001, 0.0199526231497, 28.7093317618, 0.547695715441
d-40w-34, 0.0001, 0.000398107170553, 44.1117448863, 0.969464984632
d-30w-21, 0.001, 0.00794328234724, 29.014438909, 0.554638535134
d-30w-19, 0.001, 0.0125892541179, 28.7539123029, 0.548707624384
d-30w-26, 0.001, 0.00251188643151, 29.2442393247, 0.559894839922
d-40w-33, 0.0001, 0.000501187233627, 41.6951981048, 0.89081717289
d-20w-26, 0.01, 0.00251188643151, 22.7248064928, 0.418817868107
d-10w-36, 0.1, 0.000251188643151, 40.5083326112, 0.854332233776
d-20w-19, 0.01, 0.0125892541179, 18.8055296764, 0.340535467928
d-20w-21, 0.01, 0.00794328234724, 19.5297075312, 0.354702193131
d-10w-31, 0.1, 0.000794328234724, 19.8153040547, 0.360323909481
d-20w-17, 0.01, 0.0199526231497, 18.9093721731, 0.342559285814
d-10w-38, 0.1, 0.000158489319246, 46.7690877623, 1.06374116783
d-20w-28, 0.01, 0.00158489319246, 24.3289882389, 0.452126537484
d-20w-10, 0.01, 0.1, 19.2014554869, 0.348265327909
d-20w-11, 0.01, 0.0794328234724, 18.7838796544, 0.340113839201
d-20w-16, 0.01, 0.0251188643151, 18.9151374287, 0.342671720141
d-10w-39, 0.1, 0.000125892541179, 50.5510749115, 1.21530264064
d-20w-29, 0.01, 0.00125892541179, 26.2081400274, 0.492237483644
d-20w-20, 0.01, 0.01, 19.3463933239, 0.351104294666
d-10w-30, 0.1, 0.001, 16.7437117152, 0.300846150494
d-20w-27, 0.01, 0.00199526231497, 22.8589507218, 0.421572509119
d-10w-37, 0.1, 0.000199526231497, 43.8323100193, 0.960048609745
d-20w-18, 0.01, 0.0158489319246, 19.0174044917, 0.344667429445
d-10w-15, 0.1, 0.0316227766017, 3.85615354631, 0.0674043790417
d-10w-12, 0.1, 0.063095734448, 3.82729462492, 0.0668984245702
d-10w-24, 0.1, 0.00398107170553, 4.11579393387, 0.0719579692856
d-20w-34, 0.01, 0.000398107170553, 39.8360328571, 0.834234597823
d-10w-23, 0.1, 0.00501187233627, 4.37046168319, 0.0764272337842
d-20w-33, 0.01, 0.000501187233627, 38.109572176, 0.784369973794
d-10w-40, 0.1, 0.0001, 52.1438341144, 1.28658600396
d-10w-22, 0.1, 0.0063095734448, 3.95393856726, 0.0691190025286
d-20w-32, 0.01, 0.00063095734448, 33.7729974652, 0.668759377048
d-10w-25, 0.1, 0.00316227766017, 4.86008184482, 0.0850284598003
d-20w-35, 0.01, 0.000316227766017, 43.5256901354, 0.949817085988
d-10w-13, 0.1, 0.0501187233627, 3.65410075817, 0.0638626977409
d-10w-14, 0.1, 0.0398107170553, 3.7551388438, 0.0656335383913
d-40w-11, 0.0001, 0.0794328234724, 30.0, 0.57735026919
d-40w-16, 0.0001, 0.0251188643151, 29.9528704232, 0.576254034501
d-40w-29, 0.0001, 0.00125892541179, 33.1396370333, 0.652878028358
d-40w-20, 0.0001, 0.01, 29.9673765948, 0.576591337482
d-30w-35, 0.001, 0.000316227766017, 45.1395123886, 1.00488179764
d-30w-32, 0.001, 0.00063095734448, 37.2041897904, 0.759156575963
d-40w-27, 0.0001, 0.00199526231497, 30.0, 0.57735026919
d-40w-18, 0.0001, 0.0158489319246, 30.0, 0.57735026919
d-40w-26, 0.0001, 0.00251188643151, 30.0, 0.57735026919
d-30w-33, 0.001, 0.000501187233627, 41.207551197, 0.875666647325
d-40w-19, 0.0001, 0.0125892541179, 30.0, 0.57735026919
d-30w-34, 0.001, 0.000398107170553, 42.5177711916, 0.916901936756
d-40w-21, 0.0001, 0.00794328234724, 30.0, 0.57735026919
d-40w-17, 0.0001, 0.0199526231497, 29.9528704232, 0.576254034501
d-40w-28, 0.0001, 0.00158489319246, 30.7836644809, 0.595733281656
d-40w-10, 0.0001, 0.1, 29.9069062806, 0.575185908395

Convert the data into a pandas DataFrame. This allows us to sort the data set according to $d'$ and $w'$, which in turn will make it possible to turn the data into 4 x 31 array in which each row represents one set of experiments at a fixed value of $d'$.

In [4]:
import pandas as pd
In [5]:
data = {'dprime' : dist_param, 'wprime': weath_param, 'angle': facet_angle}
df = pd.DataFrame(data)
df = df.sort_values(by=['dprime', 'wprime'])

Reshape into 4 x 31 arrays in which each row is a unique value of $d'$. Print the dist_param values to make sure it worked.

In [6]:
facet_angle = df['angle'].values.reshape((4, 31))
weath_param = df['wprime'].values.reshape((4, 31))
dist_param = df['dprime'].values.reshape((4, 31))
dist_param
Out[6]:
array([[0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001,
        0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001,
        0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001,
        0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.0001],
       [0.001 , 0.001 , 0.001 , 0.001 , 0.001 , 0.001 , 0.001 , 0.001 ,
        0.001 , 0.001 , 0.001 , 0.001 , 0.001 , 0.001 , 0.001 , 0.001 ,
        0.001 , 0.001 , 0.001 , 0.001 , 0.001 , 0.001 , 0.001 , 0.001 ,
        0.001 , 0.001 , 0.001 , 0.001 , 0.001 , 0.001 , 0.001 ],
       [0.01  , 0.01  , 0.01  , 0.01  , 0.01  , 0.01  , 0.01  , 0.01  ,
        0.01  , 0.01  , 0.01  , 0.01  , 0.01  , 0.01  , 0.01  , 0.01  ,
        0.01  , 0.01  , 0.01  , 0.01  , 0.01  , 0.01  , 0.01  , 0.01  ,
        0.01  , 0.01  , 0.01  , 0.01  , 0.01  , 0.01  , 0.01  ],
       [0.1   , 0.1   , 0.1   , 0.1   , 0.1   , 0.1   , 0.1   , 0.1   ,
        0.1   , 0.1   , 0.1   , 0.1   , 0.1   , 0.1   , 0.1   , 0.1   ,
        0.1   , 0.1   , 0.1   , 0.1   , 0.1   , 0.1   , 0.1   , 0.1   ,
        0.1   , 0.1   , 0.1   , 0.1   , 0.1   , 0.1   , 0.1   ]])

Read facet angle from dissolution-only runs. This is another set of model runs that we want to include on the figure.

In [7]:
# Name of file
filename = 'data/dissolution_only_results20180717.csv'

# Count number of lines in file
num_lines = len(open(filename).readlines(  ))

# Create data arrays
diss_param = np.zeros(num_lines - 2)  # we'll skip 2 header lines
diss_facet_angle = np.zeros(num_lines - 2)

# Read data
with open(filename, 'r') as csvfile:
    myreader = csv.reader(csvfile)
    i = 0
    for row in myreader:
        print(', '.join(row))
        if i >= 2:
            diss_param[i-2] = row[0]
            diss_facet_angle[i-2] = row[2]
        i += 1
Landlab version, 1.4.0+213.gc1191879, 
Dissolution rate parameter (1/yr), Gradient (m/m), Slope angle (deg)
4e-05, 1.4848188132399602, 56.040409696498955
8e-05, 1.248837768101174, 51.31419028143727
0.00012000000000000002, 1.0629500634664806, 46.74781453781527
0.00016, 0.9375061778667241, 43.152578122648315
0.0002, 0.8071207219017609, 38.90771833154152
0.00024, 0.7020705392069188, 35.071562342900265
0.00028000000000000003, 0.5629313484897664, 29.376524262447827
0.00032, 0.42841575538113974, 23.191054719586457
0.00036, 0.2565958550711758, 14.391372149373215
0.0004, 0.20656848025185617, 11.671342495104037
0.00044, 0.10706918513524637, 6.11133034512308
0.00048, 0.09597515674461617, 5.482180025836164

Plot the data. First, we'll define four plotting symbols for each of the four values of $d'$. Then we'll plot, for each of the four, the facet angle as a function of weathering parameter ($w'$).

Next, we add the dissolution runs (using the dissolution parameter, which corresponds to a weathering parameter in a world where $d'\rightarrow \infty$).

Then add the curve that represents the analytical solution for the dissolution-only case. Also plot the model's effective 30$^\circ$ angle of repose for reference.

Finally, add axis labels, legend, etc., and save the figure to a file.

In [8]:
psyms = ['k.', 'k+', 'k^', 'k*']
In [9]:
# Plot the weathering + disturbance runs
for d in range(4):
    plt.semilogx(10.0**3 * weath_param[d,:], facet_angle[d,:], psyms[d])

# Plot the dissolution runs
plt.semilogx(10.0**3 * diss_param, diss_facet_angle, 'ko')

# Analytical solution for dissolution only
wprime = 10**3 * 10.0 ** np.arange(-4.0, -0.9, 0.1)
ang_pred = 60.0 - 2 * (180.0 / np.pi) * wprime
plt.plot(wprime, ang_pred, 'k')
plt.ylim([0, 60])

# Angle of repose
ww = np.array([0.1, 100.0])
angrep = np.array([30.0, 30.0])
plt.plot(ww, angrep, 'g--')

# Axis limits
plt.xlim([0.1, 100])

# Labels and legend
plt.xlabel(r"Dimensionless weathering rate parameter, $w'$", fontsize=14)
plt.ylabel('Facet angle (degrees)', fontsize=14)
plt.legend([r"$d'= 10^{-1}$", r"$d'= 10^0$", r"$d'= 10^1$", r"$d'= 10^2$", r"$d' \rightarrow \infty$", r"$\theta = 60^\circ - 360 w' / \pi$", r"$\theta = 30^\circ$"], ncol=2, fontsize=10)

plt.savefig('facet_angle_vs_wprime.pdf')

This next figure isn't meant for the paper, but is just here to check out what it looks like if you plot difference between fault dip and facet angle instead of the facet angle itself.

In [10]:
dang = 60.0 - facet_angle
plt.semilogx(weath_param, dang, 'k.')
plt.semilogx(diss_param, 60.0 - diss_facet_angle, 'ko')
w = 10.0 ** np.arange(-4.0, -0.9, 0.1)
ang_pred = w * 10**3 * 360.0 / np.pi
plt.plot(w, ang_pred, 'k')
plt.ylim([0, 60])
Out[10]:
(0, 60)