# 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)
#====================================================================
Example #2
0
                                predictPositions, topDate)

# recast in years CE
chronCE = np.fliplr(1950 - chronBP)

#==========================================================================

# 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 ###
Example #3
0
# NOTE: PlACEHOLDER.

#dcell = cell_archive()

#==============================================================
# 5. RUN OBSERVATION MODEL
#==============================================================

# Call function bam_simul_perturb to compute ensemble of plausible
# age-uncertain records and account for analytical uncertainty.

# 5.1: Ring Miscount Uncertainty Model:

X=dcell
t=time
X=X.reshape(len(X),1)
tp, Xp, tmc = bam_simul_perturb(X,t,param=[0.05,0.05],name='poisson',ns=1000,resize=0)
#==============================================================

# 5.2: Analytical Uncertainty Model:

#5.2.1 Simple Model: just add uncertainty bands based on measurement precision
sigma=0.1 # permil, measurement  precision
dcell_upper, dcell_lower = analytical_err_simple(X,sigma)

#5.2.2 Gaussian Noise Model for analytical error:
sigma=0.1
#nsamples = ## enter number of samples here
dcell_Xn=analytical_error(X,sigma)
#==============================================================
Example #4
0
X = ice_diffused
X = X.reshape(len(X), 1)
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...