This set of python scripts calculates smoothed time series for del13Ccarb, del13Corg and fractional organic burial. The scripts apply the LOWESS smoothing algorithm and the Kernel regression smoothing algorithm, as described in J. Krissansen-Totton, R. Buick and D.C. Catling (2015) A statistical analysis of the carbon isotope record from the Archean to the Phanerozoic and implications for the rise of oxygen, American Journal of Science.

Requirements:
Python, numpy module, scipy module, statsmodels module, pylab module, matplotlib module.
Python and all the packages above are available for free through in the Enthought Canopy (Canopy Express) available here: https://store.enthought.com/

forg_LOWESS:
This function loads the carbonate and organic isotope data and applies the LOWESS smoothing algorithm to obtain smoothed del13Ccarb and del13Corg curves as a function of time, with uncertainties. This are combined to produce a smoothed forg curve with uncertainties. The results from the LOWESS calculations are saved as three separate arrays. The optimal window length for each data set is specified. forg_LOWESS and forg_Kernel are almost identical functions; they differ only in that they utilize different smoothing methods.

forg_Kernel:
This function loads the carbonate and organic isotope data and applies the Kernel regression algorithm to obtain smoothed del13Ccarb and del13Corg curves as a function of time, with uncertainties. This are combined to produce a smoothed forg curve with uncertainties. The results from the Kernel regression calculations are saved as three separate arrays. forg_LOWESS and forg_Kernel are almost identical functions; they differ only in that they utilize different smoothing methods.

plot_LOWESS_KERNEL:
This function cannot be ran until output arrays are created by the two functions above. It combines the outputs above to produce the figures 3a, 3b and 3c in the main text (though without the Kalman smoother result for which the calculation is not included).

The data files used by this script are numpy array files that contain filtered data, binned using 10 my year intervals. These are easily produced from the excel spreadsheet containing all our data. The files include:
carb_10my_t.npy: carbonates, time axis
carb_10my_v.npy: carbonates, isotope values
org_10my_t.npy: organics, time axis
org_10my_v.npy: organics, isotope values

org_array_LOWESS.npy, carb_array_LOWESS.npy, org_array_KERNEL.npy and carb_array_KERNEL.npy are output arrays created by the forg_LOWESS and forg_KERNEL scripts, which are used by plot_LOWESS_KERNEL
