Ignore:
Timestamp:
Mar 27, 2015 2:46:30 PM (7 years ago)
Author:
vondreele
Message:

correct old LANSCE/HIPD import to give correct Omega, chi & phi from goniometer
correct 2-theta from TOF & use abs(Tth) as needed in Lorentz calc for TOF
some corrections to texture calcs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIlattice.py

    r1598 r1766  
    4747rdsq2d = lambda x,p: round(1.0/np.sqrt(x),p)
    4848rpd = np.pi/180.
     49RSQ2PI = 1./np.sqrt(2.*np.pi)
     50SQ2 = np.sqrt(2.)
     51RSQPI = 1./np.sqrt(np.pi)
    4952
    5053def sec2HMS(sec):
     
    10391042   
    10401043    BD = 1.0-BC**2
    1041     if BD > 0.:
     1044    if BD > 1.e-6:
    10421045        C = rpd/math.sqrt(BD)
    10431046    else:
     
    10611064    dBBdF = BC1*SComeg-BC3*SSomeg*SCchi
    10621065   
    1063     if BD > 0.:
     1066    if BD > 1.e-6:
    10641067        dGMdA = [(BA*dBBdO-BB*dBAdO)/BD,(BA*dBBdC-BB*dBAdC)/BD,(BA*dBBdF-BB*dBAdF)/BD]
    10651068    else:
     
    11101113    'needs doc string'
    11111114    import pytexture as ptx
    1112     RSQ2PI = 0.3989422804014
    1113     SQ2 = 1.414213562373
    11141115    if SGLaue in ['m3','m3m']:
    11151116        Kcl = 0.0
     
    11381139    'needs doc string'
    11391140    import pytexture as ptx
    1140     RSQPI = 0.5641895835478
    1141     SQ2 = 1.414213562373
    11421141    psrs,dpdps = ptx.pyplmpsi(L,M,1,psi)
    1143     psrs *= RSQPI
    1144     dpdps *= RSQPI
    1145     if M == 0:
    1146         psrs /= SQ2
    1147         dpdps /= SQ2
     1142    psrs *= RSQ2PI
     1143    dpdps *= RSQ2PI
     1144    if M:
     1145        psrs *= SQ2
     1146        dpdps *= SQ2
    11481147    if SamSym in ['mmm',]:
    11491148        dum = cosd(M*gam)
     
    11641163    """
    11651164    import pytexture as ptx
    1166     RSQ2PI = 0.3989422804014
    1167     SQ2 = 1.414213562373
    11681165    Ksl,x = ptx.pyplmpsi(L,0,1,psi)
    11691166    Ksl *= RSQ2PI
     
    11941191    'needs doc string'
    11951192    import pytexture as ptx
    1196     RSQPI = 0.5641895835478
    1197     SQ2 = 1.414213562373
    11981193
    11991194    if Start:
     
    12191214    import pytexture as ptx
    12201215   
    1221     FORPI = 12.5663706143592
    1222     RSQPI = 0.5641895835478
    1223     SQ2 = 1.414213562373
    1224 
    12251216    if Start:
    12261217        ptx.pyqlmninit()
     
    12601251    '''
    12611252    import pytexture as ptx
    1262     RSQPI = 0.5641895835478
    1263     SQ2 = 1.414213562373
    12641253    PolVal = np.ones_like(psi)
    12651254    for term in ODFln:
     
    12681257            psrs,dum = ptx.pyplmpsi(l,m,len(psi),psi)
    12691258            if SamSym in ['-1','2/m']:
    1270                 if m != 0:
     1259                if m:
    12711260                    Ksl = RSQPI*psrs*(cosd(m*gam)+sind(m*gam))
    12721261                else:
    12731262                    Ksl = RSQPI*psrs/SQ2
    12741263            else:
    1275                 if m != 0:
     1264                if m:
    12761265                    Ksl = RSQPI*psrs*cosd(m*gam)
    12771266                else:
     
    12841273    import pytexture as ptx
    12851274   
    1286     FORPI = 12.5663706143592
    1287     RSQPI = 0.5641895835478
    1288     SQ2 = 1.414213562373
    1289 
    12901275    invPolVal = np.ones_like(beta)
    12911276    for term in ODFln:
Note: See TracChangeset for help on using the changeset viewer.