Changeset 2040


Ignore:
Timestamp:
Nov 6, 2015 11:44:24 AM (6 years ago)
Author:
vondreele
Message:

make sure XSC is reflection import default Type
convert Biso to Uiso for J2K atoms import
get plots to show hklm for SS 2D structure factor plots on status bar & tool tip
make wave coeff 5 places not 4
now get correct Fcalc2 for SS reflections; proper derivatives for x & Uij
(not for x waves or U waves)
correct error in single crystal Fcalc
2 & it's derivatives

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r2038 r2040  
    971971    XmodB = Bx[:,nx:,:,nxs]*np.cos(twopi*tauX[nxs,:,nxs,:]) #ditto
    972972    Xmod = np.sum(XmodA+XmodB+XmodZ,axis=1)                #atoms X 3 X 32; sum waves
    973     Xmod = np.swapaxes(Xmod,1,2)                            #agree with J2K ParSup
     973    Xmod = np.swapaxes(Xmod,1,2)                            #agrees with J2K ParSup & shape is right
    974974    if Au.shape[1]:
    975975        tauU = np.arange(1.,Au.shape[1]+1)[:,nxs]*glTau     #Uwaves x 32
     
    980980    else:
    981981        HbH = 1.0
    982     D = H[:,:,3:]*glTau[nxs,nxs,:]              #m*e*tau; refBlk x  ops X 32
    983     HdotX = np.inner(HP,Xmod)+D[:,:,nxs,:]     #refBlk x ops x atoms X 32
    984     cosHA = np.sum(Fmod*HbH*np.cos(twopi*HdotX)*glWt,axis=-1)       #real part; refBlk X ops x atoms; sum for G-L integration
    985     sinHA = np.sum(Fmod*HbH*np.sin(twopi*HdotX)*glWt,axis=-1)       #imag part; ditto
     982    D = twopi*H[:,:,3:]*glTau[nxs,nxs,:]              #m*e*tau; refBlk x ops X 32
     983    HdotX = twopi*np.inner(HP,Xmod)                   #refBlk x ops x atoms X 32
     984    HdotXD = HdotX+D[:,:,nxs,:]
     985    cosHA = np.sum(Fmod*HbH*np.cos(HdotXD)*glWt,axis=-1)       #real part; refBlk X ops x atoms; sum for G-L integration
     986    sinHA = np.sum(Fmod*HbH*np.sin(HdotXD)*glWt,axis=-1)       #imag part; ditto
    986987#    GSASIIpath.IPyBreak()
    987988    return np.array([cosHA,sinHA])             # 2 x refBlk x SGops x atoms
  • trunk/GSASIIphsGUI.py

    r2039 r2040  
    23882388                except ValueError:
    23892389                    val = atomData[iatm][-1][SS][item][iwave][0][ival]
    2390                 Obj.SetValue('%.4f'%val)
     2390                Obj.SetValue('%.5f'%val)
    23912391                atomData[iatm][-1][SS][item][iwave][0][ival] = val
    23922392               
     
    24412441                    for ival,val in enumerate(wave[0]):
    24422442                        if np.any(CSI[Stype][0][ival]):
    2443                             waveVal = wx.TextCtrl(waveData,value='%.4f'%(val),style=wx.TE_PROCESS_ENTER)
     2443                            waveVal = wx.TextCtrl(waveData,value='%.5f'%(val),style=wx.TE_PROCESS_ENTER)
    24442444                            waveVal.Bind(wx.EVT_TEXT_ENTER,OnWaveVal)
    24452445                            waveVal.Bind(wx.EVT_KILL_FOCUS,OnWaveVal)
    24462446                            Indx[waveVal.GetId()] = [iatm,Stype,iwave,ival]
    24472447                        else:
    2448                             waveVal = wx.TextCtrl(waveData,value='%.4f'%(val),style=wx.TE_READONLY)
     2448                            waveVal = wx.TextCtrl(waveData,value='%.5f'%(val),style=wx.TE_READONLY)
    24492449                            waveVal.SetBackgroundColour(VERY_LIGHT_GREY)
    24502450                        Waves.Add(waveVal,0,WACV)
  • trunk/GSASIIplot.py

    r2034 r2040  
    365365            zpos = Data['Layer']
    366366            if '100' in Data['Zone']:
    367                 HKLtxt = '(%3d,%3d,%3d)'%(zpos,xpos,ypos)
     367                HKLtxt = '(%d,%d,%d)'%(zpos,xpos,ypos)
    368368            elif '010' in Data['Zone']:
    369                 HKLtxt = '(%3d,%3d,%3d)'%(xpos,zpos,ypos)
     369                HKLtxt = '(%d,%d,%d)'%(xpos,zpos,ypos)
    370370            elif '001' in Data['Zone']:
    371                 HKLtxt = '(%3d,%3d,%3d)'%(xpos,ypos,zpos)
     371                HKLtxt = '(%d,%d,%d)'%(xpos,ypos,zpos)
    372372            Page.canvas.SetToolTipString(HKLtxt)
    373373            G2frame.G2plotNB.status.SetStatusText('HKL = '+HKLtxt,0)
     
    379379            pos = int(round(event.xdata)),int(round(event.ydata))
    380380            if '100' in Data['Zone']:
    381                 Page.canvas.SetToolTipString('(picked:(%3d,%3d,%3d))'%(zpos,pos[0],pos[1]))
    382381                hkl = np.array([zpos,pos[0],pos[1]])
    383382            elif '010' in Data['Zone']:
    384                 Page.canvas.SetToolTipString('(picked:(%3d,%3d,%3d))'%(pos[0],zpos,pos[1]))
    385383                hkl = np.array([pos[0],zpos,pos[1]])
    386384            elif '001' in Data['Zone']:
    387                 Page.canvas.SetToolTipString('(picked:(%3d,%3d,%3d))'%(pos[0],pos[1],zpos))
    388385                hkl = np.array([pos[0],pos[1],zpos])
    389386            h,k,l = hkl
     
    393390                HKLtxt = '( %.2f %.3f %.2f %.2f)'%(Fosq,sig,Fcsq,(Fosq-Fcsq)/(scale*sig))
    394391                G2frame.G2plotNB.status.SetStatusText('Fosq, sig, Fcsq, delFsq/sig = '+HKLtxt,1)
     392               
     393    def OnPick(event):
     394        pick = event.artist
     395        HKLtext = pick.get_gid()
     396        Page.canvas.SetToolTipString(HKLtext)
     397        G2frame.G2plotNB.status.SetStatusText('H = '+HKLtext,0)
    395398                                 
    396399    Name = G2frame.PatternTree.GetItemText(G2frame.PatternId)
     
    411414        Page.canvas.mpl_connect('button_press_event', OnSCPress)
    412415        Page.canvas.mpl_connect('motion_notify_event', OnSCMotion)
     416        Page.canvas.mpl_connect('pick_event', OnPick)
    413417        Page.canvas.mpl_connect('key_press_event', OnSCKeyPress)
    414418        Page.keyPress = OnSCKeyPress
     
    479483            elif Type == '|DFsq|/sig':
    480484                if sig > 0.:
    481                     A = (Fosq-Fcsq)/(3*sig)
     485                    A = scale*(Fosq-Fcsq)/(3*sig)
    482486                B = 0
    483487            elif Type == '|DFsq|>sig':
    484488                if sig > 0.:
    485                     A = (Fosq-Fcsq)/(3*sig)
     489                    A = scale*(Fosq-Fcsq)/(3*sig)
    486490                if abs(A) < 1.0: A = 0
    487491                B = 0                   
    488492            elif Type == '|DFsq|>3sig':
    489493                if sig > 0.:
    490                     A = (Fosq-Fcsq)/(3*sig)
     494                    A = scale*(Fosq-Fcsq)/(3*sig)
    491495                if abs(A) < 3.0: A = 0
    492496                B = 0
    493497            if Super:
    494                 h = H+SuperVec*refl[3]               
     498                h = H+SuperVec*refl[3]
     499                if refl[3]:
     500                    hid = '(%d,%d,%d,%d)'%(refl[0],refl[1],refl[2],refl[3])
     501                else:
     502                    hid = '(%d,%d,%d)'%(refl[0],refl[1],refl[2])               
    495503            else:
    496504                h = H
     505                hid = '(%d,%d,%d)'%(refl[0],refl[1],refl[2])               
    497506            xy = (h[pzone[izone][0]],h[pzone[izone][1]])
    498507            if Type in ['|DFsq|/sig','|DFsq|>sig','|DFsq|>3sig']:
    499508                if A > 0.0:
    500                     Plot.add_artist(Circle(xy,radius=A,ec='g',fc='w'))
     509                    Plot.add_artist(Circle(xy,radius=A,ec='g',fc='w',picker=1.,gid=hid))
    501510                else:
    502                     Plot.add_artist(Circle(xy,radius=-A,ec='r',fc='w'))
     511                    Plot.add_artist(Circle(xy,radius=-A,ec='r',fc='w',picker=1.,gid=hid))
    503512            else:
    504513                if A > 0.0 and A > B:
    505514                    Plot.add_artist(Circle(xy,radius=A,ec='g',fc='w'))
    506515                if B:
    507                     Plot.add_artist(Circle(xy,radius=B,ec='b',fc='w'))
     516                    Plot.add_artist(Circle(xy,radius=B,ec='b',fc='w',picker=1.,gid=hid))
    508517                    if A < B:
    509518                        Plot.add_artist(Circle(xy,radius=A,ec='g',fc='w'))
  • trunk/GSASIIstrMath.py

    r2038 r2040  
    754754        else:
    755755            if len(TwinLaw) > 1:
    756                 refl.T[9] = np.sum(fas[:,:,0]**2,axis=0)+np.sum(fbs[:,:,0]**2,axis=0)   #FcT from primary twin element
     756                refl.T[9] = np.sum(fas[:,:,0],axis=0)**2+np.sum(fbs[:,:,0],axis=0)**2   #FcT from primary twin element
    757757                refl.T[7] = np.sum(TwinFr*np.sum(TwMask[np.newaxis,:,:]*fas,axis=0)**2,axis=-1)+   \
    758758                    np.sum(TwinFr*np.sum(TwMask[np.newaxis,:,:]*fbs,axis=0)**2,axis=-1)                        #Fc sum over twins
    759759                refl.T[10] = atan2d(fbs[0].T[0],fas[0].T[0])  #ignore f' & f"
    760760            else:
    761                 refl.T[9] = np.sum(fas**2,axis=0)+np.sum(fbs**2,axis=0)
     761                refl.T[9] = np.sum(fas,axis=0)**2+np.sum(fbs,axis=0)**2
    762762                refl.T[7] = np.copy(refl.T[9])               
    763763                refl.T[10] = atan2d(fbs[0],fas[0])  #ignore f' & f"
     
    898898                2.*(fbs[0]*dfbdua[0]+fbs[1]*dfbdua[1])
    899899        else:
    900             SA = fas[0]+fbs[1]
    901             SB = fbs[0]+fas[1]
     900            SA = fas[0]+fas[1]
     901            SB = fbs[0]+fbs[1]
    902902            if nTwin > 1:
    903                 dFdfr[iref] = [2.*TwMask[it]*(fas[0][it]*dfadfr[0][it]+fas[1][it]*dfadfr[1][it]+fbs[0][it]*dfbdfr[0][it]+fbs[1][it]*dfbdfr[1][it])*Mdata/len(Uniq[it]) for it in range(nTwin)]
    904                 dFdx[iref] = [2.*TwMask[it]*(fas[0][it]*dfadx[it][0]+fas[1][it]*dfadx[it][1]+fbs[0][it]*dfbdx[it][0]+fbs[1][it]*dfbdx[it][1]) for it in range(nTwin)]
    905                 dFdui[iref] = [2.*TwMask[it]*(fas[0][it]*dfadui[it][0]+fas[1][it]*dfadui[it][1]+fbs[0][it]*dfbdui[it][0]+fbs[1][it]*dfbdui[it][1]) for it in range(nTwin)]
    906                 dFdua[iref] = [2.*TwMask[it]*(fas[0][it]*dfadua[it][0]+fas[1][it]*dfadua[it][1]+fbs[0][it]*dfbdua[it][0]+fbs[1][it]*dfbdua[it][1]) for it in range(nTwin)]
     903                dFdfr[iref] = [2.*TwMask[it]*(SA[it]*dfadfr[0][it]+SA[it]*dfadfr[1][it]+SB[it]*dfbdfr[0][it]+SB[it]*dfbdfr[1][it])*Mdata/len(Uniq[it]) for it in range(nTwin)]
     904                dFdx[iref] = [2.*TwMask[it]*(SA[it]*dfadx[it][0]+SA[it]*dfadx[it][1]+SB[it]*dfbdx[it][0]+SB[it]*dfbdx[it][1]) for it in range(nTwin)]
     905                dFdui[iref] = [2.*TwMask[it]*(SA[it]*dfadui[it][0]+SA[it]*dfadui[it][1]+SB[it]*dfbdui[it][0]+SB[it]*dfbdui[it][1]) for it in range(nTwin)]
     906                dFdua[iref] = [2.*TwMask[it]*(SA[it]*dfadua[it][0]+SA[it]*dfadua[it][1]+SB[it]*dfbdua[it][0]+SB[it]*dfbdua[it][1]) for it in range(nTwin)]
    907907                dFdtw[iref] = np.sum(TwMask*fas,axis=0)**2+np.sum(TwMask*fbs,axis=0)**2
    908908               
    909909            else:   #these are good for no twin single crystals
    910                 dFdfr[iref] = 2.*(fas[0]*dfadfr[0]+fas[1]*dfadfr[1]+fbs[0]*dfbdfr[0]+fbs[1]*dfbdfr[1])*Mdata/len(Uniq)
    911                 dFdx[iref] = 2.*(fas[0]*dfadx[0]+fas[1]*dfadx[1]+fbs[0]*dfbdx[0]+fbs[1]*dfbdx[1])
    912                 dFdui[iref] = 2.*(fas[0]*dfadui[0]+fas[1]*dfadui[1]+fbs[0]*dfbdui[0]+fbs[1]*dfbdui[1])
    913                 dFdua[iref] = 2.*(fas[0]*dfadua[0]+fas[1]*dfadua[1]+fbs[0]*dfbdua[0]+fbs[1]*dfbdua[1])
    914                 dFdfl[iref] = -SA*dfadfl-SB*dfbdfl  #array(nRef,)
     910                dFdfr[iref] = (2.*SA*(dfadfr[0]+dfadfr[1])+2.*SB*(dfbdfr[0]+dfbdfr[1]))*Mdata/len(Uniq)
     911                dFdx[iref] = 2.*SA*(dfadx[0]+dfadx[1])+2.*SB*(dfbdx[0]+dfbdx[1])
     912                dFdui[iref] = 2.*SA*(dfadui[0]+dfadui[1])+2.*SB*(dfbdui[0]+dfbdui[1])
     913                dFdua[iref] = 2.*SA*(dfadua[0]+dfadua[1])+2.*SB*(dfbdua[0]+dfbdua[1])
     914                dFdfl[iref] = -(fas[0]+fbs[1])*dfadfl-(fbs[0]+fas[1])*dfbdfl  #array(nRef,)
    915915        dFdbab[iref] = 2.*fas[0]*np.array([np.sum(dfadba*dBabdA),np.sum(-dfadba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T+ \
    916916            2.*fbs[0]*np.array([np.sum(dfbdba*dBabdA),np.sum(-dfbdba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T
     
    978978    SSGMT = np.array([ops[0].T for ops in SSGData['SSGOps']])
    979979    SSGT = np.array([ops[1] for ops in SSGData['SSGOps']])
    980     eps = SSGMT[:,3,3]
     980#    eps = SSGMT[:,3,3]
    981981    FFtables = calcControls['FFtables']
    982982    BLtables = calcControls['BLtables']
     
    994994    Tdata,Mdata,Fdata,Xdata,dXdata,IAdata,Uisodata,Uijdata = GetAtomFXU(pfx,calcControls,parmDict)
    995995    waveTypes,FSSdata,XSSdata,USSdata,MSSdata = GetAtomSSFXU(pfx,calcControls,parmDict)
    996     Smult,TauT = GetSSTauM(SGData['SGOps'],SSGData['SSGOps'],pfx,calcControls,Xdata)
     996#    Smult,TauT = GetSSTauM(SGData['SGOps'],SSGData['SSGOps'],pfx,calcControls,Xdata)
    997997#    GSASIIpath.IPyBreak()
    998     if SGInv:
    999         TauT = np.hstack((TauT,-TauT))
    1000         eps = np.concatenate((eps,-eps))
     998#    if SGInv:
     999#        TauT = np.hstack((TauT,-TauT))
     1000#        eps = np.concatenate((eps,-eps))
    10011001    modQ = np.array([parmDict[pfx+'mV0'],parmDict[pfx+'mV1'],parmDict[pfx+'mV2']])
    10021002    FF = np.zeros(len(Tdata))
     
    10461046        UniqP = np.inner(HP.T,SGMT)
    10471047        Phi = np.inner(H.T,SSGT)
    1048         PhiP = np.inner(HP.T,SGT)
     1048#        PhiP = np.inner(HP.T,SGT)
    10491049        if SGInv:   #if centro - expand HKL sets
    10501050            Uniq = np.hstack((Uniq,-Uniq))
    10511051            Phi = np.hstack((Phi,-Phi))
    10521052            UniqP = np.hstack((UniqP,-UniqP))
    1053             PhiP = np.hstack((PhiP,-PhiP))
     1053#            PhiP = np.hstack((PhiP,-PhiP))
    10541054        if 'T' in calcControls[hfx+'histType']:
    10551055            if 'P' in calcControls[hfx+'histType']:
     
    10621062        Tindx = np.array([refDict['FF']['El'].index(El) for El in Tdata])
    10631063        FF = np.repeat(refDict['FF']['FF'][iBeg:iFin].T[Tindx].T,Uniq.shape[1]*len(TwinLaw),axis=0)
    1064         phase = twopi*(np.inner(Uniq[:,:,:3],(dXdata.T+Xdata.T))+Phi[:,:,nxs])
     1064        phase = twopi*(np.inner(Uniq[:,:,:3],(dXdata.T+Xdata.T))-Phi[:,:,nxs])
    10651065        sinp = np.sin(phase)
    10661066        cosp = np.cos(phase)
     
    10871087        else:
    10881088            if len(TwinLaw) > 1:
    1089                 refl.T[10] = np.sum(fas[:,:,0]**2,axis=0)+np.sum(fbs[:,:,0]**2,axis=0)   #FcT from primary twin element
     1089                refl.T[10] = np.sum(fas[:,:,0],axis=0)**2+np.sum(fbs[:,:,0],axis=0)**2                  #FcT from primary twin element
    10901090                refl.T[8] = np.sum(TwinFr*np.sum(TwMask[np.newaxis,:,:]*fas,axis=0)**2,axis=-1)+   \
    1091                     np.sum(TwinFr*np.sum(TwMask[np.newaxis,:,:]*fbs,axis=0)**2,axis=-1)                        #Fc sum over twins
     1091                    np.sum(TwinFr*np.sum(TwMask[np.newaxis,:,:]*fbs,axis=0)**2,axis=-1)                 #Fc sum over twins
    10921092                refl.T[11] = atan2d(fbs[0].T[0],fas[0].T[0])  #ignore f' & f"
    10931093            else:
    1094                 refl.T[10] = np.sum(fas**2,axis=0)+np.sum(fbs**2,axis=0)    #sum of squares
     1094                refl.T[10] = np.sum(fas,axis=0)**2+np.sum(fbs,axis=0)**2    #square of sums
    10951095                refl.T[8] = np.copy(refl.T[10])               
    10961096                refl.T[11] = atan2d(fbs[0],fas[0])  #ignore f' & f"
     
    11241124    mSize = len(Mdata)  #no. atoms
    11251125    waveTypes,FSSdata,XSSdata,USSdata,MSSdata = GetAtomSSFXU(pfx,calcControls,parmDict)
    1126     Smult,TauT = GetSSTauM(SGData['SGOps'],SSGData['SSGOps'],pfx,calcControls,Xdata)
    1127     if SGInv:
    1128         TauT = np.hstack((TauT,-TauT))
     1126#    Smult,TauT = GetSSTauM(SGData['SGOps'],SSGData['SSGOps'],pfx,calcControls,Xdata)
     1127#    if SGInv:
     1128#        TauT = np.hstack((TauT,-TauT))
    11291129    modQ = np.array([parmDict[pfx+'mV0'],parmDict[pfx+'mV1'],parmDict[pfx+'mV2']])
    11301130    FF = np.zeros(len(Tdata))
     
    11961196        Phi = np.inner(H,SSGT)
    11971197        UniqP = np.inner(HP,SGMT)
    1198         PhiP = np.inner(HP,SGT)
    11991198        if SGInv:   #if centro - expand HKL sets
    12001199            Uniq = np.vstack((Uniq,-Uniq))
    12011200            Phi = np.hstack((Phi,-Phi))
    12021201            UniqP = np.vstack((UniqP,-UniqP))
    1203             PhiP = np.hstack((PhiP,-PhiP))
    1204 #        GSASIIpath.IPyBreak()                 
    12051202        phase = twopi*(np.inner(Uniq[:,:3],(dXdata+Xdata).T)+Phi[:,nxs])
    12061203        sinp = np.sin(phase)
     
    12811278                2.*(fbs[0]*dfbdGu[0]+fbs[1]*dfbdGu[1])
    12821279        else:
    1283             SA = fas[0]-fbs[1]
    1284             SB = fbs[0]+fas[1]
     1280            SA = fas[0]+fas[1]
     1281            SB = fbs[0]+fbs[1]
    12851282            if nTwin > 1:
    1286                 dFdfr[iref] = [2.*TwMask[it]*(fas[0][it]*dfadfr[0][it]+fas[1][it]*dfadfr[1][it]+fbs[0][it]*dfbdfr[0][it]+fbs[1][it]*dfbdfr[1][it])*Mdata/len(Uniq[it]) for it in range(nTwin)]
    1287                 dFdx[iref] = [2.*TwMask[it]*(fas[0][it]*dfadx[it][0]+fas[1][it]*dfadx[it][1]+fbs[0][it]*dfbdx[it][0]+fbs[1][it]*dfbdx[it][1]) for it in range(nTwin)]
    1288                 dFdui[iref] = [2.*TwMask[it]*(fas[0][it]*dfadui[it][0]+fas[1][it]*dfadui[it][1]+fbs[0][it]*dfbdui[it][0]+fbs[1][it]*dfbdui[it][1]) for it in range(nTwin)]
    1289                 dFdua[iref] = [2.*TwMask[it]*(fas[0][it]*dfadua[it][0]+fas[1][it]*dfadua[it][1]+fbs[0][it]*dfbdua[it][0]+fbs[1][it]*dfbdua[it][1]) for it in range(nTwin)]
    1290                 dFdGx[iref] = [2.*TwMask[it]*(fas[0][it]*dfadGx[0]+fas[1][it]*dfadGx[1]+fbs[0][it]*dfbdGx[0]+fbs[1][it]*dfbdGx[1]) for it in range(nTwin)]
    1291                 dFdGu[iref] = [2.*TwMask[it]*(fas[0][it]*dfadGu[0]+fas[1][it]*dfadGu[1]+fbs[0][it]*dfbdGu[0]+fbs[1][it]*dfbdGu[1]) for it in range(nTwin)]
     1283                dFdfr[iref] = [2.*TwMask[it]*(SA[it]*dfadfr[0][it]+SA[it]*dfadfr[1][it]+SB[it]*dfbdfr[0][it]+SB[it]*dfbdfr[1][it])*Mdata/len(Uniq[it]) for it in range(nTwin)]
     1284                dFdx[iref] = [2.*TwMask[it]*(SA[it]*dfadx[it][0]+SA[it]*dfadx[it][1]+SB[it]*dfbdx[it][0]+SB[it]*dfbdx[it][1]) for it in range(nTwin)]
     1285                dFdui[iref] = [2.*TwMask[it]*(SA[it]*dfadui[it][0]+SA[it]*dfadui[it][1]+SB[it]*dfbdui[it][0]+SB[it]*dfbdui[it][1]) for it in range(nTwin)]
     1286                dFdua[iref] = [2.*TwMask[it]*(SA[it]*dfadua[it][0]+SA[it]*dfadua[it][1]+SB[it]*dfbdua[it][0]+SB[it]*dfbdua[it][1]) for it in range(nTwin)]
     1287                dFdGx[iref] = [2.*TwMask[it]*(SA[it]*dfadGx[0]+SA[it]*dfadGx[1]+SB[it]*dfbdGx[0]+SB[it]*dfbdGx[1]) for it in range(nTwin)]
     1288                dFdGu[iref] = [2.*TwMask[it]*(SA[it]*dfadGu[0]+SA[it]*dfadGu[1]+SB[it]*dfbdGu[0]+SB[it]*dfbdGu[1]) for it in range(nTwin)]
    12921289                dFdtw[iref] = np.sum(TwMask*fas,axis=0)**2+np.sum(TwMask*fbs,axis=0)**2
    12931290               
    12941291            else:   #these are good for no twin single crystals
    1295                 dFdfr[iref] = 2.*(fas[0]*dfadfr[0]+fas[1]*dfadfr[1]+fbs[0]*dfbdfr[0]+fbs[1]*dfbdfr[1])*Mdata/len(Uniq) #array(nRef,nAtom)
    1296                 dFdx[iref] = 2.*(fas[0]*dfadx[0]+fbs[1]*dfbdx[1]+fbs[0]*dfbdx[0]+fas[1]*dfadx[1])    #array(nRef,nAtom,3)
    1297                 dFdui[iref] = 2.*(fas[0]*dfadui[0]+fbs[1]*dfbdui[1]+fbs[0]*dfbdui[0]+fas[1]*dfadui[1])   #array(nRef,nAtom)
    1298                 dFdua[iref] = 2.*(fas[0]*dfadua[0]+fbs[1]*dfbdua[1]+fbs[0]*dfbdua[0]+fas[1]*dfadua[1])    #array(nRef,nAtom,6)
    1299                 dFdfl[iref] = -SA*dfadfl-SB*dfbdfl                  #array(nRef,)
    1300                 dFdGx[iref] = 2.*(fas[0]*dfadGx[0]+fas[1]*dfadGx[1]+fbs[0]*dfbdGx[0]+fbs[1]*dfbdGx[1])      #array(nRef,natom,nwave,6)
    1301                 dFdGu[iref] = 2.*(fas[0]*dfadGu[0]+fas[1]*dfadGu[1]+fbs[0]*dfbdGu[0]+fbs[1]*dfbdGu[1])      #array(nRef,natom,nwave,6)
     1292                dFdfr[iref] = 2.*(SA*dfadfr[0]+SA*dfadfr[1]+SB*dfbdfr[0]+SB*dfbdfr[1])*Mdata/len(Uniq) #array(nRef,nAtom)
     1293                dFdx[iref] = 2.*(SA*dfadx[0]+SB*dfbdx[1]+SB*dfbdx[0]+SA*dfadx[1])    #array(nRef,nAtom,3)
     1294                dFdui[iref] = 2.*(SA*dfadui[0]+SB*dfbdui[1]+SB*dfbdui[0]+SA*dfadui[1])   #array(nRef,nAtom)
     1295                dFdua[iref] = 2.*(SA*dfadua[0]+SB*dfbdua[1]+SB*dfbdua[0]+SA*dfadua[1])    #array(nRef,nAtom,6)
     1296                dFdfl[iref] = -(fas[0]-SB)*dfadfl-(fbs[0]+fas[1])*dfbdfl                  #array(nRef,)
     1297                dFdGx[iref] = 2.*(SA*dfadGx[0]+SA*dfadGx[1]+SB*dfbdGx[0]+SB*dfbdGx[1])      #array(nRef,natom,nwave,6)
     1298                dFdGu[iref] = 2.*(SA*dfadGu[0]+SA*dfadGu[1]+SB*dfbdGu[0]+SB*dfbdGu[1])      #array(nRef,natom,nwave,6)
    13021299        dFdbab[iref] = 2.*fas[0]*np.array([np.sum(dfadba*dBabdA),np.sum(-dfadba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T+ \
    13031300            2.*fbs[0]*np.array([np.sum(dfbdba*dBabdA),np.sum(-dfbdba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T
  • trunk/imports/G2phase.py

    r2039 r2040  
    475475            if S1[11:15].strip() == '1':
    476476                S2 = file2.readline()
    477                 Uiso = float(S2[:9])
     477                Uiso = R2pisq*float(S2[:9])/4.      #Biso -> Uiso
    478478                Uij = [0,0,0,0,0,0]
    479479                IA = 'I'
  • trunk/imports/G2sfact_CIF.py

    r1956 r2040  
    320320            self.RefDict['RefList'] = np.array(self.RefDict['RefList'])
    321321            self.errors = 'Error during reading of dataset parameters'
     322            Type = 'SXC'
    322323            if blk.get('_diffrn_radiation_probe'):
    323324                if blk['_diffrn_radiation_probe'] == 'neutron':
     
    326327                if blk['_diffrn_radiation.probe'] == 'neutron':
    327328                    Type = 'SNC'
    328             else:
    329                 Type = 'SXC'
    330329            self.RefDict['Type'] = Type
    331330            self.RefDict['Super'] = im
Note: See TracChangeset for help on using the changeset viewer.