Changeset 1986


Ignore:
Timestamp:
Oct 5, 2015 4:00:07 PM (6 years ago)
Author:
vondreele
Message:

OpenGL.GLE doesn't seem to work - only used for proteins
fix nonrefinement of Babinet parms.
work on SS derivs.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r1983 r1986  
    4141from  OpenGL.GL import *
    4242from OpenGL.GLU import *
    43 from OpenGL.GLE import *
     43import OpenGL.GLE as gle
     44#from OpenGL.GLE import *
    4445import gltext
    4546from matplotlib.backends.backend_wx import _load_bitmap
     
    50075008        glEnable(GL_COLOR_MATERIAL)
    50085009        glShadeModel(GL_SMOOTH)
    5009         gleSetJoinStyle(TUBE_NORM_EDGE | TUBE_JN_ANGLE | TUBE_JN_CAP)
    5010         glePolyCylinder(Backbone,BackboneColor,radius)
     5010#        gle.gleSetJoinStyle(TUBE_NORM_EDGE | TUBE_JN_ANGLE | TUBE_JN_CAP)
     5011#        gle.glePolyCylinder(Backbone,BackboneColor,radius)
    50115012        glPopMatrix()       
    50125013        glDisable(GL_COLOR_MATERIAL)
  • trunk/GSASIIstrMath.py

    r1984 r1986  
    915915                dFdua[iref] = 2.*SA*(dfadua[0]+dfbdua[1])+2.*SB*(dfbdua[0]+dfadua[1])    #array(nRef,nAtom,6)
    916916                dFdfl[iref] = -SA*dfadfl-SB*dfbdfl  #array(nRef,)
    917                 dFdbab[iref] = 2.*fas[0]*np.array([np.sum(dfadba*dBabdA),np.sum(-dfadba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T+ \
    918                     2.*fbs[0]*np.array([np.sum(dfbdba*dBabdA),np.sum(-dfbdba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T
     917        dFdbab[iref] = 2.*fas[0]*np.array([np.sum(dfadba*dBabdA),np.sum(-dfadba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T+ \
     918            2.*fbs[0]*np.array([np.sum(dfbdba*dBabdA),np.sum(-dfbdba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T
     919#        GSASIIpath.IPyBreak()
    919920    print ' derivative time %.4f\r'%(time.time()-time0)
    920921        #loop over atoms - each dict entry is list of derivatives for all the reflections
     
    973974    ast = np.sqrt(np.diag(G))
    974975    Mast = twopisq*np.multiply.outer(ast,ast)   
    975 #    SGMT = np.array([ops[0].T for ops in SGData['SGOps']])
    976976    SGInv = SGData['SGInv']
    977 #    SGT = np.array([ops[1] for ops in SGData['SGOps']])
    978977    SSGMT = np.array([ops[0].T for ops in SSGData['SSGOps']])
    979978    SSGT = np.array([ops[1] for ops in SSGData['SSGOps']])
     
    983982    if not SGData['SGInv'] and 'S' in calcControls[hfx+'histType'] and phfx+'Flack' in parmDict:
    984983        Flack = 1.-2.*parmDict[phfx+'Flack']
    985     TwinLaw = np.array([[[1,0,0],[0,1,0],[0,0,1]],])
     984    TwinLaw = np.array([[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],])    #4D?
    986985    TwDict = refDict.get('TwDict',{})           
    987986    if 'S' in calcControls[hfx+'histType']:
    988987        NTL = calcControls[phfx+'NTL']
    989988        NM = calcControls[phfx+'TwinNMN']+1
    990         TwinLaw = calcControls[phfx+'TwinLaw']
     989        TwinLaw = calcControls[phfx+'TwinLaw']  #this'll have to be 4D also...
    991990        TwinFr = np.array([parmDict[phfx+'TwinFr:'+str(i)] for i in range(len(TwinLaw))])
    992991        TwinInv = list(np.where(calcControls[phfx+'TwinInv'],-1,1))
     
    10661065            fb = np.array([Flack*FPP*cosp*Tcorr,np.reshape(((FF+FP).T-Bab).T,sinp.shape)*sinp*Tcorr])
    10671066        GfpuA = G2mth.Modulation(waveTypes,Uniq,FSSdata,XSSdata,USSdata,Mast) #2 x refBlk x sym X atoms
    1068         fa *= GfpuA
    1069         fb *= GfpuA       
     1067        fag = fa*GfpuA[0]-fb*GfpuA[1]
     1068        fbg = fb*GfpuA[0]+fa*GfpuA[1]
    10701069#        GSASIIpath.IPyBreak()
    1071         fas = np.sum(np.sum(fa,axis=-1),axis=-1)
    1072         fbs = np.sum(np.sum(fb,axis=-1),axis=-1)
     1070        fas = np.sum(np.sum(fag,axis=-1),axis=-1)
     1071        fbs = np.sum(np.sum(fbg,axis=-1),axis=-1)
    10731072        if 'P' in calcControls[hfx+'histType']:
    10741073            refl.T[10] = np.sum(fas**2,axis=0)+np.sum(fbs**2,axis=0)
     
    11791178def SStructureFactorDerv(refDict,im,G,hfx,pfx,SGData,SSGData,calcControls,parmDict):
    11801179    'Needs a doc string'
     1180    nxs = np.newaxis       
    11811181    phfx = pfx.split(':')[0]+hfx
    11821182    ast = np.sqrt(np.diag(G))
    11831183    Mast = twopisq*np.multiply.outer(ast,ast)
    1184     SGMT = np.array([ops[0].T for ops in SGData['SGOps']])
    1185     SGT = np.array([ops[1] for ops in SGData['SGOps']])
     1184    SGInv = SGData['SGInv']
    11861185    SSGMT = np.array([ops[0].T for ops in SSGData['SSGOps']])
    11871186    SSGT = np.array([ops[1] for ops in SSGData['SSGOps']])
    11881187    FFtables = calcControls['FFtables']
    11891188    BLtables = calcControls['BLtables']
     1189    TwinLaw = np.array([[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],])
     1190    TwDict = refDict.get('TwDict',{})           
     1191    if 'S' in calcControls[hfx+'histType']:
     1192        NTL = calcControls[phfx+'NTL']
     1193        NM = calcControls[phfx+'TwinNMN']+1
     1194        TwinLaw = calcControls[phfx+'TwinLaw']
     1195        TwinFr = np.array([parmDict[phfx+'TwinFr:'+str(i)] for i in range(len(TwinLaw))])
     1196        TwinInv = list(np.where(calcControls[phfx+'TwinInv'],-1,1))
     1197    nTwin = len(TwinLaw)       
    11901198    nRef = len(refDict['RefList'])
    11911199    Tdata,Mdata,Fdata,Xdata,dXdata,IAdata,Uisodata,Uijdata = GetAtomFXU(pfx,calcControls,parmDict)
     1200    mSize = len(Mdata)
    11921201    waveTypes,FSSdata,XSSdata,USSdata,MSSdata = GetAtomSSFXU(pfx,calcControls,parmDict)
    1193     SStauM = GetSSTauM(SGData['SGOps'],SSGData['SSGOps'],pfx,calcControls,Xdata)
    1194     mSize = len(Mdata)
    11951202    FF = np.zeros(len(Tdata))
    11961203    if 'NC' in calcControls[hfx+'histType']:
     
    12011208    Uij = np.array(G2lat.U6toUij(Uijdata))
    12021209    bij = Mast*Uij.T
     1210    if not len(refDict['FF']):
     1211        if 'N' in calcControls[hfx+'histType']:
     1212            dat = G2el.getBLvalues(BLtables)        #will need wave here for anom. neutron b's
     1213        else:
     1214            dat = G2el.getFFvalues(FFtables,0.)       
     1215        refDict['FF']['El'] = dat.keys()
     1216        refDict['FF']['FF'] = np.zeros((len(refDict['RefList']),len(dat)))
    12031217    dFdvDict = {}
    1204     dFdfr = np.zeros((nRef,mSize))
    1205     dFdx = np.zeros((nRef,mSize,3))
    1206     dFdui = np.zeros((nRef,mSize))
    1207     dFdua = np.zeros((nRef,mSize,6))
    1208     dFdbab = np.zeros((nRef,2))
     1218    if nTwin > 1:
     1219        dFdfr = np.zeros((nRef,nTwin,mSize))
     1220        dFdx = np.zeros((nRef,nTwin,mSize,3))
     1221        dFdui = np.zeros((nRef,nTwin,mSize))
     1222        dFdua = np.zeros((nRef,nTwin,mSize,6))
     1223        dFdbab = np.zeros((nRef,nTwin,2))
     1224        dFdfl = np.zeros((nRef,nTwin))
     1225        dFdtw = np.zeros((nRef,nTwin))
     1226    else:
     1227        dFdfr = np.zeros((nRef,mSize))
     1228        dFdx = np.zeros((nRef,mSize,3))
     1229        dFdui = np.zeros((nRef,mSize))
     1230        dFdua = np.zeros((nRef,mSize,6))
     1231        dFdbab = np.zeros((nRef,2))
     1232        dFdfl = np.zeros((nRef))
     1233        dFdtw = np.zeros((nRef))
     1234    Flack = 1.0
     1235    if not SGData['SGInv'] and 'S' in calcControls[hfx+'histType'] and phfx+'Flack' in parmDict:
     1236        Flack = 1.-2.*parmDict[phfx+'Flack']
     1237    time0 = time.time()
     1238    nRef = len(refDict['RefList'])/100
    12091239    for iref,refl in enumerate(refDict['RefList']):
    12101240        if 'T' in calcControls[hfx+'histType']:
    12111241            FP,FPP = G2el.BlenResCW(Tdata,BLtables,refl.T[12+im])
    12121242        H = np.array(refl[:4])
     1243#        H = np.squeeze(np.inner(H.T,TwinLaw))   #maybe array(4,nTwins) or (4)
     1244#        TwMask = np.any(H,axis=-1)
     1245#        if TwinLaw.shape[0] > 1 and TwDict:
     1246#            if iref in TwDict:
     1247#                for i in TwDict[iref]:
     1248#                    for n in range(NTL):
     1249#                        H[i+n*NM] = np.inner(TwinLaw[n*NM],np.array(TwDict[iref][i])*TwinInv[i+n*NM])
     1250#            TwMask = np.any(H,axis=-1)
    12131251        SQ = 1./(2.*refl[4+im])**2             # or (sin(theta)/lambda)**2
    12141252        SQfactor = 8.0*SQ*np.pi**2
     
    12171255        Tindx = np.array([refDict['FF']['El'].index(El) for El in Tdata])
    12181256        FF = refDict['FF']['FF'][iref].T[Tindx]
    1219         Uniq = np.inner(H[:3],SGMT)
    1220         SSUniq = np.inner(H,SSGMT)
    1221         Phi = np.inner(H[:3],SGT)
    1222         SSPhi = np.inner(H,SSGT)
    1223         GfpuA,dGAdk = G2mth.ModulationDerv(waveTypes,SSUniq,FSSdata,XSSdata,USSdata,Mast)
    1224         #need ModulationDerv here dGAdXsin, etc 
    1225         phase = twopi*(np.inner((dXdata.T+Xdata.T),Uniq)+SSPhi[np.newaxis,:])
     1257        Uniq = np.inner(H,SSGMT)
     1258        Phi = np.inner(H,SSGT)
     1259        phase = twopi*(np.inner(Uniq[:,:3],(dXdata+Xdata).T)+Phi[:,nxs])
    12261260        sinp = np.sin(phase)
    12271261        cosp = np.cos(phase)
    12281262        occ = Mdata*Fdata/len(Uniq)
    1229         biso = -SQfactor*Uisodata
    1230         Tiso = np.where(biso<1.,np.exp(biso),1.0)
    1231         HbH = -np.inner(H[:3],np.inner(bij,H[:3]))
    1232         Hij = np.array([Mast*np.multiply.outer(U,U) for U in Uniq])
    1233         Hij = np.array([G2lat.UijtoU6(Uij) for Uij in Hij])
    1234         Tuij = np.where(HbH<1.,np.exp(HbH),1.0)
    1235         Tcorr = Tiso*Tuij
    1236         fot = (FF+FP-Bab)*occ*Tcorr
    1237         fotp = FPP*occ*Tcorr
    1238         fa *= GfpuA
    1239         fb *= GfpuA       
     1263        biso = -SQfactor*Uisodata[:,nxs]
     1264        Tiso = np.repeat(np.where(biso<1.,np.exp(biso),1.0),Uniq.shape[0]*len(TwinLaw),axis=1).T    #ops x atoms
     1265        HbH = -np.sum(Uniq[:,nxs,:3]*np.inner(Uniq[:,:3],bij),axis=-1)  #ops x atoms
     1266#        GSASIIpath.IPyBreak()
     1267        Hij = np.array([Mast*np.multiply.outer(U[:3],U[:3]) for U in Uniq]) #atoms x 3x3
     1268        Hij = np.squeeze(np.reshape(np.array([G2lat.UijtoU6(Uij) for Uij in Hij]),(nTwin,-1,6)))
     1269        Tuij = np.where(HbH<1.,np.exp(HbH),1.0)     #ops x atoms
     1270        Tcorr = np.reshape(Tiso,Tuij.shape)*Tuij*Mdata*Fdata/Uniq.shape[1]  #ops x atoms
     1271        fot = (FF+FP-Bab)*occ*Tcorr     #ops x atoms
     1272        fotp = FPP*occ*Tcorr            #ops x atoms
     1273        GfpuA = G2mth.ModulationDerv(waveTypes,Uniq,FSSdata,XSSdata,USSdata,Mast)
     1274        #need ModulationDerv here dGAdXsin, etc 
     1275        fa = np.array([((FF+FP).T-Bab).T*cosp*Tcorr,-Flack*FPP*sinp*Tcorr]) # array(2,nTwin,nEqv,nAtoms)
     1276        fb = np.array([((FF+FP).T-Bab).T*sinp*Tcorr,Flack*FPP*cosp*Tcorr])
     1277        fag = fa*GfpuA[0]-fb*GfpuA[1]
     1278        fbg = fb*GfpuA[0]+fa*GfpuA[1]
    12401279       
    1241         fas = np.sum(np.sum(fa,axis=1),axis=1)
    1242         fbs = np.sum(np.sum(fb,axis=1),axis=1)
    1243         fax = np.array([-fot[:,np.newaxis]*sinp,-fotp[:,np.newaxis]*sinp])   #positions
    1244         fbx = np.array([fot[:,np.newaxis]*cosp,-fot[:,np.newaxis]*cosp])
    1245         fax = fax*GfpuA[:,:,np.newaxis]-fbx*GfpuB[:,:,np.newaxis]
    1246         fbx = fbx*GfpuA[:,:,np.newaxis]+fax*GfpuB[:,:,np.newaxis]
     1280        fas = np.sum(np.sum(fag,axis=1),axis=1)
     1281        fbs = np.sum(np.sum(fbg,axis=1),axis=1)
     1282        fax = np.array([-fot*sinp,-fotp*cosp])   #positions; 2 x twin x ops x atoms
     1283        fbx = np.array([fot*cosp,-fotp*sinp])
     1284        fax = fax*GfpuA[0]-fbx*GfpuA[1]
     1285        fbx = fbx*GfpuA[0]+fax*GfpuA[1]
    12471286        #sum below is over Uniq
    1248         dfadfr = np.sum(fa/occ[:,np.newaxis],axis=2)        #Fdata != 0 ever avoids /0. problem
    1249         dfadx = np.sum(twopi*Uniq*fax[:,:,:,np.newaxis],axis=2)
    1250         dfadui = np.sum(-SQfactor*fa,axis=2)
    1251         dfadua = np.sum(-Hij*fa[:,:,:,np.newaxis],axis=2)
    1252         dfadba = np.sum(-cosp*(occ*Tcorr)[:,np.newaxis],axis=1)
     1287        dfadfr = np.sum(fag/occ,axis=1)        #Fdata != 0 ever avoids /0. problem
     1288        dfadba = np.sum(-cosp*(occ*Tcorr)[:,nxs],axis=1)
     1289        dfadui = np.sum(-SQfactor*fag,axis=1)
     1290        if nTwin > 1:
     1291            dfadx = np.array([np.sum(twopi*Uniq[it]*np.swapaxes(fax,-2,-1)[:,it,:,:,np.newaxis],axis=-2) for it in range(nTwin)])
     1292            dfadua = np.array([np.sum(-Hij[it]*np.swapaxes(fa,-2,-1)[:,it,:,:,np.newaxis],axis=-2) for it in range(nTwin)])
     1293            # array(nTwin,2,nAtom,3) & array(nTwin,2,nAtom,6)
     1294        else:
     1295            dfadx = np.sum(twopi*Uniq*np.swapaxes(fax,-2,-1)[:,:,:,np.newaxis],axis=-2)
     1296            dfadua = np.sum(-Hij*np.swapaxes(fa,-2,-1)[:,:,:,np.newaxis],axis=-2)
     1297            # array(2,nAtom,3) & array(2,nAtom,6)
    12531298        #NB: the above have been checked against PA(1:10,1:2) in strfctr.for for al2O3!   
    1254         dFdfr[iref] = 2.*(fas[0]*dfadfr[0]+fas[1]*dfadfr[1])*Mdata/len(Uniq)
    1255         dFdx[iref] = 2.*(fas[0]*dfadx[0]+fas[1]*dfadx[1])
    1256         dFdui[iref] = 2.*(fas[0]*dfadui[0]+fas[1]*dfadui[1])
    1257         dFdua[iref] = 2.*(fas[0]*dfadua[0]+fas[1]*dfadua[1])
    1258         dFdbab[iref] = 2.*fas[0]*np.array([np.sum(dfadba*dBabdA),np.sum(-dfadba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T
    1259         #need dFdXsin, etc for modulations...
    12601299        if not SGData['SGInv']:
    1261             dfbdfr = np.sum(fb/occ[:,np.newaxis],axis=2)        #Fdata != 0 ever avoids /0. problem
    1262             dfbdx = np.sum(twopi*Uniq*fbx[:,:,:,np.newaxis],axis=2)           
    1263             dfbdui = np.sum(-SQfactor*fb,axis=2)
    1264             dfbdua = np.sum(-Hij*fb[:,:,:,np.newaxis],axis=2)
    1265             dfbdba = np.sum(-sinp*(occ*Tcorr)[:,np.newaxis],axis=1)
    1266             dFdfr[iref] += 2.*(fbs[0]*dfbdfr[0]-fbs[1]*dfbdfr[1])*Mdata/len(Uniq)
    1267             dFdx[iref] += 2.*(fbs[0]*dfbdx[0]+fbs[1]*dfbdx[1])
    1268             dFdui[iref] += 2.*(fbs[0]*dfbdui[0]-fbs[1]*dfbdui[1])
    1269             dFdua[iref] += 2.*(fbs[0]*dfbdua[0]+fbs[1]*dfbdua[1])
    1270             dFdbab[iref] += 2.*fbs[0]*np.array([np.sum(dfbdba*dBabdA),np.sum(-dfbdba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T
    1271         #need dFdXsin, etc for modulations...
     1300            dfbdfr = np.sum(fbg/occ,axis=1)        #Fdata != 0 avoids /0. problem
     1301            dfbdba = np.sum(-sinp*Tcorr[:,np.newaxis],axis=1)
     1302            dfbdui = np.sum(-SQfactor*fb,axis=1)
     1303            if len(TwinLaw) > 1:
     1304                dfbdx = np.array([np.sum(twopi*Uniq[it]*np.swapaxes(fbx,-2,-1)[:,it,:,:,np.newaxis],axis=2) for it in range(nTwin)])           
     1305                dfbdua = np.array([np.sum(-Hij[it]*np.swapaxes(fb,-2,-1)[:,it,:,:,np.newaxis],axis=2) for it in range(nTwin)])
     1306            else:
     1307                dfadfl = np.sum(-FPP*Tcorr*sinp)
     1308                dfbdfl = np.sum(FPP*Tcorr*cosp)
     1309                dfbdx = np.sum(twopi*Uniq*np.swapaxes(fbx,-2,-1)[:,:,:,np.newaxis],axis=2)           
     1310                dfbdua = np.sum(-Hij*np.swapaxes(fb,-2,-1)[:,:,:,np.newaxis],axis=2)
     1311        else:
     1312            dfbdfr = np.zeros_like(dfadfr)
     1313            dfbdx = np.zeros_like(dfadx)
     1314            dfbdui = np.zeros_like(dfadui)
     1315            dfbdua = np.zeros_like(dfadua)
     1316            dfbdba = np.zeros_like(dfadba)
     1317            dfadfl = 0.0
     1318            dfbdfl = 0.0
     1319        #NB: the above have been checked against PA(1:10,1:2) in strfctr.for for Al2O3!   
     1320        if 'P' in calcControls[hfx+'histType']: #checked perfect for centro & noncentro
     1321            dFdfr[iref] = 2.*(fas[0]*dfadfr[0]+fas[1]*dfadfr[1])*Mdata/len(Uniq)+   \
     1322                2.*(fbs[0]*dfbdfr[0]-fbs[1]*dfbdfr[1])*Mdata/len(Uniq)
     1323            dFdx[iref] = 2.*(fas[0]*dfadx[0]+fas[1]*dfadx[1])+  \
     1324                2.*(fbs[0]*dfbdx[0]+fbs[1]*dfbdx[1])
     1325            dFdui[iref] = 2.*(fas[0]*dfadui[0]+fas[1]*dfadui[1])+   \
     1326                2.*(fbs[0]*dfbdui[0]-fbs[1]*dfbdui[1])
     1327            dFdua[iref] = 2.*(fas[0]*dfadua[0]+fas[1]*dfadua[1])+   \
     1328                2.*(fbs[0]*dfbdua[0]+fbs[1]*dfbdua[1])
     1329        else:
     1330            SA = fas[0]-fbs[1]
     1331            SB = fbs[0]+fas[1]
     1332            if nTwin > 1:
     1333                dFdfr[iref] = [2.*TwMask[it]*SA[it]*(dfadfr[0][it]+dfbdfr[1][it])*Mdata/len(Uniq[it])+ \
     1334                    2.*TwMask[it]*SB[it]*(dfbdfr[0][it]+dfadfr[1][it])*Mdata/len(Uniq[it]) for it in range(nTwin)]
     1335                dFdx[iref] = [2.*TwMask[it]*SA[it]*(dfadx[it][0]+dfbdx[it][1])+2.*TwMask[it]*SB[it]*(dfbdx[it][0]+dfadx[it][1]) for it in range(nTwin)]
     1336                dFdui[iref] = [2.*TwMask[it]*SA[it]*(dfadui[0][it]+dfbdui[1][it])+2.*TwMask[it]*SB[it]*(dfbdui[0][it]+dfadui[1][it]) for it in range(nTwin)]
     1337                dFdua[iref] = [2.*TwMask[it]*SA[it]*(dfadua[it][0]+dfbdua[it][1])+2.*TwMask[it]*SB[it]*(dfbdua[it][0]+dfadua[it][1]) for it in range(nTwin)]
     1338                dFdtw[iref] = np.sum(TwMask*fas,axis=0)**2+np.sum(TwMask*fbs,axis=0)**2
     1339               
     1340            else:   #these are good for no twin single crystals
     1341                dFdfr[iref] = 2.*SA*(dfadfr[0]+dfbdfr[1])*Mdata/len(Uniq)+ \
     1342                    2.*SB*(dfbdfr[0]+dfadfr[1])*Mdata/len(Uniq) #array(nRef,nAtom)
     1343                dFdx[iref] = 2.*SA*(dfadx[0]+dfbdx[1])+2.*SB*(dfbdx[0]+dfadx[1])    #array(nRef,nAtom,3)
     1344                dFdui[iref] = 2.*SA*(dfadui[0]+dfbdui[1])+2.*SB*(dfbdui[0]+dfadui[1])   #array(nRef,nAtom)
     1345                dFdua[iref] = 2.*SA*(dfadua[0]+dfbdua[1])+2.*SB*(dfbdua[0]+dfadua[1])    #array(nRef,nAtom,6)
     1346                dFdfl[iref] = -SA*dfadfl-SB*dfbdfl  #array(nRef,)
     1347        dFdbab[iref] = 2.*fas[0]*np.array([np.sum(dfadba*dBabdA),np.sum(-dfadba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T+ \
     1348            2.*fbs[0]*np.array([np.sum(dfbdba*dBabdA),np.sum(-dfbdba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T
    12721349        #loop over atoms - each dict entry is list of derivatives for all the reflections
    12731350    for i in range(len(Mdata)):     
     
    25472624                if refl[9+im]:
    25482625                    if phfx+name in varylist:
    2549                         dMdv[varylist.index(phfx+name)][iBeg:iFin] += dFdvDict[pfx+name][iref]*dervDict['int']/refl[9+im]
     2626                        dMdv[varylist.index(phfx+name)][iBeg:iFin] += parmDict[phfx+'Scale']*dFdvDict[phfx+name][iref]*dervDict['int']/refl[9+im]
    25502627                        if Ka2 and iFin2-iBeg2:
    2551                             dMdv[varylist.index(phfx+name)][iBeg2:iFin2] += dFdvDict[pfx+name][iref]*dervDict2['int']/refl[9+im]
     2628                            dMdv[varylist.index(phfx+name)][iBeg2:iFin2] += parmDict[phfx+'Scale']*dFdvDict[phfx+name][iref]*dervDict2['int']/refl[9+im]
    25522629                    elif phfx+name in dependentVars:                   
    2553                         depDerivDict[phfx+name][iBeg:iFin] += dFdvDict[pfx+name][iref]*dervDict['int']/refl[9+im]
     2630                        depDerivDict[phfx+name][iBeg:iFin] += parmDict[phfx+'Scale']*dFdvDict[phfx+name][iref]*dervDict['int']/refl[9+im]
    25542631                        if Ka2 and iFin2-iBeg2:
    2555                             depDerivDict[phfx+name][iBeg2:iFin2] += dFdvDict[pfx+name][iref]*dervDict2['int']/refl[9+im]                 
     2632                            depDerivDict[phfx+name][iBeg2:iFin2] += parmDict[phfx+'Scale']*dFdvDict[phfx+name][iref]*dervDict2['int']/refl[9+im]                 
    25562633            if not Phase['General'].get('doPawley'):
    25572634                #do atom derivatives -  for RB,F,X & U so far             
Note: See TracChangeset for help on using the changeset viewer.