Changeset 2121


Ignore:
Timestamp:
Jan 11, 2016 3:26:14 PM (6 years ago)
Author:
vondreele
Message:

fix errors in StructureFactorDerv2; only apparent in TOF XN refinements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMath.py

    r2115 r2121  
    10441044        Tindx = np.array([refDict['FF']['El'].index(El) for El in Tdata])
    10451045        FF = np.repeat(refDict['FF']['FF'][iBeg:iFin].T[Tindx].T,len(SGT),axis=0)
    1046         Uniq = np.inner(H.T,SGMT)             # array(nSGOp,3) or (nTwin,nSGOp,3)
     1046#        GSASIIpath.IPyBreak()
     1047        Uniq = np.inner(H.T,SGMT)             # array(nSGOp,3)
    10471048        Phi = np.inner(H.T,SGT)
    10481049        phase = twopi*(np.inner(Uniq,(dXdata+Xdata).T).T+Phi.T).T
     
    10581059        Hij = np.reshape(np.array([G2lat.UijtoU6(Uij) for Uij in Hij]),(-1,len(SGT),6))
    10591060        fot = np.reshape(((FF+FP).T-Bab).T,cosp.shape)*Tcorr
    1060         fotp = FPP*Tcorr       
     1061        if len(FPP.shape) > 1:
     1062            fotp = np.reshape(FPP,cosp.shape)*Tcorr
     1063        else:
     1064            fotp = FPP*Tcorr     
    10611065        if 'T' in calcControls[hfx+'histType']:
    10621066            fa = np.array([fot*cosp,-np.reshape(Flack*FPP,sinp.shape)*sinp*Tcorr])
     
    10651069            fa = np.array([fot*cosp,-Flack*FPP*sinp*Tcorr])
    10661070            fb = np.array([fot*sinp,Flack*FPP*cosp*Tcorr])
    1067 #        GSASIIpath.IPyBreak()
    10681071        fas = np.sum(np.sum(fa,axis=-1),axis=-1)      #real sum over atoms & unique hkl array(2,refBlk,nTwins)
    10691072        fbs = np.sum(np.sum(fb,axis=-1),axis=-1)      #imag sum over atoms & uniq hkl
    1070         fax = np.array([-fot*sinp,-fotp*cosp])   #positions array(2,refBlk,ntwi,nEqv,nAtoms)
     1073        fax = np.array([-fot*sinp,-fotp*cosp])   #positions array(2,refBlk,nEqv,nAtoms)
    10711074        fbx = np.array([fot*cosp,-fotp*sinp])
    10721075        #sum below is over Uniq
    1073         dfadfr = np.sum(fa/occ,axis=-2)        #array(2,refBlk,ntwin,nAtom) Fdata != 0 avoids /0. problem
     1076        dfadfr = np.sum(fa/occ,axis=-2)        #array(2,refBlk,nAtom) Fdata != 0 avoids /0. problem
    10741077        dfadba = np.sum(-cosp*Tcorr,axis=-2)  #array(refBlk,nAtom)
    10751078        dfadx = np.sum(twopi*Uniq[nxs,:,nxs,:,:]*np.swapaxes(fax,-2,-1)[:,:,:,:,nxs],axis=-2)
    1076         dfadui = np.sum(-SQfactor[nxs,:,nxs,nxs]*fa,axis=-2) #array(Ops,refBlk,nTw,nAtoms)
     1079        dfadui = np.sum(-SQfactor[nxs,:,nxs,nxs]*fa,axis=-2) #array(Ops,refBlk,nAtoms)
    10771080        dfadua = np.sum(-Hij[nxs,:,nxs,:,:]*np.swapaxes(fa,-2,-1)[:,:,:,:,nxs],axis=-2)
    10781081        # array(2,refBlk,nAtom,3) & array(2,refBlk,nAtom,6)
     
    10801083            dfbdfr = np.sum(fb/occ,axis=-2)        #Fdata != 0 avoids /0. problem
    10811084            dfbdba = np.sum(-sinp*Tcorr,axis=-2)
    1082             dfadfl = np.sum(np.sum(-FPP*Tcorr*sinp,axis=-1),axis=-1)
    1083             dfbdfl = np.sum(np.sum(FPP*Tcorr*cosp,axis=-1),axis=-1)
     1085            dfadfl = np.sum(np.sum(-fotp*sinp,axis=-1),axis=-1)
     1086            dfbdfl = np.sum(np.sum(fotp*cosp,axis=-1),axis=-1)
    10841087            dfbdx = np.sum(twopi*Uniq[nxs,:,nxs,:,:]*np.swapaxes(fbx,-2,-1)[:,:,:,:,nxs],axis=-2)           
    10851088            dfbdui = np.sum(-SQfactor[nxs,:,nxs,nxs]*fb,axis=-2)
Note: See TracChangeset for help on using the changeset viewer.