Refactor slice summations
This commit is contained in:
parent
891a620016
commit
b7903e427e
@ -382,13 +382,8 @@ def box_int(file,box):
|
|||||||
nF=frN-fr0
|
nF=frN-fr0
|
||||||
|
|
||||||
# omega fit
|
# omega fit
|
||||||
cnts=np.zeros(nF)
|
|
||||||
om=dat["rot_angle"][fr0:frN]
|
om=dat["rot_angle"][fr0:frN]
|
||||||
j=0
|
cnts = dat["data"][fr0:frN,j0:jN,i0:iN].sum(axis=(1,2))
|
||||||
for i in range(fr0,frN):
|
|
||||||
sliceXY = dat["data"][i,j0:jN,i0:iN]
|
|
||||||
cnts[j] = np.sum(sliceXY)
|
|
||||||
j=j+1
|
|
||||||
|
|
||||||
p0 = [1., 0., 1.]
|
p0 = [1., 0., 1.]
|
||||||
coeff, var_matrix = curve_fit(gauss, range(len(cnts)), cnts, p0=p0)
|
coeff, var_matrix = curve_fit(gauss, range(len(cnts)), cnts, p0=p0)
|
||||||
@ -411,15 +406,9 @@ def box_int(file,box):
|
|||||||
plt.xlabel('Frame N of the box')
|
plt.xlabel('Frame N of the box')
|
||||||
label='om'
|
label='om'
|
||||||
# gamma fit
|
# gamma fit
|
||||||
sliceXZ=np.zeros((nF,iX))
|
sliceXY = dat["data"][fr0:frN,j0:jN,i0:iN]
|
||||||
sliceYZ=np.zeros((nF,jY))
|
sliceXZ = np.sum(sliceXY,axis=1)
|
||||||
|
sliceYZ = np.sum(sliceXY,axis=2)
|
||||||
j=0
|
|
||||||
for i in range(fr0,frN):
|
|
||||||
sliceXY = dat["data"][i,j0:jN,i0:iN]
|
|
||||||
sliceXZ[j] = np.sum(sliceXY,axis=0)
|
|
||||||
sliceYZ[j] = np.sum(sliceXY,axis=1)
|
|
||||||
j=j+1
|
|
||||||
|
|
||||||
projX = np.sum(sliceXZ, axis=0)
|
projX = np.sum(sliceXZ, axis=0)
|
||||||
p0 = [1., 0., 1.]
|
p0 = [1., 0., 1.]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user