This notebook is to show how to read a LiPD file and generate ensemble of age-depth models by python packages LiPD (https://github.com/nickmckay/LiPD-utilities) and Pyleoclim (https://github.com/LinkedEarth/Pyleoclim_util)


In [17]:
%matplotlib inline
import numpy as np
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt

In [12]:
import lipd

In [13]:
lipd_file = lipd.readLipd('Crystal.McCabe-Glynn.2013.lpd')


Disclaimer: LiPD files may be updated and modified to adhere to standards

reading: Crystal.McCabe-Glynn.2013.lpd
Finished read: 1 record

In [1]:
import pyleoclim as pyleo

In [2]:
lipds = pyleo.openLipd("Crystal.McCabe-Glynn.2013.lpd")


Disclaimer: LiPD files may be updated and modified to adhere to standards

reading: Crystal.McCabe-Glynn.2013.lpd
Finished read: 1 record

In [3]:
ts_list = pyleo.fetchTs(lipds)


extracting paleoData...
extracting: Crystal.McCabe-Glynn.2013
Created time series: 3 entries

In [4]:
fig = pyleo.mapLipd()


0 :  Crystal.McCabe-Glynn.2013 :  depth
1 :  Crystal.McCabe-Glynn.2013 :  age_ad
2 :  Crystal.McCabe-Glynn.2013 :  d18o_vpdb
Enter the number of the variable you wish to use: 2

In [7]:
# get d18o time series
d18o=ts_list[2]['paleoData_values']

In [14]:
# Run age model BChron
depth, chron, positions, ageDist, fig = pyleo.Bchron(lipd_file, calCurves = ["normal"],reservoirAgeCorr=[0,0],saveLipd=False)


No previous model available. Creating model...
Looking for age data...
No match found on exact search, running partial match
No match found.
Here are the available variables: 
0 :  sample
1 :  depth
2 :  238u
3 :  238u_uncertainty
4 :  232th
5 :  232th_uncertainty
6 :  230th/232th
7 :  230th/232th_uncertainty
8 :  d234u
9 :  d234u_undertainty
10 :  230th/238u
11 :  230th/238u_uncertainty
12 :  230th age
13 :  230th age_uncertainty
14 :  230th age-1
15 :  230th age_uncertaity
16 :  d234uinitial
17 :  d234uinitial_uncertainty
18 :  230th age-2
19 :  230th age_uncertainty-1
Please select the variable you'd like to use or enter to continue: 18
Age data found.
Looking for a depth/position column...
Depth information found.
Looking for age uncertainty...
More than one series match your search criteria
0 :  d234uinitial_uncertainty
1 :  230th age_uncertainty-1
2 :  230th age_uncertainty
3 :  230th/238u_uncertainty
4 :  230th/232th_uncertainty
5 :  238u_uncertainty
6 :  232th_uncertainty
Enter the number for the variable: 1
Uncertainty data found.
Checking that list contains valid calibration curves ...
Verification complete!
Calibration curves found.
Running Bchron. This could take a few minutes...
Checking that list contains valid calibration curves ...
Verification complete!
  |                                                                  
  |                                                            |   0%
  |                                                                  
  |                                                            |   1%
  |                                                                  
  |=                                                           |   1%
  |                                                                  
  |=                                                           |   2%
  |                                                                  
  |==                                                          |   3%
  |                                                                  
  |==                                                          |   4%
  |                                                                  
  |===                                                         |   4%
  |                                                                  
  |===                                                         |   5%
  |                                                                  
  |===                                                         |   6%
  |                                                                  
  |====                                                        |   6%
  |                                                                  
  |====                                                        |   7%
  |                                                                  
  |=====                                                       |   8%
  |                                                                  
  |=====                                                       |   9%
  |                                                                  
  |======                                                      |   9%
  |                                                                  
  |======                                                      |  10%
  |                                                                  
  |======                                                      |  11%
  |                                                                  
  |=======                                                     |  11%
  |                                                                  
  |=======                                                     |  12%
  |                                                                  
  |========                                                    |  13%
  |                                                                  
  |========                                                    |  14%
  |                                                                  
  |=========                                                   |  14%
  |                                                                  
  |=========                                                   |  15%
  |                                                                  
  |=========                                                   |  16%
  |                                                                  
  |==========                                                  |  16%
  |                                                                  
  |==========                                                  |  17%
  |                                                                  
  |===========                                                 |  18%
  |                                                                  
  |===========                                                 |  19%
  |                                                                  
  |============                                                |  19%
  |                                                                  
  |============                                                |  20%
  |                                                                  
  |============                                                |  21%
  |                                                                  
  |=============                                               |  21%
  |                                                                  
  |=============                                               |  22%
  |                                                                  
  |==============                                              |  23%
  |                                                                  
  |==============                                              |  24%
  |                                                                  
  |===============                                             |  24%
  |                                                                  
  |===============                                             |  25%
  |                                                                  
  |===============                                             |  26%
  |                                                                  
  |================                                            |  26%
  |                                                                  
  |================                                            |  27%
  |                                                                  
  |=================                                           |  28%
  |                                                                  
  |=================                                           |  29%
  |                                                                  
  |==================                                          |  29%
  |                                                                  
  |==================                                          |  30%
  |                                                                  
  |==================                                          |  31%
  |                                                                  
  |===================                                         |  31%
  |                                                                  
  |===================                                         |  32%
  |                                                                  
  |====================                                        |  33%
  |                                                                  
  |====================                                        |  34%
  |                                                                  
  |=====================                                       |  34%
  |                                                                  
  |=====================                                       |  35%
  |                                                                  
  |=====================                                       |  36%
  |                                                                  
  |======================                                      |  36%
  |                                                                  
  |======================                                      |  37%
  |                                                                  
  |=======================                                     |  38%
  |                                                                  
  |=======================                                     |  39%
  |                                                                  
  |========================                                    |  39%
  |                                                                  
  |========================                                    |  40%
  |                                                                  
  |========================                                    |  41%
  |                                                                  
  |=========================                                   |  41%
  |                                                                  
  |=========================                                   |  42%
  |                                                                  
  |==========================                                  |  43%
  |                                                                  
  |==========================                                  |  44%
  |                                                                  
  |===========================                                 |  44%
  |                                                                  
  |===========================                                 |  45%
  |                                                                  
  |===========================                                 |  46%
  |                                                                  
  |============================                                |  46%
  |                                                                  
  |============================                                |  47%
  |                                                                  
  |=============================                               |  48%
  |                                                                  
  |=============================                               |  49%
  |                                                                  
  |==============================                              |  49%
  |                                                                  
  |==============================                              |  50%
  |                                                                  
  |==============================                              |  51%
  |                                                                  
  |===============================                             |  51%
  |                                                                  
  |===============================                             |  52%
  |                                                                  
  |================================                            |  53%
  |                                                                  
  |================================                            |  54%
  |                                                                  
  |=================================                           |  54%
  |                                                                  
  |=================================                           |  55%
  |                                                                  
  |=================================                           |  56%
  |                                                                  
  |==================================                          |  56%
  |                                                                  
  |==================================                          |  57%
  |                                                                  
  |===================================                         |  58%
  |                                                                  
  |===================================                         |  59%
  |                                                                  
  |====================================                        |  59%
  |                                                                  
  |====================================                        |  60%
  |                                                                  
  |====================================                        |  61%
  |                                                                  
  |=====================================                       |  61%
  |                                                                  
  |=====================================                       |  62%
  |                                                                  
  |======================================                      |  63%
  |                                                                  
  |======================================                      |  64%
  |                                                                  
  |=======================================                     |  64%
  |                                                                  
  |=======================================                     |  65%
  |                                                                  
  |=======================================                     |  66%
  |                                                                  
  |========================================                    |  66%
  |                                                                  
  |========================================                    |  67%
  |                                                                  
  |=========================================                   |  68%
  |                                                                  
  |=========================================                   |  69%
  |                                                                  
  |==========================================                  |  69%
  |                                                                  
  |==========================================                  |  70%
  |                                                                  
  |==========================================                  |  71%
  |                                                                  
  |===========================================                 |  71%
  |                                                                  
  |===========================================                 |  72%
  |                                                                  
  |============================================                |  73%
  |                                                                  
  |============================================                |  74%
  |                                                                  
  |=============================================               |  74%
  |                                                                  
  |=============================================               |  75%
  |                                                                  
  |=============================================               |  76%
  |                                                                  
  |==============================================              |  76%
  |                                                                  
  |==============================================              |  77%
  |                                                                  
  |===============================================             |  78%
  |                                                                  
  |===============================================             |  79%
  |                                                                  
  |================================================            |  79%
  |                                                                  
  |================================================            |  80%
  |                                                                  
  |================================================            |  81%
  |                                                                  
  |=================================================           |  81%
  |                                                                  
  |=================================================           |  82%
  |                                                                  
  |==================================================          |  83%
  |                                                                  
  |==================================================          |  84%
  |                                                                  
  |===================================================         |  84%
  |                                                                  
  |===================================================         |  85%
  |                                                                  
  |===================================================         |  86%
  |                                                                  
  |====================================================        |  86%
  |                                                                  
  |====================================================        |  87%
  |                                                                  
  |=====================================================       |  88%
  |                                                                  
  |=====================================================       |  89%
  |                                                                  
  |======================================================      |  89%
  |                                                                  
  |======================================================      |  90%
  |                                                                  
  |======================================================      |  91%
  |                                                                  
  |=======================================================     |  91%
  |                                                                  
  |=======================================================     |  92%
  |                                                                  
  |========================================================    |  93%
  |                                                                  
  |========================================================    |  94%
  |                                                                  
  |=========================================================   |  94%
  |                                                                  
  |=========================================================   |  95%
  |                                                                  
  |=========================================================   |  96%
  |                                                                  
  |==========================================================  |  96%
  |                                                                  
  |==========================================================  |  97%
  |                                                                  
  |=========================================================== |  98%
  |                                                                  
  |=========================================================== |  99%
  |                                                                  
  |============================================================|  99%
  |                                                                  
  |============================================================| 100%
Placing all the tables in the LiPD object...
Plotting...

In [15]:
#chron is the array of the ensemble of age model, the first dimension is number of depth_sample
# the second dimension is Monte-Carlo numbers (here is 1000)
chron.shape


Out[15]:
(1054, 1000)

In [18]:
# plot one of possible realization of d18O time series
plt.plot(chron[:,0],d18o)


Out[18]:
[<matplotlib.lines.Line2D at 0x1d2bb45588>]

In [ ]: