示例#1
0
文件: refine.py 项目: ourobouros/WRed
def calcstar():
    ar = N.sqrt(3 * A**2 + C**2) / 3
    alphar = 2 * N.arcsin(3 / 2 / N.sqrt(3 + (C / A)**2))
    a = N.array([ar], 'Float64')
    b = N.array([ar], 'Float64')
    c = N.array([ar], 'Float64')
    alpha = N.array([alphar], 'Float64')
    beta = N.array([alphar], 'Float64')
    gamma = N.array([alphar], 'Float64')
    orient1 = N.array([[1, 0, 0]], 'Float64')
    orient2 = N.array([[0, 0, 1]], 'Float64')
    orientation = lattice_calculator.Orientation(orient1, orient2)
    lattice = lattice_calculator.Lattice(a=a,b=b,c=c,alpha=alpha,beta=beta,gamma=gamma,\
                                 orientation=orientation)
    astar = lattice.astar
    alphastar = lattice.alphastar
    return astar[0], alphastar[0], lattice
示例#2
0
文件: refine.py 项目: ourobouros/WRed
def calcd(H, K, L):
    a = N.array([A], 'Float64')
    b = N.array([B], 'Float64')
    c = N.array([C], 'Float64')

    alpha = N.radians(N.array([90], 'Float64'))
    beta = N.radians(N.array([90], 'Float64'))
    gamma = N.radians(N.array([120], 'Float64'))
    orient1 = N.array([[1, 0, 0]], 'Float64')
    orient2 = N.array([[0, 0, 1]], 'Float64')
    orientation = lattice_calculator.Orientation(orient1, orient2)
    lattice = lattice_calculator.Lattice(a=a,b=b,c=c,alpha=alpha,beta=beta,gamma=gamma,\
                                 orientation=orientation)
    newinput=lattice_calculator.CleanArgs(a=lattice.a,b=lattice.b,c=lattice.c,alpha=lattice.alpha,beta=lattice.beta,\
                             gamma=lattice.gamma,orient1=lattice._orient1,orient2=lattice._orient2,H=H,K=K,L=L)
    orientation = lattice_calculator.Orientation(newinput['orient1'],
                                                 newinput['orient2'])
    lattice.__init__(a=newinput['a'],b=newinput['b'],c=newinput['c'],alpha=newinput['alpha'],\
                        beta=newinput['beta'],gamma=newinput['gamma'],orientation=orientation\
                        )
    alphastar = lattice.alphastar
    print 'alphastar', alphastar
    EXP = {}
    EXP['ana'] = {}
    EXP['ana']['tau'] = 'pg(002)'
    EXP['mono'] = {}
    EXP['mono']['tau'] = 'pg(002)'
    EXP['ana']['mosaic'] = 30
    EXP['mono']['mosaic'] = 30
    EXP['sample'] = {}
    EXP['sample']['mosaic'] = 10
    EXP['sample']['vmosaic'] = 10
    EXP['hcol'] = N.array([40, 10, 20, 80], 'Float64')
    EXP['vcol'] = N.array([120, 120, 120, 120], 'Float64')
    EXP['infix'] = -1  #positive for fixed incident energy
    EXP['efixed'] = 14.7
    EXP['method'] = 0
    setup = [EXP]
    qx, qy, qz, Q = lattice.R2S(H, K, L)
    print 'Q', Q
    d = 2 * pi / Q
    print 'd', d
    return d
示例#3
0
        pylab.savefig(r'c:\sqltest\demo.pdf',dpi=150)
        print 'saved'


    if 1:
        a=N.array([3.943],'d')
        b=N.array([2.779],'d')
        c=N.array([13.86],'d')
        alpha=N.array([90],'d')
        beta=N.array([90],'d')
        gamma=N.array([90],'d')
 #       orient1=N.array([[0,1,1]],'d')
        orient1=N.array([[1,0,0]],'d')
        orient2=N.array([[0,1,0]],'d')
        orientation=lattice_calculator.Orientation(orient1,orient2)
        mylattice=lattice_calculator.Lattice(a=a,b=b,c=c,alpha=alpha,beta=beta,gamma=gamma,\
                               orientation=orientation)
        delta=.0045
        hc=.5035
        kc=.5
        #x-axis is cubic, y-axis is 110
        sq3=N.sqrt(3)
        H=N.array([hc,
                   hc,
                   hc+3*delta/2,
                   hc-3*delta/2,
                   hc-3*delta/2,
                   hc+3*delta/2,
                   ],'d');
        K=N.array([kc+delta,
                   kc-delta,
                   kc+delta/2,