#========================================================================== # 3.2: Analytical Uncertainty Model: print 'Adding uncertainty...' #Enter final simulated speleothem record (choose from above options) X = d18O_wm1 #X=d18O_wm2 #3.2.1 Simple Model: just add uncertainty bands based on measurement precision sigma = 0.1 # permil, measurement precision speleo_upper, speleo_lower = analytical_err_simple(X, sigma) #3.2.2 Gaussian Noise Model for analytical error: sigma = 0.1 #nsamples = ## enter number of samples here speleo_Xn = analytical_error(X, sigma) #==================================================================== # Save whatever needs to be saved print 'Saving data...' outdir = './results/' np.save(outdir + "speleo_Xn.npy", speleo_Xn) #Whatever else... #==================================================================== ###Move this to a separate plotting script ### #f, (ax1, ax2, ax3) = plt.subplots(3, 1, sharex=True) #f.set_figheight(12); f.set_figwidth(8) #plt.rcParams['text.usetex']=True #plt.rcParams['text.latex.unicode']=True #plt.rcParams['font.family']='serif'
# 4.1 Specify and model rate of annual layer miscount: BAM (see doctring) print('Running observation model...') X = coral X = X.reshape(len(X), 1) tp, Xp, tmc = bam_simul_perturb(X, time, param=[0.02, 0.02], name='poisson', ns=1000, resize=0) #====================================================================== # 4.2: Analytical Uncertainty Model: #4.2.1 Simple Model: just add uncertainty bands based on measurement precision sigma = 0.1 # permil, measurement precision coral_upper, coral_lower = analytical_err_simple(X, sigma) #4.2.2 Gaussian Noise Model for analytical error: sigma = 0.1 #nsamples = ## enter number of samples here coral_Xn = analytical_error(X, sigma) #==================================================================== # Save coral timeseries fields as numpy arrays in current directory. print('Saving time series...') outdir = './results/' np.save(outdir + "simulated_coral_d18O.npy", coral) np.save(outdir + "coral_age_perturbed.npy", Xp) #coral_error_bounds=np.save('coral_error.npy',coral_upper, coral_lower) #====================================================================
t = time tp, Xp, tmc = bam_simul_perturb(X, t, param=[0.01, 0.01], name='poisson', ns=1000, resize=0) #====================================================================== # 5.2: Analytical Uncertainty Model: print 'Adding uncertainty...' #5.2.1 Simple Model: just add uncertainty bands based on measurement precision sigma = 0.1 # permil, measurement precision ice_upper, ice_lower = analytical_err_simple(X, sigma) #5.2.2 Gaussian Noise Model for analytical error: sigma = 0.1 #nsamples = ## enter number of samples here ice_Xn = analytical_error(X, sigma) #==================================================================== # Save whatever needs to be saved print 'Saving data...' outdir = './results/' np.save(outdir + "ice_Xn.npy", ice_Xn) np.save(outdir + "ice_diffused.npy", ice_diffused) np.save(outdir + "ice_depth.npy", z) np.save(outdir + "ice_time_d.npy", time_d) #Whatever else... #====================================================================