Skip to content

Commit 0cc0d9d

Browse files
committed
Upload accepted version
1 parent 2720592 commit 0cc0d9d

File tree

13,962 files changed

+142847
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

13,962 files changed

+142847
-1
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
#! /usr/bin/env python3
2+
'''
3+
Reprocess data from Peral et al. (2018) in I-CDES using D47crunch
4+
'''
5+
6+
from D47crunch import *
7+
from pylab import *
8+
import os, sys, datetime
9+
from matplotlib.patches import Ellipse
10+
from peral_Tpubatlas import peral_Tpubatlas
11+
12+
### Process data with different size fractions treated as different samples:
13+
rawdata = D47data()
14+
15+
rawdata.read('peral_2018_rawdata.csv')
16+
rawdata.wg()
17+
rawdata.crunch()
18+
rawdata.standardize()
19+
rawdata.summary(dir = 'output', verbose = True)
20+
rawdata.table_of_sessions(dir = 'output', verbose = True)
21+
rawdata.table_of_samples(dir = 'output', verbose = True)
22+
23+
### Read binned sample names from metadata:
24+
metadata = read_csv('peral_2018_metadata.csv')
25+
N = len(metadata)
26+
27+
### Define sample groups to bin together:
28+
groups = {l['Sample']: [] for l in metadata}
29+
for r in groups:
30+
groups[r] += [s for s in rawdata.samples if s.startswith(r)]
31+
32+
samples_new, D47_new, CM_new = rawdata.combine_samples(groups)
33+
34+
CM_klna = zeros((N, N))
35+
klna = zeros((N,))
36+
cores = []
37+
38+
for r in metadata:
39+
X = [x['d18O_VSMOW'] for s in groups[r['Sample']] for x in rawdata.samples[s]['data']]
40+
r['d18O_VSMOW'] = mean(X)
41+
r['d18c'] = (1000+r['d18O_VSMOW']) / rawdata.ALPHA_18O_ACID_REACTION / 1.03092 - 1000
42+
r['sd18c'] = rawdata.repeatability['r_d18O_VSMOW'] / rawdata.ALPHA_18O_ACID_REACTION / 1.03092 / len(X)**.5
43+
# print(r['Sample'], r['d18Oc_VPDB'], r['d18c'])
44+
if r['Sample'] == '2FPA1_UviMed':
45+
r['d18c'] -= 0.47
46+
r['klna'] = 1000 * log((1000+r['d18c'])/(1000+r['d18w'])*1.03092)
47+
r['sklna'] = sqrt(
48+
1e6 * r['sd18c']**2/(1000+r['d18c'])**2
49+
+ 1e6 * r['sd18w']**2/(1000+r['d18w'])**2
50+
)
51+
r['T18'] = 18030 / (r['klna'] + 32.17) - 273.15
52+
if r['Sample'] == '2FPA1_UviMed':
53+
r['d18c'] += 0.47
54+
print(r['Sample'], r['T18'])
55+
56+
for i,sample1 in enumerate(samples_new):
57+
r = [u for u in metadata if u['Sample'] == sample1][0]
58+
cores += [sample1.split('_')[0]]
59+
klna[i] = r['klna']
60+
for j, sample2 in enumerate(samples_new):
61+
if i == j:
62+
CM_klna[i,i] = 1e6 * r['sd18c']**2/(1000+r['d18c'])**2 + 1e6 * r['sd18w']**2/(1000+r['d18w'])**2
63+
break
64+
else:
65+
core1 = sample1.split('_')[0]
66+
core2 = sample2.split('_')[0]
67+
if core1 == core2 and core1 != 'MOCOSED':
68+
CM_klna[i,j] = 1e6 * r['sd18w']**2/(1000+r['d18w'])**2
69+
CM_klna[j,i] = CM_klna[i,j]
70+
71+
T18 = 18030/(klna + 32.17) - 273.15
72+
73+
### T = 18030/(klna + 32.17) - 273.15
74+
J = (-18030/(klna + 32.17)**2).reshape(N,1)
75+
76+
CM_T18 = CM_klna * (J.T * J)
77+
78+
def sortkey(x):
79+
return mean([l['T18'] for l in metadata if l['Sample'].split('_')[0] == x.split('_')[0]]) - (1 if x == 'MOCOSED_CWuel' else 0)
80+
o = sorted(range(N), key = lambda k: sortkey(samples_new[k]))
81+
82+
samples_new = array(samples_new)[o]
83+
D47_new = D47_new[o]
84+
klna = klna[o]
85+
T18 = T18[o]
86+
87+
CM_new = CM_new[o,:]
88+
CM_new = CM_new[:,o]
89+
CM_klna = CM_klna[o,:]
90+
CM_klna = CM_klna[:,o]
91+
CM_T18 = CM_T18[o,:]
92+
CM_T18 = CM_T18[:,o]
93+
94+
for s,D47,sD47,k, sk, T, sT in zip(samples_new, D47_new, diag(CM_new)**.5, klna, diag(CM_klna)**.5, T18, diag(CM_T18)**.5):
95+
print(f'{s:<20}{D47:8.4f}{sD47:8.4f}{k:8.2f}{sk:8.2f}{T:8.2f}{sT:8.2f}')
96+
97+
with open('peral_samples.csv', 'w') as f:
98+
f.write('Sample,N,d13C_VPDB,SE_d13C_VPDB,d18O_VPDB,SE_d18O_VPDB,D47_ICDES,SE_D47_ICDES,Tatlas,sTatlas')
99+
for ns, D47, sD47 in zip(samples_new, D47_new, diag(CM_new)**.5):
100+
Tpa, sTpa = peral_Tpubatlas[ns]['Tpubatlas'], peral_Tpubatlas[ns]['SE_Tpubatlas']
101+
os = [s for s in rawdata.unknowns if s.startswith(ns)]
102+
G = [r for r in rawdata if r['Sample'] in os]
103+
d13C = mean([r['d13C_VPDB'] for r in G])
104+
SE_d13C = G[0]['SE_d13C'] / len(G)**.5
105+
d18Oc = mean([r['d18O_VPDB'] for r in G])
106+
SE_d18Oc = G[0]['SE_d18O'] / len(G)**.5
107+
N = len(G)
108+
f.write(f'\n{ns},{N},{d13C:.3f},{SE_d13C:.3f},{d18Oc:.3f},{SE_d18Oc:.3f},{D47:.4f},{sD47:.4f},{Tpa:.2f},{sTpa:.2f}')
109+
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
Sample,N,d13C_VPDB,d18O_VSMOW,D47,SE,95% CL,SD,p_Levene
2+
ETH-1,33,2.02,37.02,0.2052,,,0.0165,
3+
ETH-2,32,-10.17,19.88,0.2085,,,0.0165,
4+
ETH-3,58,1.71,37.45,0.6132,,,0.0150,
5+
ETH-4,4,-10.22,19.72,0.4511,,,0.0042,
6+
2FPA1_UviMed250,4,0.02,41.63,0.6554,0.0076,± 0.0150,0.0060,0.175
7+
2FPA1_UviMed315,4,0.08,41.59,0.6540,0.0076,± 0.0150,0.0157,0.950
8+
2FPA1_UviMed355,3,0.17,41.66,0.6503,0.0087,± 0.0170,0.0122,0.552
9+
2FPA1_UviMed400,8,0.22,41.75,0.6410,0.0056,± 0.0110,0.0106,0.520
10+
2FPA1_UviMed450,4,0.29,41.75,0.6499,0.0076,± 0.0150,0.0084,0.272
11+
2FPA1_UviMed500,4,0.37,41.78,0.6448,0.0076,± 0.0149,0.0098,0.284
12+
2FPA1_UviMed560,4,0.47,41.78,0.6528,0.0076,± 0.0150,0.0073,0.195
13+
MD00-2360_menardi355,4,1.67,38.92,0.5977,0.0075,± 0.0147,0.0160,0.937
14+
MD00-2360_menardi400,4,1.75,39.00,0.6190,0.0074,± 0.0146,0.0138,0.873
15+
MD00-2360_menardi450,4,1.70,38.88,0.6168,0.0074,± 0.0145,0.0108,0.387
16+
MD00-2360_menardi500,4,1.71,38.79,0.5969,0.0073,± 0.0144,0.0076,0.296
17+
MD00-2360_menardi560,4,1.76,38.77,0.6124,0.0073,± 0.0143,0.0076,0.257
18+
MD00-2360_orbulina500,4,2.10,37.81,0.6023,0.0074,± 0.0145,0.0086,0.391
19+
MD00-2360_orbulina560,4,2.16,37.76,0.6139,0.0074,± 0.0145,0.0045,0.096
20+
MD00-2360_ruber250,7,0.96,37.48,0.5917,0.0058,± 0.0114,0.0105,0.210
21+
MD02-2577_menardi500,4,1.74,39.18,0.6142,0.0074,± 0.0145,0.0127,0.394
22+
MD02-2577_menardi560,4,1.85,39.48,0.6044,0.0074,± 0.0145,0.0135,0.512
23+
MD02-2577_orbulina560,4,2.25,38.79,0.6153,0.0074,± 0.0145,0.0157,0.699
24+
MD02-2577_ruber250,4,1.09,37.92,0.5959,0.0073,± 0.0144,0.0123,0.451
25+
MD02-2577_ruber315,4,1.50,37.78,0.5977,0.0073,± 0.0144,0.0142,0.849
26+
MD03-2680_pachyD200,4,0.46,41.09,0.6470,0.0074,± 0.0145,0.0120,0.704
27+
MD04-2720_pachyD200,4,1.42,42.67,0.6760,0.0075,± 0.0148,0.0047,0.124
28+
MD08-3179_inflata200,4,0.21,40.02,0.6272,0.0075,± 0.0147,0.0154,0.753
29+
MD08-3179_inflata250,4,0.63,40.30,0.6224,0.0073,± 0.0144,0.0139,0.525
30+
MD08-3179_inflata315,4,0.51,40.82,0.6376,0.0074,± 0.0146,0.0166,0.932
31+
MD08-3179_inflata355,4,0.83,40.54,0.6286,0.0074,± 0.0146,0.0086,0.265
32+
MD08-3179_inflata400,4,0.87,40.42,0.6219,0.0073,± 0.0144,0.0083,0.224
33+
MD08-3179_inflata450,3,1.00,40.59,0.6247,0.0085,± 0.0168,0.0109,0.446
34+
MD08-3179_ruber200,4,0.45,39.22,0.6224,0.0074,± 0.0145,0.0140,0.602
35+
MD08-3179_ruber250,4,0.95,39.21,0.6167,0.0073,± 0.0144,0.0214,0.341
36+
MD08-3179_truncaD315,4,0.88,40.39,0.6241,0.0074,± 0.0145,0.0164,0.763
37+
MD08-3179_truncaD355,4,0.96,40.39,0.6424,0.0074,± 0.0145,0.0188,0.550
38+
MD08-3179_truncaD400,4,0.98,40.48,0.6251,0.0074,± 0.0145,0.0098,0.468
39+
MD08-3179_truncaD450,4,0.96,40.42,0.6278,0.0074,± 0.0146,0.0022,0.047
40+
MD08-3179_truncaS355,4,0.92,40.42,0.6380,0.0074,± 0.0145,0.0078,0.253
41+
MD08-3179_truncaS400,4,1.08,40.41,0.6343,0.0074,± 0.0145,0.0207,0.438
42+
MD08-3179_truncaS450,4,1.06,40.52,0.6342,0.0074,± 0.0146,0.0066,0.175
43+
MD08-3182_bullo200,3,-0.32,41.20,0.6532,0.0085,± 0.0168,0.0037,0.109
44+
MD08-3182_bullo250,4,-0.24,41.14,0.6489,0.0074,± 0.0146,0.0069,0.236
45+
MD08-3182_bullo315,4,-0.23,41.24,0.6650,0.0074,± 0.0146,0.0089,0.241
46+
MD08-3182_bullo355,4,-0.18,41.22,0.6428,0.0074,± 0.0146,0.0124,0.624
47+
MD08-3182_pachyS200,4,0.60,41.13,0.6504,0.0074,± 0.0145,0.0049,0.089
48+
MD12-3401_bullo200,4,0.23,41.30,0.6572,0.0075,± 0.0147,0.0046,0.090
49+
MD12-3401_bullo250,4,0.52,41.42,0.6626,0.0075,± 0.0147,0.0138,0.569
50+
MD12-3426_menardi500,3,1.66,38.98,0.6146,0.0084,± 0.0165,0.0337,0.147
51+
MD12-3426_menardi560,4,1.61,38.87,0.6200,0.0074,± 0.0145,0.0131,0.890
52+
MD12-3426_orbulina560,4,2.30,37.51,0.6039,0.0073,± 0.0144,0.0099,0.210
53+
MD88-770_bullo250,5,0.62,41.73,0.6554,0.0081,± 0.0160,0.0142,0.557
54+
MD95-2014_bullo250,2,-0.27,41.06,0.6463,0.0112,± 0.0221,0.0102,
55+
MD95-2014_bullo315,4,0.28,41.51,0.6492,0.0074,± 0.0146,0.0149,0.791
56+
MD95-2014_bullo355,2,-0.14,41.07,0.6473,0.0103,± 0.0204,0.0094,
57+
MOCOSED_CWuel250,4,1.19,43.67,0.6889,0.0075,± 0.0149,0.0136,0.500
58+
MOCOSED_CWuel315,4,1.22,43.69,0.6724,0.0075,± 0.0148,0.0078,0.164
59+
MOCOSED_CWuel355,4,1.20,43.66,0.6976,0.0075,± 0.0148,0.0029,0.062
60+
MOCOSED_CWuel400,4,1.19,43.56,0.6807,0.0075,± 0.0148,0.0162,0.796
61+
MOCOSED_pachyS200,4,0.59,42.27,0.6678,0.0074,± 0.0146,0.0038,0.092
62+
MOCOSED_pachyS250,4,0.65,42.34,0.6654,0.0074,± 0.0145,0.0187,0.488
63+
SU90-03_bullo250,6,-0.39,40.95,0.6429,0.0063,± 0.0123,0.0079,0.091
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Session,Na,Nu,d13Cwg_VPDB,d18Owg_VSMOW,r_d13C,r_d18O,r_D47,a ± SE,1e3 x b ± SE,c ± SE
2+
2015-05,19,12,-3.725,25.192,0.0458,0.0544,0.0145,0.839 ± 0.016,-4.291 ± 0.211,-0.917 ± 0.007
3+
2017-06,34,85,-3.737,33.922,0.0306,0.0828,0.0140,0.877 ± 0.012,-5.911 ± 0.209,-0.821 ± 0.006
4+
2017-07,35,84,-3.724,33.969,0.0402,0.1028,0.0161,0.858 ± 0.011,-6.201 ± 0.199,-0.811 ± 0.005
5+
2017-08,23,31,-3.729,33.917,0.0290,0.0856,0.0138,0.867 ± 0.013,-3.614 ± 0.252,-0.813 ± 0.006
6+
2017-09,16,22,-3.734,33.935,0.0286,0.0883,0.0148,0.875 ± 0.016,-4.372 ± 0.273,-0.813 ± 0.007
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
N samples (anchors + unknowns),62 (4 + 58)
2+
N analyses (anchors + unknowns),361 (127 + 234)
3+
Repeatability of δ13C_VPDB,34.8 ppm
4+
Repeatability of δ18O_VSMOW,84.3 ppm
5+
Repeatability of Δ47 (anchors),16.4 ppm
6+
Repeatability of Δ47 (unknowns),12.3 ppm
7+
Repeatability of Δ47 (all),14.0 ppm
8+
Model degrees of freedom,288
9+
Student's 95% t-factor,1.97
10+
Standardization method,pooled
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Sample,d18w,sd18w
2+
MOCOSED_CWuel,0.27,0.2
3+
MD04-2720_pachyD,-0.34,0.21
4+
MOCOSED_pachyS,0.1,0.28
5+
MD12-3401_bullo,-0.15,0.21
6+
MD95-2014_bullo,0.39,0.2
7+
MD08-3182_bullo,0.33,0.38
8+
MD08-3182_pachyS,0.33,0.38
9+
MD03-2680_pachyD,0.36,0.2
10+
2FPA1_UviMed,0.59,0.2
11+
SU90-03_bullo,1.07,0.26
12+
MD08-3179_inflata315,1.07,0.27
13+
MD08-3179_inflata450,1.07,0.27
14+
MD08-3179_inflata355,1.07,0.27
15+
MD08-3179_truncaS,1.07,0.27
16+
MD08-3179_inflata400,1.07,0.27
17+
MD08-3179_truncaD,1.07,0.27
18+
MD08-3179_inflata250,1.07,0.27
19+
MD08-3179_inflata200,1.07,0.27
20+
MD12-3426_menardi,0.1,0.23
21+
MD02-2577_menardi,0.76,0.23
22+
MD00-2360_menardi,0.35,0.23
23+
MD08-3179_ruber,1.07,0.27
24+
MD02-2577_orbulina,0.76,0.23
25+
MD12-3426_orbulina,0.1,0.23
26+
MD00-2360_orbulina,0.35,0.23
27+
MD00-2360_ruber,0.35,0.23
28+
MD02-2577_ruber,0.76,0.23

0 commit comments

Comments
 (0)