Changeset 411 for trunk/GSASIIElem.py


Ignore:
Timestamp:
Nov 11, 2011 2:14:35 PM (10 years ago)
Author:
vondreele
Message:

fix very old (!) bug in psvfcj.for
implement neutron scattering lengths in GSASII including the dozen anomalous scattering isotopes
isotope choice is in General
so GSASII will now do neutron CW Rietveld refinements
some cleanup of the constraints GUI
remove varyList from GSASIImapvars.py globals

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIElem.py

    r409 r411  
    252252def ScatFac(El, SQ):
    253253    """compute value of form factor
    254     @param El: element dictionary  defined in GetFormFactorCoeff
     254    @param El: element dictionary defined in GetFormFactorCoeff
    255255    @param SQ: (sin-theta/lambda)**2
    256256    @return: real part of form factor
     
    261261    return np.sum(fa[:,np.newaxis]*np.exp(t)[:],axis=0)+El['fc']
    262262       
    263 def BlenFac(El,wave):
    264     pass
    265    
    266 #        F(I) = BLEN(I)
    267 #        IF ( BFAN(1,I).NE.0.0 ) THEN
    268 #          EMEV = 81.80703/XRAY**2
    269 #          GAM2 = BFAN(4,I)**2
    270 #          T1 = EMEV-BFAN(3,I)
    271 #          D1 = T1**2+GAM2
    272 #          T2 = EMEV-BFAN(6,I)
    273 #          D2 = T2**2+GAM2
    274 #          T3 = EMEV-BFAN(8,I)
    275 #          D3 = T3**2+GAM2
    276 #          FP(I) = BFAN(1,I)*(T1/D1+BFAN(5,I)*T2/D2+BFAN(7,I)*T3/D3)
    277 #          FPP(I) = -BFAN(2,I)*(1.0/D1+BFAN(5,I)/D2+BFAN(7,I)/D3)
    278 #        ELSE
    279 #          FP(I) = 0.0
    280 #          FPP(I) = 0.0
    281 #        END IF
    282    
     263def BlenRes(BLdata,wave):
     264    FP = []
     265    FPP = []
     266    Emev = 81.80703/wave**2
     267    for BL in BLdata:
     268        if len(BL) >= 6:
     269            Emev = 81.80703/wave**2
     270            G2 = BL[5]**2
     271            T = [Emev-BL[4],0,0]
     272            D = [T**2+G2,0,0]
     273            fp = T/D
     274            fpp = 1.0/D
     275            if len(BL) == 8:
     276                T = Emev-BL[7]
     277                D = T**2+G2
     278                fp += BL[6]*T/D
     279                fpp += BL[6]/D
     280            if len(BL) == 10:
     281                T = Emev-BL[9]
     282                D = T**2+G2
     283                fp += BL[8]*T/D
     284                fpp += BL[8]/D
     285            FP.append(BL[2]*fp)
     286            FPP.append(-BL[3]*fpp)
     287        else:
     288            FP.append(0.0)
     289            FPP.append(0.0)
     290    return np.array(FP),np.array(FPP)
    283291   
    284292def ComptonFac(El,SQ):
Note: See TracChangeset for help on using the changeset viewer.