コード例 #1
0
import a

calcbstraps = 1

destdir = "/hiskp2/oehm/analysis/baryons/A40.24/"

correlator = sys.argv[1]

if calcbstraps == 1:

	x = a.readcor("/hiskp2/oehm/baryon/contractions/A40.24/correlators/"+correlator,48)

	x = x[0:50,:]

	x_bstraps = a.boot(x,1500)

	np.save(os.path.join(destdir,correlator+"_x_bstraps50.npy"),x_bstraps)
else:
	x_bstraps = np.load(os.path.join(destdir,correlator+"_x_bstraps50.npy"))

if correlator == "corr1":
	for t in range(0,48):
		x_bstraps[:,t] = -x_bstraps[:,t]

if correlator == "corr2":
	for t in range(24,48):
		x_bstraps[:,t] = -x_bstraps[:,t]


_effmass, effmass_error, effmass_nans = a.effmass(x_bstraps)
コード例 #2
0
import a


sigma = int(sys.argv[1])
print "sigma "+str(sigma)

a.ensure_dir("/hiskp2/oehm/correlators/momentum/A40.24/O012/analysis/sigma"+str(sigma)+"/")

numBootstraps = 1500

O012 = a.readcor("/hiskp2/oehm/correlators/momentum/A40.24/O012/sigma"+str(sigma)+"/O012_sigma"+str(sigma),48)
xn = a.readcor("/hiskp2/oehm/correlators/momentum/A40.24/x/sigma"+str(sigma)+"/x"+str(sigma),48)
O012 = a.asym(O012)
xn = a.sym(xn)
O012_bstraps = a.boot(O012,numBootstraps)
O012_bstraps_mean = np.mean(O012_bstraps,axis=0)
xn_bstraps = a.boot(xn,numBootstraps)
xn_bstraps_mean = np.mean(xn_bstraps,axis=0)

xn_result = np.zeros((21,numBootstraps,4))

effmass, effmass_error, effmass_nans = a.effmass(xn_bstraps)

print effmass

xnfunc = lambda p,x: p[0]*(np.exp(-x*p[1])+np.exp(-(48-x)*p[1]))
O012_func = lambda p,x: p[0]

tt = []
for t in range(0,25):
コード例 #3
0
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir) 

import a

import numpy as np

numBoots = 200

#O0123_1 = a.readcor("/hiskp2/oehm/correlators/momentum3/A80/O0123/sigma1/O0123_sigma1",48)
#O0123_2 = a.readcor("/hiskp2/oehm/correlators/momentum3/A80/O0123/sigma2/O0123_sigma2",48)
#O0123_3 = a.readcor("/hiskp2/oehm/correlators/momentum3/A80/O0123/sigma3/O0123_sigma3",48)
#O0123_4 = a.readcor("/hiskp2/oehm/correlators/momentum3/A80/O0123/sigma4/O0123_sigma4",48)
#O0123_5 = a.readcor("/hiskp2/oehm/correlators/momentum3/A80/O0123/sigma5/O0123_sigma5",48)
O0123_5t8 = a.readcor("/hiskp2/oehm/correlators/momentum3/A80/O0123/sigma5-8/O0123_sigma5-8",48)

#O0123_1_bstraps = a.boot(O0123_1,numBoots)
#O0123_2_bstraps = a.boot(O0123_2,numBoots)
#O0123_3_bstraps = a.boot(O0123_3,numBoots)
#O0123_4_bstraps = a.boot(O0123_4,numBoots)
#O0123_5_bstraps = a.boot(O0123_5,numBoots)
O0123_5t8_bstraps = a.boot(O0123_5t8,numBoots)

#a.nsettofile2(O0123_1_bstraps[0,:],np.std(O0123_1_bstraps,axis=0),"/hiskp2/oehm/correlators/momentum3/A80/O0123/analysis/O0123_1")
#a.nsettofile2(O0123_2_bstraps[0,:],np.std(O0123_2_bstraps,axis=0),"/hiskp2/oehm/correlators/momentum3/A80/O0123/analysis/O0123_2")
#a.nsettofile2(O0123_3_bstraps[0,:],np.std(O0123_3_bstraps,axis=0),"/hiskp2/oehm/correlators/momentum3/A80/O0123/analysis/O0123_3")
#a.nsettofile2(O0123_4_bstraps[0,:],np.std(O0123_4_bstraps,axis=0),"/hiskp2/oehm/correlators/momentum3/A80/O0123/analysis/O0123_4")
#a.nsettofile2(O0123_5_bstraps[0,:],np.std(O0123_5_bstraps,axis=0),"/hiskp2/oehm/correlators/momentum3/A80/O0123/analysis/O0123_5")
a.nsettofile2(O0123_5t8_bstraps[0,:],np.std(O0123_5t8_bstraps,axis=0),"/hiskp2/oehm/correlators/momentum3/A80/O0123/analysis/O0123_5t8")

コード例 #4
0
ファイル: fit2pt.py プロジェクト: MaxOGH/development_analysis
if calcbstraps == 1:

	x1 = a.readcor("/hiskp2/oehm/baryon/contractions/A40.24/correlators/"+correlator1,T)
	x2 = a.readcor("/hiskp2/oehm/baryon/contractions/A40.24/correlators/"+correlator2,T)
	
	y1 = np.zeros(x1.shape[0],T/2+1)
	y2 = np.zeros(x1.shape[0],T/2+1)

	for i in range(0,x.shape[0]):
		y1[i,0] = x1[i,0]
		y2[i,0] = x2[i,0]
		for t in range(1,T/2+1):
			y1[i,t] = (x1[i,t]+x2[i,T-t])/2
			y2[i,t] = (x2[i,t]+x1[i,T-t])/2

	y1_bstraps = a.boot(y1,1500)
	y2_bstraps = a.boot(y2,1500)

	np.save(os.path.join(destdir,correlator1+"_"+correlator2+"_y1_bstraps.npy"),y1_bstraps)
	np.save(os.path.join(destdir,correlator1+"_"+correlator2+"_y2_bstraps.npy"),y2_bstraps)
else:
	y1_bstraps = np.load(os.path.join(destdir,correlator1+"_"+correlator2+"_y1_bstraps.npy"))
	y2_bstraps = np.load(os.path.join(destdir,correlator1+"_"+correlator2+"_y2_bstraps.npy"))


#fit 2pt functions to the two correlation functions of the partiy partners 

def fit2pttoy(xn_bstraps):

	xnfunc = lambda p,x: p[0]*(np.exp(-x*p[1])+np.exp(-(T-x)*p[1]))
コード例 #5
0
	else:
		data = a.sym(data)

	errors = a.autocorr_bstrap(data,int(taskr.rparam("start")),int(taskr.rparam("end")),numBstraps)

	a.plotautocorr_bstrap(errors,os.path.join(destdir,"autocorr_bstrap.pdf"))
elif task == "mwerr":
	data = a.readcor(runr.getopcf(op,sigma),latT)

	if runr.istrue("wpe"):
		data = a.sym_wope(data)
		data = data[:,1:len(data[0])-1]
	else:
		data = a.sym(data)

	databstraps = a.boot(data,numBstraps)

	a.nsettofile2(databstraps[0],np.std(databstraps,axis=0),os.path.join(destdir,op+"_mean_werr"))
elif task == "fitplatval2":
	doasym = 0
	if taskr.istrue("asym"):
		doasym = 1

	wpe = 0
	if runr.istrue("wpe"):
		wpe = 1

	print "wpe: "+str(wpe)

	a.fitplatval2(runr.getopcf(op,sigma),destdir,latT,numBstraps,doasym,wpe)
elif task == "plotbstraphists":
コード例 #6
0
numBootstraps = 1500

lattice = sys.argv[1]
print "destdir: "+"/hiskp2/oehm/averx/analysis/"+lattice+"/"

T = int(sys.argv[2])
print "T: "+str(T)

ensure_dir("/hiskp2/oehm/averx/analysis/"+lattice+"/")

O44 = a.readcor("/hiskp2/oehm/averx/"+lattice+"/maxmomf2e",T)
xn = a.readcor("/hiskp2/oehm/averx/"+lattice+"/maxppcor",T)
O44 = a.sym_wope(O44)

xn = a.sym(xn)
O44_bstraps = a.boot(O44,numBootstraps)
O44_bstraps_mean = np.mean(O44_bstraps,axis=0)
xn_bstraps = a.boot(xn,numBootstraps)
xn_bstraps_mean = np.mean(xn_bstraps,axis=0)

xn_result = np.zeros((T/2+1-4,numBootstraps,4))

effmass, effmass_error, effmass_nans = a.effmass(xn_bstraps)

print effmass

xnfunc = lambda p,x: p[0]*(np.exp(-x*p[1])+np.exp(-(T-x)*p[1]))
O44_func = lambda p,x: p[0]

tt = []
for t in range(0,T/2+1):