コード例 #1
0
def gen_gr_fiber(th,sigma,iopt,fiber='gamma'):
    """
    Generate rotation matrix and
    'perturb' the orientation following the
    given 'distribution' function <iopt>
    with the given standard deviation <sigma>
    """
    from text import miller2mat, miller2mat_RT
    if fiber=='gamma':
        hkl, uvw = hkl_gamma()
        g_casa = miller2mat(hkl, uvw)
        g_sasa = nd_rot(th)
    elif fiber=='alpha':
        hkl, uvw = hkl_alpha()
        g_casa = miller2mat(hkl, uvw)
        g_sasa = rd_rot(th)
    elif fiber=='eta':
        hkl,uvw = hkl_eta()
        g_casa = miller2mat(hkl, uvw)
        g_sasa = rd_rot(th)
    elif fiber=='epsilon':
        xyz, uvw = hkl_epsilon()
        g_casa = miller2mat_RT(uvw=uvw,xyz=xyz)
        g_sasa = td_rot(th)
    elif fiber=='sigma':
        hkl, uvw = hkl_sigma()
        g_casa = miller2mat(hkl,uvw)
        g_sasa = nd_rot(th)

    g = np.dot(g_casa,g_sasa)
    if iopt==1: dth=gauss(mu=0., sigma=sigma)
    if iopt==2: dth=expov(sigma)
    if iopt==3: dth=logno(mu=0., sigma=sigma)
    if iopt==4: dth=norma(mu=0., sigma=sigma)
    return rot_vectang(th=dth, r=g)
コード例 #2
0
ファイル: hcp_fiber.py プロジェクト: usnistgov/texture
def gen_gr_fiber(th,sigma,mu,iopt,tilt):
    """
    Arguments
    =========
    th   =  7.
    sigma = 15.
    iopt  =  0 (basal//ND); 1 (basal//ED)
    """
    hkl, uvw = basal_fib(iopt)
    if iopt==0:
        g_casa = miller2mat(hkl,uvw)
        g_sasa = nd_rot(th)
    elif iopt==1:
        g_casa = miller2mat_RT(uvw=uvw,xyz=hkl)
        g_sasa = rd_rot(th)
    g = np.dot(g_casa,g_sasa)
    if tilt!=0:
        g_tilt = rd_rot(tilt)
        g = np.dot(g_tilt.T,g)

    dth = gauss(mu=mu, sigma=sigma)
    return rot_vectang(th=dth, r=g)
コード例 #3
0
ファイル: hcp_fiber.py プロジェクト: anilkunwar/texture-1
def gen_gr_fiber(th, sigma, mu, iopt, tilt):
    """
    Arguments
    =========
    th   =  7.
    sigma = 15.
    iopt  =  0 (basal//ND); 1 (basal//ED)
    """
    hkl, uvw = basal_fib(iopt)
    if iopt == 0:
        g_casa = miller2mat(hkl, uvw)
        g_sasa = nd_rot(th)
    elif iopt == 1:
        g_casa = miller2mat_RT(uvw=uvw, xyz=hkl)
        g_sasa = rd_rot(th)
    g = np.dot(g_casa, g_sasa)
    if tilt != 0:
        g_tilt = rd_rot(tilt)
        g = np.dot(g_tilt.T, g)

    dth = gauss(mu=mu, sigma=sigma)
    return rot_vectang(th=dth, r=g)