Пример #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
def gen_gamma_gr(th=0.,sigma=5.,iopt=1):
    """
    grain generator for gamma fiber

    =========
    Arguments

    th       = 0.0
    sigma    = 5.0
    iopt     = 1
    """
    from text import miller2mat

    ## gamma fiber: axisymmetry about ND
    hkl, uvw = hkl_gamma()
    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)
Пример #3
0
def gen_gamma_gr(th=0.0, sigma=5.0, iopt=1):
    """
    grain generator for gamma fiber

    =========
    Arguments

    th       = 0.0
    sigma    = 5.0
    iopt     = 1
    """
    from text import miller2mat

    ## gamma fiber: axisymmetry about ND
    hkl, uvw = hkl_gamma()
    g_casa = miller2mat(hkl, uvw)
    g_sasa = nd_rot(th)
    ##

    g = np.dot(g_casa, g_sasa)
    if iopt == 1:
        dth = gauss(mu=0.0, sigma=sigma)
    if iopt == 2:
        dth = expov(sigma)
    if iopt == 3:
        dth = logno(mu=0.0, sigma=sigma)
    if iopt == 4:
        dth = norma(mu=0.0, sigma=sigma)

    return rot_vectang(th=dth, r=g)
Пример #4
0
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)
Пример #5
0
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)