Changeset 77


Ignore:
Timestamp:
Jun 3, 2010 9:47:46 AM (12 years ago)
Author:
vondreel
Message:

a few missing G2lat in ranAbyV
removed an extra print from G2plot

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIcomp.py

    r75 r77  
    289289    return True,smin,Rwp,runtime,GoOn
    290290   
    291 #some cell utilities
     291#reflection generation routines
    292292#for these: H = [h,k,l]; A is as used in calc_rDsq; G - inv metric tensor, g - metric tensor;
    293293#           cell - a,b,c,alp,bet,gam in A & deg
     
    301301    rdsq = calc_rDsq(H,A)+Z*math.sin(tth*rpd)*2.0*rpd/(lam*lam)
    302302    return rdsq
    303    
     303      
    304304def MaxIndex(dmin,A):
    305305    #finds maximum allowed hkl for given A within dmin
     
    333333    return X
    334334   
    335  
     335def SwapIndx(Axis,H):
     336    if Axis in [1,-1]:
     337        return H
     338    elif Axis in [2,-3]:
     339        return [H[1],H[2],H[0]]
     340    else:
     341        return [H[2],H[0],H[1]]
     342       
     343def CentCheck(Cent,H):
     344    h,k,l = H
     345    if Cent == 'A' and (k+l)%2:
     346        return False
     347    elif Cent == 'B' and (h+l)%2:
     348        return False
     349    elif Cent == 'C' and (h+k)%2:
     350        return False
     351    elif Cent == 'I' and (h+k+l)%2:
     352        return False
     353    elif Cent == 'F' and ((h+k)%2 or (h+l)%2 or (k+l)%2):
     354        return False
     355    elif Cent == 'R' and (-h+k+l)%3:
     356        return False
     357    else:
     358        return True
     359                                   
    336360def GenHBravais(dmin,Bravais,A):
    337361    '''Generate the positionally unique powder diffraction reflections
     
    429453    return sortHKLd(HKL,True,False)
    430454   
    431 def SwapIndx(Axis,H):
    432     if Axis in [1,-1]:
    433         return H
    434     elif Axis in [2,-3]:
    435         return [H[1],H[2],H[0]]
    436     else:
    437         return [H[2],H[0],H[1]]
    438        
    439 def CentCheck(Cent,H):
    440     h,k,l = H
    441     if Cent == 'A' and (k+l)%2:
    442         return False
    443     elif Cent == 'B' and (h+l)%2:
    444         return False
    445     elif Cent == 'C' and (h+k)%2:
    446         return False
    447     elif Cent == 'I' and (h+k+l)%2:
    448         return False
    449     elif Cent == 'F' and ((h+k)%2 or (h+l)%2 or (k+l)%2):
    450         return False
    451     elif Cent == 'R' and (-h+k+l)%3:
    452         return False
    453     else:
    454         return True
    455                                    
    456455def GenHLaue(dmin,Laue,Cent,Axis,A):
    457456    '''Generate the crystallographically unique powder diffraction reflections
     
    556555   
    557556#GSASII cell indexing program: variation on that of A. Coehlo
    558 #   includes cell refinement from peal positions (not zero as yet)
     557#   includes cell refinement from peak positions (not zero as yet)
    559558   
    560559def scaleAbyV(A,V):
     
    577576    return R
    578577   
    579 def ranNaxis(k,N):
    580     import random as rand
    581     T = 1.0+1.0*k/N
    582     B = 1.0-1.0*k/N
    583     R = (T-B)*rand.random()+B
    584     return R
     578#def ranNaxis(k,N):
     579#    import random as rand
     580#    T = 1.0+1.0*k/N
     581#    B = 1.0-1.0*k/N
     582#    R = (T-B)*rand.random()+B
     583#    return R
    585584   
    586585def ranAbyV(Bravais,dmin,dmax,V):
     
    590589        bad = False
    591590        cell = rancell(Bravais,dmin,dmax)
    592         G,g = cell2Gmat(cell)
    593         A = Gmat2A(G)
    594         if calc_rVsq(A) < 1:
     591        G,g = G2lat.cell2Gmat(cell)
     592        A = G2lat.Gmat2A(G)
     593        if G2lat.calc_rVsq(A) < 1:
    595594            scaleAbyV(A,V)
    596595            cell = G2lat.A2cell(A)
  • trunk/GSASIIplot.py

    r72 r77  
    242242            self.Offset -= 1.
    243243        elif event.key == 'c':
    244             print 'contouring'
    245244            if self.Contour:
    246245                self.Contour = False
Note: See TracChangeset for help on using the changeset viewer.