Changeset 520 for trunk/GSASIIlattice.py


Ignore:
Timestamp:
Mar 14, 2012 3:17:17 PM (10 years ago)
Author:
vondreele
Message:

separate getHKLmax

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIlattice.py

    r432 r520  
    590590                            HKL.append([h,k,l,rdsq2d(rdsq,6),-1])
    591591    return sortHKLd(HKL,True,False)
     592
     593def getHKLmax(dmin,SGData,A):
     594    #finds maximum allowed hkl for given A within dmin
     595    SGLaue = SGData['SGLaue']
     596    if SGLaue in ['3R','3mR']:        #Rhombohedral axes
     597        Hmax = [0,0,0]
     598        cell = A2cell(A)
     599        aHx = cell[0]*math.sqrt(2.0*(1.0-cosd(cell[3])))
     600        cHx = cell[0]*math.sqrt(3.0*(1.0+2.0*cosd(cell[3])))
     601        Hmax[0] = Hmax[1] = int(round(aHx/dmin))
     602        Hmax[2] = int(round(cHx/dmin))
     603        #print Hmax,aHx,cHx
     604    else:                           # all others
     605        Hmax = MaxIndex(dmin,A)
     606    return Hmax
    592607   
    593608def GenHLaue(dmin,SGData,A):
     
    614629    SGUniq = SGData['SGUniq']
    615630    #finds maximum allowed hkl for given A within dmin
    616     if SGLaue in ['3R','3mR']:        #Rhombohedral axes
    617         Hmax = [0,0,0]
    618         cell = A2cell(A)
    619         aHx = cell[0]*math.sqrt(2.0*(1.0-cosd(cell[3])))
    620         cHx = cell[0]*math.sqrt(3.0*(1.0+2.0*cosd(cell[3])))
    621         Hmax[0] = Hmax[1] = int(round(aHx/dmin))
    622         Hmax[2] = int(round(cHx/dmin))
    623         #print Hmax,aHx,cHx
    624     else:                           # all others
    625         Hmax = MaxIndex(dmin,A)
     631    Hmax = getHKLmax(dmin,SGData,A)
    626632       
    627633    dminsq = 1./(dmin**2)
Note: See TracChangeset for help on using the changeset viewer.