'n_samples': 20, 'n_exact_depths': 3, 'n_gl': 20, # number of glaciations 'bottom_depth_m': 10, 'alt': 220, # surface elevation, assumed constant, m 'lat': 44.544, 'rho': 2.67, # g/cm2 # define max allowable parameter values to normalize to 'max_dz_m': 15, # max m of rock eroded each glaciation 'min_dz_m': 0.01, # m 't_gl': 15000, 't_int': 85000, 't_postgl': 15500, 'postgl_shielding': 80, # postglacial shielding correction (for snow/till cover) 'nuclide': nuclide.Be10Qtz(), # define our parameters for the Neighborhood Algorithm 'ns': 50, # number of samples each iteration 'nr': 25, # number of voronoi cells that we explore in each iteration 'ensemble_size': 10000, # 'n_best': 200, 'interp_pts': 500, 'tol_reduced_chi2': 2, } con['n_params'] = con['n_exact_depths'] + 1 con['dof'] = con['n_samples'] - con['n_params'] con['bottom_depth'] = con['bottom_depth_m'] * 100 * con['rho'] con['max_dz'] = con['max_dz_m'] * 100 * con['rho'] con['min_dz'] = con['min_dz_m'] * 100 * con['rho']
from __future__ import division import numpy as np import numpy.random import matplotlib.pyplot as plt from cosmogenic import util import nuclide import sim n = nuclide.Be10Qtz() # get the data from the simulation loaded into memory concs = np.genfromtxt('concs.txt') errors = np.genfromtxt('errors.txt') models = np.genfromtxt('models.txt') conc_true = np.genfromtxt('conc_true.txt') conc_meas = np.genfromtxt('conc_meas.txt') conc_meas_err = n.measurement_error(conc_meas) ms = np.genfromtxt('ms.txt') misfits = np.genfromtxt('misfits.txt') constraints = util.unpickle('constraints.dat') con = constraints p = util.unpickle('production_rate.dat') dof = con['n_gl'] # denormalize the models ms *= con['max_dz'] / con['rho'] / 100.0 dz_true_m = con['dz_true_m'] # get data for plotting a depth vs time curve
""" Plot production ratio of Al26 and Be10 """ import numpy as np import pylab import nuclide import production def plot_production_ratio(n1, n2, max_depth_gcm2, npts=200): """ Plot the production ratio of two nuclides with depth """ z = np.linspace(start=0, stop=max_depth_gcm2, num=npts) alt = 0 lat = 75 p1 = production.P_tot(z, alt, lat, n1) p2 = production.P_tot(z, alt, lat, n2) fig = pylab.figure() ax = fig.add_subplot(111) ax.plot(p1 / p2, z) ax.invert_yaxis() ax.set_xlabel('n1/n2') ax.set_ylabel(r'Depth (g/cm^2)') pylab.show() return (fig, ax) if __name__ == "__main__": plot_production_ratio(nuclide.Al26Qtz(), nuclide.Be10Qtz(), 10680.0)