def skewed_crystal_diffPatterns(crystal, theta):
dx_filter = 1
crystal_skewed = np.zeros((crystal.shape[0], np.floor((crystal.shape[1]/np.cos(theta))) + 50 ))
crystal_filter2D_skewed = np.zeros(( crystal_skewed.shape[0], crystal_skewed.shape[1] ))
# simulate skewed diffraction patterns
theta = 10*np.pi/180
for i in range(0,crystal.shape[0]-6):
for j in range(0,crystal.shape[1]-6):
xs = ceil(j / (1 + np.tan(theta)**2) + i*np.tan(theta)/ ( 1 + np.tan(theta)**2) )
ys = i
crystal_skewed[ys,xs] = crystal[i,j]
for row in range(80,150,dx_filter):
for col in range(80,160,dx_filter):
crystal_filter2D_skewed[row,col] = 1
diffPattern = abs( fft.fftshift(fft.fft2(crystal_skewed)))**2
return (diffPattern, crystal_filter2D_skewed)
#diffPattern_skewed, crystal_filter2D_skewed = skewed_crystal_diffPatterns(crystal, theta )
# call shrinkwrap for filtered skewed crystal
# yel = shrinkwrap(diffPattern_skewed*crystal_filter2D_skewed)
test_3dgauss_and_3d_plotting.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录