Changeset 3759


Ignore:
Timestamp:
Dec 11, 2018 2:11:02 PM (3 years ago)
Author:
vondreele
Message:

add fullIntegrate = True to configuration stuff
add input control for line scan azimuth, including 1deg step incrementers
work on nonFourier incommensurate functions & derivatives - they will be done numerically not analytically
remove "SawTooth?" - wasn't supported

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r3711 r3759  
    350350        Data['outAzimuths'] = 1
    351351        Data['centerAzm'] = False
    352         Data['fullIntegrate'] = True
     352        Data['fullIntegrate'] = GSASIIpath.GetConfigValue('fullIntegrate',True)
    353353        Data['setRings'] = False
    354354        Data['background image'] = ['',-1.0]                           
  • trunk/GSASIIimgGUI.py

    r3737 r3759  
    778778               
    779779        def OnLineScan(event):
    780             Azm = (data['LRazimuth'][1]+data['LRazimuth'][0])/2.
    781             data['linescan'] = [linescan.GetValue(),Azm]
     780            data['linescan'][0] = linescan.GetValue()
     781            wx.CallAfter(UpdateImageControls,G2frame,data,masks)
     782            G2plt.PlotExposedImage(G2frame,event=event)
     783           
     784        def OnNewLineScan(invalid,value,tc):
     785            G2plt.PlotExposedImage(G2frame,event=None)
     786           
     787        def OnMoveAzm(event):
     788            data['linescan'][1] += float(azmSpin.GetValue())
     789            data['linescan'][1] = data['linescan'][1]%360.
     790            G2frame.scanazm.SetValue(data['linescan'][1])
    782791            G2plt.PlotExposedImage(G2frame,event=event)
    783792
     
    827836        scaleSel.Bind(wx.EVT_CHOICE,OnAutoSet)
    828837        autoSizer.Add(scaleSel,0,WACV)
    829         linescan = wx.CheckBox(G2frame.dataWindow,label=' Show line scan')
     838        if data['linescan'][0]:
     839            linescan = wx.CheckBox(G2frame.dataWindow,label=' Show line scan at azm = ')
     840        else:
     841            linescan = wx.CheckBox(G2frame.dataWindow,label=' Show line scan')
    830842        linescan.Bind(wx.EVT_CHECKBOX,OnLineScan)
    831843        linescan.SetValue(data['linescan'][0])
    832844        autoSizer.Add((5,0),0)
    833845        autoSizer.Add(linescan,0,WACV)
     846        if data['linescan'][0]:
     847            G2frame.scanazm = G2G.ValidatedTxtCtrl(G2frame.dataWindow,data['linescan'],1,min=0.,
     848            max=360.,OnLeave=OnNewLineScan)
     849            autoSizer.Add(G2frame.scanazm,0,WACV)
     850            azmSpin = wx.SpinButton(G2frame.dataWindow,style=wx.SP_VERTICAL,size=wx.Size(20,25))
     851            azmSpin.SetValue(0)
     852            azmSpin.SetRange(-1,1)
     853            azmSpin.Bind(wx.EVT_SPIN, OnMoveAzm)
     854            autoSizer.Add(azmSpin,0,WACV)
     855
    834856        maxSizer.Add(autoSizer)
    835857        return maxSizer
  • trunk/GSASIImath.py

    r3754 r3759  
    14901490def ModulationDerv(H,HP,Hij,nWaves,waveShapes,Fmod,Xmod,UmodAB,SCtauF,SCtauX,SCtauU,glTau,glWt):
    14911491    '''
     1492    Compute Fourier modulation derivatives
    14921493    H: array ops X hklt proj to hkl
    14931494    HP: array ops X hklt proj to hkl
     
    15131514        HuH = np.sum(HP[:,nxs,nxs,nxs]*np.inner(HP,Umod),axis=-1)    #ops x atoms x waves x ngl
    15141515        HbH = np.exp(-np.sum(HuH,axis=-2)) # ops x atoms x ngl; sum waves - OK vs Modulation version
     1516#        part1 = -np.exp(-HuH)*Fmod[nxs,:,nxs,:]    #ops x atoms x waves x ngl
    15151517        part1 = -np.exp(-HuH)*Fmod    #ops x atoms x waves x ngl
    15161518        dUdAu = Hij[:,nxs,nxs,nxs,:]*np.rollaxis(G2lat.UijtoU6(SCtauU[0]),0,4)[nxs,:,:,:,:]    #ops x atoms x waves x ngl x 6sinUij
     
    15271529    dHdXB = twopi*HP[:,nxs,nxs,nxs,:]*np.swapaxes(SCtauX[1],-1,-2)[nxs,:,:,:,:]    #ditto - cos waves
    15281530# ops x atoms x waves x 2xyz - real part - good
     1531#    dGdMxCa = -np.sum((Fmod[nxs,:,:]*HbH)[:,:,nxs,:,nxs]*(dHdXA*np.sin(HdotXD)[:,:,nxs,:,nxs])*glWt[nxs,nxs,nxs,:,nxs],axis=-2)
     1532#    dGdMxCb = -np.sum((Fmod[nxs,:,:]*HbH)[:,:,nxs,:,nxs]*(dHdXB*np.sin(HdotXD)[:,:,nxs,:,nxs])*glWt[nxs,nxs,nxs,:,nxs],axis=-2)
    15291533    dGdMxCa = -np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXA*np.sin(HdotXD)[:,:,nxs,:,nxs])*glWt[nxs,nxs,nxs,:,nxs],axis=-2)
    15301534    dGdMxCb = -np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXB*np.sin(HdotXD)[:,:,nxs,:,nxs])*glWt[nxs,nxs,nxs,:,nxs],axis=-2)
    15311535    dGdMxC = np.concatenate((dGdMxCa,dGdMxCb),axis=-1)
    15321536# ops x atoms x waves x 2xyz - imag part - good
     1537#    dGdMxSa = np.sum((Fmod[nxs,:,:]*HbH)[:,:,nxs,:,nxs]*(dHdXA*np.cos(HdotXD)[:,:,nxs,:,nxs])*glWt[nxs,nxs,nxs,:,nxs],axis=-2)   
     1538#    dGdMxSb = np.sum((Fmod[nxs,:,:]*HbH)[:,:,nxs,:,nxs]*(dHdXB*np.cos(HdotXD)[:,:,nxs,:,nxs])*glWt[nxs,nxs,nxs,:,nxs],axis=-2)   
    15331539    dGdMxSa = np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXA*np.cos(HdotXD)[:,:,nxs,:,nxs])*glWt[nxs,nxs,nxs,:,nxs],axis=-2)   
    15341540    dGdMxSb = np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXB*np.cos(HdotXD)[:,:,nxs,:,nxs])*glWt[nxs,nxs,nxs,:,nxs],axis=-2)   
    15351541    dGdMxS = np.concatenate((dGdMxSa,dGdMxSb),axis=-1)
    1536 # ZigZag/Block waves - problems here?
    1537     dHdXZt = -twopi*HP[:,nxs,nxs,nxs,:]*np.swapaxes(SCtauX[2],-1,-2)[nxs,:,:,:,:]          #ops x atoms x ngl x 2(ZigZag/Block Tminmax)
    1538     dHdXZx = twopi*HP[:,nxs,nxs,:]*np.swapaxes(SCtauX[3],-1,-2)[nxs,:,:,:]          #ops x atoms x ngl x 3(ZigZag/Block XYZmax)
    1539     dGdMzCt = -np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXZt*np.sin(HdotXD)[:,:,nxs,:,nxs])*glWt[nxs,nxs,nxs,:,nxs],axis=-2)
    1540     dGdMzCx = -np.sum((Fmod*HbH)[:,:,:,nxs]*(dHdXZx*np.sin(HdotXD)[:,:,:,nxs])*glWt[nxs,nxs,:,nxs],axis=-2)
    1541     dGdMzC = np.concatenate((np.sum(dGdMzCt,axis=-1),dGdMzCx),axis=-1)
    1542     dGdMzSt = np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXZt*np.cos(HdotXD)[:,:,nxs,:,nxs])*glWt[nxs,nxs,nxs,:,nxs],axis=-2)
    1543     dGdMzSx = np.sum((Fmod*HbH)[:,:,:,nxs]*(dHdXZx*np.cos(HdotXD)[:,:,:,nxs])*glWt[nxs,nxs,:,nxs],axis=-2)
    1544     dGdMzS = np.concatenate((np.sum(dGdMzSt,axis=-1),dGdMzSx),axis=-1)
    1545 #    GSASIIpath.IPyBreak()
    1546     return [dGdMfC,dGdMfS],[dGdMxC,dGdMxS],[dGdMuC,dGdMuS],[dGdMzC,dGdMzS]
     1542    return [dGdMfC,dGdMfS],[dGdMxC,dGdMxS],[dGdMuC,dGdMuS]
    15471543   
    15481544def ModulationDerv2(H,HP,Hij,nWaves,waveShapes,Fmod,Xmod,UmodAB,SCtauF,SCtauX,SCtauU,glTau,glWt):
     
    17071703                    if waveType in ['ZigZag','Block'] and not i:
    17081704                        Tminmax = spos[0][:2]
    1709                         XYZmax = np.array(spos[0][2:])
     1705                        XYZmax = np.array(spos[0][2:5])
    17101706                        if waveType == 'Block':
    17111707                            wave = np.array(posBlock([tauT,],Tminmax,XYZmax))[0]
  • trunk/GSASIIphsGUI.py

    r3750 r3759  
    49134913        cx,ct,cs,cia = generalData['AtomPtrs']
    49144914        typeNames = {'Sfrac':' Site fraction','Spos':' Position','Sadp':' Thermal motion','Smag':' Magnetic moment'}
    4915         numVals = {'Sfrac':2,'Spos':6,'Sadp':12,'Smag':6,'ZigZag':5,'Block':5,'Crenel':2,'SawTooth':3}
     4915        numVals = {'Sfrac':2,'Spos':6,'Sadp':12,'Smag':6,'ZigZag':5,'Block':5,'Crenel':2}
    49164916        posNames = ['Xsin','Ysin','Zsin','Xcos','Ycos','Zcos','Tmin','Tmax','Xmax','Ymax','Zmax']
    49174917        adpNames = ['U11sin','U22sin','U33sin','U12sin','U13sin','U23sin',
     
    49194919        magNames = ['MXsin','MYsin','MZsin','MXcos','MYcos','MZcos']
    49204920        fracNames = ['Fsin','Fcos','Fzero','Fwid']
    4921         waveTypes = {'Sfrac':['Fourier','Crenel'],'Spos':['Fourier','ZigZag','Block','SawTooth'],'Sadp':['Fourier',],'Smag':['Fourier',]}
     4921        waveTypes = {'Sfrac':['Fourier','Crenel'],'Spos':['Fourier','ZigZag','Block',],'Sadp':['Fourier',],'Smag':['Fourier',]}
    49224922        Labels = {'Spos':posNames,'Sfrac':fracNames,'Sadp':adpNames,'Smag':magNames}
    49234923        Indx = {}
     
    49494949           
    49504950        def RepaintAtomInfo(Scroll=0):
    4951 #            mainSizer.Detach(G2frame.bottomSizer)
    49524951            G2frame.bottomSizer.Clear(True)
    49534952            G2frame.bottomSizer = ShowAtomInfo()
     
    49614960        def ShowAtomInfo():
    49624961           
     4962            global mapSel       #so it can be seen below in OnWavePlot
    49634963            def AtomSizer(atom):
     4964                global mapSel
    49644965               
    49654966                def OnShowWave(event):
     
    50015002                    nt = numVals[Stype]
    50025003                    if not len(atm[-1]['SS1'][item]):
    5003                         if waveTyp in ['ZigZag','Block','Crenel','SawTooth']:
     5004                        if waveTyp in ['ZigZag','Block','Crenel']:
    50045005                            nt = numVals[waveTyp]                       
    50055006                        atm[-1]['SS1'][item] = [0,]
     
    50075008                    atm[-1]['SS1'][item].append([[0.0 for i in range(nt)],False])
    50085009                    wx.CallAfter(RepaintAtomInfo,G2frame.waveData.GetScrollPos(wx.VERTICAL))
    5009                    
    5010                 def OnWaveVal(event):
    5011                     event.Skip()
    5012                     Obj = event.GetEventObject()
    5013                     item,iwave,ival = Indx[Obj.GetId()]
    5014                     try:
    5015                         val = float(Obj.GetValue())
    5016                         if waveTyp in ['ZigZag','Block'] and ival < 2 and not iwave:
    5017                             if ival == 1: #Tmax
    5018                                 val = min(1.0,max(0.0,val))
    5019                             elif ival == 0: #Tmin
    5020                                 val = max(-1.,min(val,atm[-1]['SS1'][item][1][0][ival]))
    5021                     except ValueError:
    5022                         val = atm[-1]['SS1'][item][iwave+1][0][ival]
    5023                     Obj.SetValue('%.5f'%val)
    5024                     atm[-1]['SS1'][item][iwave+1][0][ival] = val
    50255010                   
    50265011                def OnRefWave(event):
     
    50335018                    item,iwave = Indx[Obj.GetId()]
    50345019                    del atm[-1]['SS1'][item][iwave+1]
    5035                     wx.CallAfter(RepaintAtomInfo,G2frame.waveData.GetScrollPos(wx.VERTICAL))               
     5020                    if len(atm[-1]['SS1'][item]) == 1:
     5021                        atm[-1]['SS1'][item][0] = ''
     5022                    wx.CallAfter(RepaintAtomInfo,G2frame.waveData.GetScrollPos(wx.VERTICAL))
     5023                   
     5024                def OnWavePlot(invalid,value,tc):
     5025                    if len(D4Map['rho']):
     5026                        Ax = mapSel.GetValue()
     5027                        if Ax:
     5028                            G2plt.ModulationPlot(G2frame,data,atm,Ax)
    50365029               
    50375030                waveTyp,waveBlk = 'Fourier',[]
     
    50565049                    for iwave,wave in enumerate(waveBlk):
    50575050                        if not iwave:
    5058                             if waveTyp in ['ZigZag','Block','SawTooth','Crenel']:
     5051                            if waveTyp in ['ZigZag','Block','Crenel']:
    50595052                                nx = 1
    50605053                            CSI = G2spc.GetSSfxuinel(waveTyp,Stype,1,xyz,SGData,SSGData)[0]
     
    50635056                        waveName = 'Fourier'
    50645057                        if Stype == 'Sfrac':
     5058                            nterm = 2
    50655059                            if 'Crenel' in waveTyp and not iwave:
    50665060                                waveName = 'Crenel'
     
    50705064                            Waves = wx.FlexGridSizer(0,4,5,5)
    50715065                        elif Stype == 'Spos':
     5066                            nterm = 6
    50725067                            if waveTyp in ['ZigZag','Block'] and not iwave:
     5068                                nterm = 5
    50735069                                names = Names[6:]
    50745070                                Waves = wx.FlexGridSizer(0,7,5,5)
     
    50775073                                names = Names[:6]
    50785074                                Waves = wx.FlexGridSizer(0,8,5,5)
    5079                         else:
     5075                        elif Stype == 'Sadp':
     5076                            nterm = 12
     5077                            names = Names
     5078                            Waves = wx.FlexGridSizer(0,8,5,5)
     5079                        elif Stype == 'Smag':
     5080                            nterm = 6
    50805081                            names = Names
    50815082                            Waves = wx.FlexGridSizer(0,8,5,5)
    50825083                        waveSizer.Add(wx.StaticText(waveData,label=' %s  parameters: %s'%(waveName,str(names).rstrip(']').lstrip('[').replace("'",''))),0,WACV)
    5083                         for ival,val in enumerate(wave[0]):
     5084                        for ival in range(nterm):
     5085                            val = wave[0][ival]
    50845086                            if np.any(CSI[0][ival]):
    5085 #            Zstep = G2G.ValidatedTxtCtrl(drawOptions,drawingData,'Zstep',nDig=(10,2),min=0.01,max=4.0)
    5086                                 waveVal = wx.TextCtrl(waveData,value='%.5f'%(val),style=wx.TE_PROCESS_ENTER)
    5087                                 waveVal.Bind(wx.EVT_TEXT_ENTER,OnWaveVal)
    5088                                 waveVal.Bind(wx.EVT_KILL_FOCUS,OnWaveVal)
    5089                                 Indx[waveVal.GetId()] = [Stype,iwave,ival]
     5087                                minmax = [-0.2,0.2]
     5088                                if waveTyp in ['ZigZag','Block'] and ival < 2: minmax = [0.,2.]
     5089                                waveVal = G2G.ValidatedTxtCtrl(waveData,wave[0],ival,nDig=(10,5),min=minmax[0],max=minmax[1],OnLeave=OnWavePlot)
    50905090                            else:
    50915091                                waveVal = wx.TextCtrl(waveData,value='%.5f'%(val),style=wx.TE_READONLY)
  • trunk/GSASIIplot.py

    r3712 r3759  
    61886188                        Page.SetToolTipString('%8.3f deg'%(tth))
    61896189                    elif 'linescan' in str(item):
    6190                         Data['linescan'][1] = azm                       
     6190                        Data['linescan'][1] = azm
     6191                        G2frame.scanazm.SetValue(azm)
    61916192                        Page.SetToolTipString('%6.1f deg'%(azm))
    61926193            else:
  • trunk/GSASIIstrMath.py

    r3755 r3759  
    15551555                refl.T[11] = atan2d(fbs[0],fas[0])  #ignore f' & f"
    15561556        iBeg += blkSize
    1557     print ('nRef %d time %.4f\r'%(nRef,time.time()-time0))
     1557#    print ('nRef %d time %.4f\r'%(nRef,time.time()-time0))
     1558    return copy.deepcopy(refDict['RefList'])
    15581559
    15591560def SStructureFactorTw(refDict,G,hfx,pfx,SGData,SSGData,calcControls,parmDict):
     
    17001701    '''
    17011702    Compute super structure factor derivatives for all h,k,l,m for phase - no twins
     1703    Only Fourier component are done analytically here
    17021704    input:
    17031705   
     
    17591761    dFdGf = np.zeros((nRef,mSize,FSSdata.shape[1],2))
    17601762    dFdGx = np.zeros((nRef,mSize,XSSdata.shape[1],6))
    1761     dFdGz = np.zeros((nRef,mSize,5))
     1763#    dFdGz = np.zeros((nRef,mSize,5))
    17621764    dFdGu = np.zeros((nRef,mSize,USSdata.shape[1],12))
    17631765    Flack = 1.0
     
    17981800        fotp = FPP*Tcorr            #ops x atoms
    17991801        GfpuA = G2mth.Modulation(Uniq,UniqP,nWaves,Fmod,Xmod,Umod,Mmod,glTau,glWt) #2 x sym X atoms
    1800         dGdf,dGdx,dGdu,dGdz = G2mth.ModulationDerv(Uniq,UniqP,Hij,nWaves,waveShapes,Fmod,Xmod,UmodAB,SCtauF,SCtauX,SCtauU,glTau,glWt)
     1802        dGdf,dGdx,dGdu = G2mth.ModulationDerv(Uniq,UniqP,Hij,nWaves,waveShapes,Fmod,Xmod,UmodAB,SCtauF,SCtauX,SCtauU,glTau,glWt)
    18011803        # GfpuA is 2 x ops x atoms
    18021804        # derivs are: ops x atoms x waves x 2,6,12, or 5 parms as [real,imag] parts
     
    18281830        dfadGx = np.sum(fa[:,:,:,nxs,nxs]*dGdx[0][nxs,:,:,:,:]-fb[:,:,:,nxs,nxs]*dGdx[1][nxs,:,:,:,:],axis=1)
    18291831        dfbdGx = np.sum(fb[:,:,:,nxs,nxs]*dGdx[0][nxs,:,:,:,:]+fa[:,:,:,nxs,nxs]*dGdx[1][nxs,:,:,:,:],axis=1)
    1830         dfadGz = np.sum(fa[:,:,0,nxs,nxs]*dGdz[0][nxs,:,:,:]-fb[:,:,0,nxs,nxs]*dGdz[1][nxs,:,:,:],axis=1)
    1831         dfbdGz = np.sum(fb[:,:,0,nxs,nxs]*dGdz[0][nxs,:,:,:]+fa[:,:,0,nxs,nxs]*dGdz[1][nxs,:,:,:],axis=1)
    18321832        dfadGu = np.sum(fa[:,:,:,nxs,nxs]*dGdu[0][nxs,:,:,:,:]-fb[:,:,:,nxs,nxs]*dGdu[1][nxs,:,:,:,:],axis=1)
    18331833        dfbdGu = np.sum(fb[:,:,:,nxs,nxs]*dGdu[0][nxs,:,:,:,:]+fa[:,:,:,nxs,nxs]*dGdu[1][nxs,:,:,:,:],axis=1)   
     
    18381838            dfadfl = 1.0
    18391839            dfbdfl = 1.0
    1840 #        GSASIIpath.IPyBreak()
    1841         #NB: the above have been checked against PA(1:10,1:2) in strfctr.for for Al2O3!   
    18421840        SA = fas[0]+fas[1]      #float = A+A'
    18431841        SB = fbs[0]+fbs[1]      #float = B+B'
     
    18561854            dFdGx[iref] = 2.*(fas[0]*dfadGx[0]+fas[1]*dfadGx[1])+  \
    18571855                2.*(fbs[0]*dfbdGx[0]-fbs[1]*dfbdGx[1])
    1858             dFdGz[iref] = 2.*(fas[0]*dfadGz[0]+fas[1]*dfadGz[1])+  \
    1859                 2.*(fbs[0]*dfbdGz[0]+fbs[1]*dfbdGz[1])
    18601856            dFdGu[iref] = 2.*(fas[0]*dfadGu[0]+fas[1]*dfadGu[1])+  \
    18611857                2.*(fbs[0]*dfbdGu[0]+fbs[1]*dfbdGu[1])
     
    18691865            dFdGf[iref] = 2.*(SA*dfadGf[0]+SB*dfbdGf[1])      #array(nRef,natom,nwave,2)
    18701866            dFdGx[iref] = 2.*(SA*dfadGx[0]+SB*dfbdGx[1])      #array(nRef,natom,nwave,6)
    1871             dFdGz[iref] = 2.*(SA*dfadGz[0]+SB*dfbdGz[1])      #array(nRef,natom,5)
    18721867            dFdGu[iref] = 2.*(SA*dfadGu[0]+SB*dfbdGu[1])      #array(nRef,natom,nwave,12)
    1873 #            GSASIIpath.IPyBreak()
    18741868        dFdbab[iref] = 2.*fas[0]*np.array([np.sum(dfadba*dBabdA),np.sum(-dfadba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T+ \
    18751869            2.*fbs[0]*np.array([np.sum(dfbdba*dBabdA),np.sum(-dfbdba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T
     
    18951889        if waveTypes[i] in ['Block','ZigZag']:
    18961890            nx = 1
    1897             dFdvDict[pfx+'Tmin:'+str(i)+':0'] = dFdGz.T[0][i]   #ZigZag/Block waves (if any)
    1898             dFdvDict[pfx+'Tmax:'+str(i)+':0'] = dFdGz.T[1][i]
    1899             dFdvDict[pfx+'Xmax:'+str(i)+':0'] = dFdGz.T[2][i]
    1900             dFdvDict[pfx+'Ymax:'+str(i)+':0'] = dFdGz.T[3][i]
    1901             dFdvDict[pfx+'Zmax:'+str(i)+':0'] = dFdGz.T[4][i]
    19021891        for j in range(XSSdata.shape[1]-nx):       #loop over waves
    19031892            dFdvDict[pfx+'Xsin:'+str(i)+':'+str(j+nx)] = dFdGx.T[0][j][i]
     
    19281917
    19291918def SStructureFactorDerv2(refDict,im,G,hfx,pfx,SGData,SSGData,calcControls,parmDict):
    1930     'Needs a doc string - no twins'
    1931     phfx = pfx.split(':')[0]+hfx
    1932     ast = np.sqrt(np.diag(G))
    1933     Mast = twopisq*np.multiply.outer(ast,ast)
    1934     SGInv = SGData['SGInv']
    1935     SGMT = np.array([ops[0].T for ops in SGData['SGOps']])
    1936     SGT = np.array([ops[1] for ops in SGData['SGOps']])
    1937     SSGMT = np.array([ops[0].T for ops in SSGData['SSGOps']])
    1938     SSGT = np.array([ops[1] for ops in SSGData['SSGOps']])
    1939     FFtables = calcControls['FFtables']
    1940     BLtables = calcControls['BLtables']
    1941     nRef = len(refDict['RefList'])
    1942     Tdata,Mdata,Fdata,Xdata,dXdata,IAdata,Uisodata,Uijdata,Gdata = \
    1943         GetAtomFXU(pfx,calcControls,parmDict)
    1944     if not Xdata.size:          #no atoms in phase!
    1945         return {}
    1946     mSize = len(Mdata)  #no. atoms
    1947     waveTypes,FSSdata,XSSdata,USSdata,MSSdata = GetAtomSSFXU(pfx,calcControls,parmDict)
    1948     ngl,nWaves,Fmod,Xmod,Umod,Mmod,glTau,glWt = G2mth.makeWaves(waveTypes,FSSdata,XSSdata,USSdata,MSSdata,Mast)
    1949     waveShapes,SCtauF,SCtauX,SCtauU,UmodAB = G2mth.makeWavesDerv(ngl,waveTypes,FSSdata,XSSdata,USSdata,MSSdata,Mast)[:5]
    1950     modQ = np.array([parmDict[pfx+'mV0'],parmDict[pfx+'mV1'],parmDict[pfx+'mV2']])
    1951     FF = np.zeros(len(Tdata))
    1952     if 'NC' in calcControls[hfx+'histType']:
    1953         FP,FPP = G2el.BlenResCW(Tdata,BLtables,parmDict[hfx+'Lam'])
    1954     elif 'X' in calcControls[hfx+'histType']:
    1955         FP = np.array([FFtables[El][hfx+'FP'] for El in Tdata])
    1956         FPP = np.array([FFtables[El][hfx+'FPP'] for El in Tdata])
    1957     Uij = np.array(G2lat.U6toUij(Uijdata)).T
    1958     bij = Mast*Uij
    1959     if not len(refDict['FF']):
    1960         if 'N' in calcControls[hfx+'histType']:
    1961             dat = G2el.getBLvalues(BLtables)        #will need wave here for anom. neutron b's
    1962         else:
    1963             dat = G2el.getFFvalues(FFtables,0.)       
    1964         refDict['FF']['El'] = list(dat.keys())
    1965         refDict['FF']['FF'] = np.zeros((len(refDict['RefList']),len(dat)))
     1919    '''
     1920    Compute super structure factor derivatives for all h,k,l,m for phase - no twins
     1921    input:
     1922   
     1923    :param dict refDict: where
     1924        'RefList' list where each ref = h,k,l,m,it,d,...
     1925        'FF' dict of form factors - filled in below
     1926    :param int im: = 1 (could be eliminated)
     1927    :param np.array G:      reciprocal metric tensor
     1928    :param str hfx:    histogram id string
     1929    :param str pfx:    phase id string
     1930    :param dict SGData: space group info. dictionary output from SpcGroup
     1931    :param dict SSGData: super space group info.
     1932    :param dict calcControls:
     1933    :param dict ParmDict:
     1934   
     1935    :returns: dict dFdvDict: dictionary of derivatives
     1936    '''
     1937
     1938    trefDict = copy.deepcopy(refDict)
     1939    dM = 1.e-6
    19661940    dFdvDict = {}
    1967     dFdfr = np.zeros((nRef,mSize))
    1968     dFdx = np.zeros((nRef,mSize,3))
    1969     dFdui = np.zeros((nRef,mSize))
    1970     dFdua = np.zeros((nRef,mSize,6))
    1971     dFdbab = np.zeros((nRef,2))
    1972     dFdfl = np.zeros((nRef))
    1973     dFdGf = np.zeros((nRef,mSize,FSSdata.shape[1],2))
    1974     dFdGx = np.zeros((nRef,mSize,XSSdata.shape[1],6))
    1975     dFdGz = np.zeros((nRef,mSize,5))
    1976     dFdGu = np.zeros((nRef,mSize,USSdata.shape[1],12))
    1977     Flack = 1.0
    1978     if not SGData['SGInv'] and 'S' in calcControls[hfx+'histType'] and phfx+'Flack' in parmDict:
    1979         Flack = 1.-2.*parmDict[phfx+'Flack']
    1980     time0 = time.time()
    1981     iBeg = 0
    1982     blkSize = 4       #no. of reflections in a block - optimized for speed
    1983     while iBeg < nRef:
    1984         iFin = min(iBeg+blkSize,nRef)
    1985         refl = refDict['RefList'][iBeg:iFin]    #array(blkSize,nItems)
    1986         H = refl.T[:4]
    1987         HP = H[:3].T+modQ*H.T[:,3:]            #projected hklm to hkl
    1988         SQ = 1./(2.*refl.T[4+im])**2             # or (sin(theta)/lambda)**2
    1989         SQfactor = 8.0*SQ*np.pi**2
    1990         if 'T' in calcControls[hfx+'histType']:
    1991             if 'P' in calcControls[hfx+'histType']:
    1992                 FP,FPP = G2el.BlenResTOF(Tdata,BLtables,refl.T[15])
    1993             else:
    1994                 FP,FPP = G2el.BlenResTOF(Tdata,BLtables,refl.T[13])
    1995             FP = np.repeat(FP.T,len(SGT),axis=0)
    1996             FPP = np.repeat(FPP.T,len(SGT),axis=0)
    1997 #        dBabdA = np.exp(-parmDict[phfx+'BabU']*SQfactor)
    1998         Bab = np.repeat(parmDict[phfx+'BabA']*np.exp(-parmDict[phfx+'BabU']*SQfactor),len(SGT))
    1999         Tindx = np.array([refDict['FF']['El'].index(El) for El in Tdata])
    2000         FF = np.repeat(refDict['FF']['FF'][iBeg:iFin].T[Tindx].T,len(SGT),axis=0)
    2001         Uniq = np.inner(H.T,SSGMT)
    2002         Phi = np.inner(H.T,SSGT)
    2003         UniqP = np.inner(HP,SGMT)
    2004         if SGInv:   #if centro - expand HKL sets
    2005             Uniq = np.hstack((Uniq,-Uniq))
    2006             Phi = np.hstack((Phi,-Phi))
    2007             UniqP = np.hstack((UniqP,-UniqP))
    2008             FF = np.vstack((FF,FF))
    2009             Bab = np.concatenate((Bab,Bab))
    2010         phase = twopi*(np.inner(Uniq[:,:,:3],(dXdata+Xdata).T)+Phi[:,:,nxs])
    2011         sinp = np.sin(phase)
    2012         cosp = np.cos(phase)
    2013         occ = Mdata*Fdata/Uniq.shape[1]
    2014         biso = -SQfactor*Uisodata[:,nxs]
    2015         Tiso = np.repeat(np.where(biso<1.,np.exp(biso),1.0),Uniq.shape[1],axis=1).T    #ops x atoms
    2016         HbH = -np.sum(UniqP[:,:,nxs,:3]*np.inner(UniqP[:,:,:3],bij),axis=-1)  #ops x atoms
    2017         Hij = np.array([Mast*np.multiply.outer(U[:3],U[:3]) for U in np.reshape(UniqP,(-1,3))]) #atoms x 3x3
    2018         Hij = np.reshape(np.array([G2lat.UijtoU6(uij) for uij in Hij]),(iFin-iBeg,-1,6))                     #atoms x 6
    2019         Tuij = np.where(HbH<1.,np.exp(HbH),1.0)     #ops x atoms
    2020 #        GSASIIpath.IPyBreak()
    2021         Tcorr = np.reshape(Tiso,Tuij.shape)*Tuij*Mdata*Fdata/Uniq.shape[0]  #ops x atoms
    2022         fot = np.reshape(FF+FP[nxs,:]-Bab[:,nxs],cosp.shape)*Tcorr     #ops x atoms
    2023         fotp = FPP*Tcorr            #ops x atoms
    2024         GfpuA = G2mth.Modulation(Uniq,UniqP,nWaves,Fmod,Xmod,Umod,Mmod,glTau,glWt) #2 x sym X atoms
    2025         dGdf,dGdx,dGdu,dGdz = G2mth.ModulationDerv2(Uniq,UniqP,Hij,nWaves,waveShapes,Fmod,Xmod,UmodAB,SCtauF,SCtauX,SCtauU,glTau,glWt)
    2026         # GfpuA is 2 x ops x atoms
    2027         # derivs are: ops x atoms x waves x 2,6,12, or 5 parms as [real,imag] parts
    2028         fa = np.array([fot*cosp,-Flack*FPP*sinp*Tcorr]) # array(2,nEqv,nAtoms)
    2029         fb = np.array([fot*sinp,Flack*FPP*cosp*Tcorr])  #or array(2,nEqv,nAtoms)
    2030         fag = fa*GfpuA[0]-fb*GfpuA[1]
    2031         fbg = fb*GfpuA[0]+fa*GfpuA[1]
    2032        
    2033         fas = np.sum(np.sum(fag,axis=-1),axis=-1)     # 2 x refBlk
    2034         fbs = np.sum(np.sum(fbg,axis=-1),axis=-1)
    2035         fax = np.array([-fot*sinp,-fotp*cosp])   #positions; 2 x ops x atoms
    2036         fbx = np.array([fot*cosp,-fotp*sinp])
    2037         fax = fax*GfpuA[0]-fbx*GfpuA[1]
    2038         fbx = fbx*GfpuA[0]+fax*GfpuA[1]
    2039         #sum below is over Uniq
    2040         dfadfr = np.sum(fag/occ,axis=-2)        #Fdata != 0 ever avoids /0. problem
    2041         dfbdfr = np.sum(fbg/occ,axis=-2)        #Fdata != 0 avoids /0. problem
    2042 #        dfadba = np.sum(-cosp*Tcorr,axis=-2)
    2043 #        dfbdba = np.sum(-sinp*Tcorr,axis=-2)
    2044         dfadui = np.sum(-SQfactor[nxs,:,nxs,nxs]*fag,axis=-2)
    2045         dfbdui = np.sum(-SQfactor[nxs,:,nxs,nxs]*fbg,axis=-2)
    2046         dfadx = np.sum(twopi*Uniq[nxs,:,:,nxs,:3]*fax[:,:,:,:,nxs],axis=-3)  #2 refBlk x x nAtom x 3xyz; sum nOps
    2047         dfbdx = np.sum(twopi*Uniq[nxs,:,:,nxs,:3]*fbx[:,:,:,:,nxs],axis=-3)  #2 refBlk x x nAtom x 3xyz; sum nOps
    2048         dfadua = np.sum(-Hij[nxs,:,:,nxs,:]*fag[:,:,:,:,nxs],axis=-3)             #2 x nAtom x 6Uij; sum nOps
    2049         dfbdua = np.sum(-Hij[nxs,:,:,nxs,:]*fbg[:,:,:,:,nxs],axis=-3)             #2 x nAtom x 6Uij; sum nOps
    2050         # array(2,nAtom,nWave,2) & array(2,nAtom,nWave,6) & array(2,nAtom,nWave,12); sum on nOps
    2051         dfadGf = np.sum(fa[:,:,:,:,nxs,nxs]*dGdf[0][nxs,:,nxs,:,:,:]-fb[:,:,:,:,nxs,nxs]*dGdf[1][nxs,:,nxs,:,:,:],axis=2)
    2052         dfbdGf = np.sum(fb[:,:,:,:,nxs,nxs]*dGdf[0][nxs,:,nxs,:,:,:]+fa[:,:,:,:,nxs,nxs]*dGdf[1][nxs,:,nxs,:,:,:],axis=2)
    2053         dfadGx = np.sum(fa[:,:,:,:,nxs,nxs]*dGdx[0][nxs,:,:,:,:,:]-fb[:,:,:,:,nxs,nxs]*dGdx[1][nxs,:,:,:,:,:],axis=2)
    2054         dfbdGx = np.sum(fb[:,:,:,:,nxs,nxs]*dGdx[0][nxs,:,:,:,:,:]+fa[:,:,:,:,nxs,nxs]*dGdx[1][nxs,:,:,:,:,:],axis=2)
    2055         dfadGz = np.sum(fa[:,:,:,:,nxs]*dGdz[0][nxs,:,:,:,:]-fb[:,:,:,:,nxs]*dGdz[1][nxs,:,:,:,:],axis=2)
    2056         dfbdGz = np.sum(fb[:,:,:,:,nxs]*dGdz[0][nxs,:,:,:,:]+fa[:,:,:,:,nxs]*dGdz[1][nxs,:,:,:,:],axis=2)
    2057         dfadGu = np.sum(fa[:,:,:,:,nxs,nxs]*dGdu[0][nxs,:,:,:,:]-fb[:,:,:,:,nxs,nxs]*dGdu[1][nxs,:,:,:,:],axis=2)
    2058         dfbdGu = np.sum(fb[:,:,:,:,nxs,nxs]*dGdu[0][nxs,:,:,:,:]+fa[:,:,:,:,nxs,nxs]*dGdu[1][nxs,:,:,:,:],axis=2)   
    2059         if not SGData['SGInv']:   #Flack derivative
    2060             dfadfl = np.sum(np.sum(-FPP*Tcorr*sinp,axis=-1),axis=-1)
    2061             dfbdfl = np.sum(np.sum(FPP*Tcorr*cosp,axis=-1),axis=-1)
    2062         else:
    2063             dfadfl = 1.0
    2064             dfbdfl = 1.0
    2065         #NB: the above have been checked against PA(1:10,1:2) in strfctr.for for Al2O3!   
    2066         SA = fas[0]+fas[1]      #float = A+A' (might be array[nTwin])
    2067         SB = fbs[0]+fbs[1]      #float = B+B' (might be array[nTwin])
    2068         if 'P' in calcControls[hfx+'histType']: #checked perfect for centro & noncentro?
    2069             dFdfl[iBeg:iFin] = -SA*dfadfl-SB*dfbdfl                  #array(nRef,)
    2070             dFdfr[iBeg:iFin] = 2.*(fas[0,:,nxs]*dfadfr[0]+fas[1,:,nxs]*dfadfr[1])*Mdata/len(Uniq)+   \
    2071                 2.*(fbs[0,:,nxs]*dfbdfr[0]-fbs[1,:,nxs]*dfbdfr[1])*Mdata/len(Uniq)
    2072             dFdx[iBeg:iFin] = 2.*(fas[0,:,nxs,nxs]*dfadx[0]+fas[1,:,nxs,nxs]*dfadx[1])+  \
    2073                 2.*(fbs[0,:,nxs,nxs]*dfbdx[0]+fbs[1,:,nxs,nxs]*dfbdx[1])
    2074             dFdui[iBeg:iFin] = 2.*(fas[0,:,nxs]*dfadui[0]+fas[1,:,nxs]*dfadui[1])+   \
    2075                 2.*(fbs[0,:,nxs]*dfbdui[0]-fbs[1,:,nxs]*dfbdui[1])
    2076             dFdua[iBeg:iFin] = 2.*(fas[0,:,nxs,nxs]*dfadua[0]+fas[1,:,nxs,nxs]*dfadua[1])+   \
    2077                 2.*(fbs[0,:,nxs,nxs]*dfbdua[0]+fbs[1,:,nxs,nxs]*dfbdua[1])
    2078             dFdGf[iBeg:iFin] = 2.*(fas[0,:,nxs,nxs,nxs]*dfadGf[0]+fas[1,:,nxs,nxs,nxs]*dfadGf[1])+  \
    2079                 2.*(fbs[0,:,nxs,nxs,nxs]*dfbdGf[0]+fbs[1,:,nxs,nxs,nxs]*dfbdGf[1])
    2080             dFdGx[iBeg:iFin] = 2.*(fas[0,:,nxs,nxs,nxs]*dfadGx[0]+fas[1,:,nxs,nxs,nxs]*dfadGx[1])+  \
    2081                 2.*(fbs[0,:,nxs,nxs,nxs]*dfbdGx[0]-fbs[1,:,nxs,nxs,nxs]*dfbdGx[1])
    2082             dFdGz[iBeg:iFin] = 2.*(fas[0,:,nxs,nxs]*dfadGz[0]+fas[1,:,nxs,nxs]*dfadGz[1])+  \
    2083                 2.*(fbs[0,:,nxs,nxs]*dfbdGz[0]+fbs[1,:,nxs,nxs]*dfbdGz[1])
    2084             dFdGu[iBeg:iFin] = 2.*(fas[0,:,nxs,nxs,nxs]*dfadGu[0]+fas[1,:,nxs,nxs,nxs]*dfadGu[1])+  \
    2085                 2.*(fbs[0,:,nxs,nxs,nxs]*dfbdGu[0]+fbs[1,:,nxs,nxs,nxs]*dfbdGu[1])
    2086         else:                       #OK, I think
    2087             dFdfr[iBeg:iFin] = 2.*(SA[:,nxs]*(dfadfr[0]+dfadfr[1])+SB[:,nxs]*(dfbdfr[0]+dfbdfr[1]))*Mdata/len(Uniq) #array(nRef,nAtom)
    2088             dFdx[iBeg:iFin] = 2.*(SA[:,nxs,nxs]*(dfadx[0]+dfadx[1])+SB[:,nxs,nxs]*(dfbdx[0]+dfbdx[1]))    #array(nRef,nAtom,3)
    2089             dFdui[iBeg:iFin] = 2.*(SA[:,nxs]*(dfadui[0]+dfadui[1])+SB[:,nxs]*(dfbdui[0]+dfbdui[1]))   #array(nRef,nAtom)
    2090             dFdua[iBeg:iFin] = 2.*(SA[:,nxs,nxs]*(dfadua[0]+dfadua[1])+SB[:,nxs,nxs]*(dfbdua[0]+dfbdua[1]))    #array(nRef,nAtom,6)
    2091             dFdfl[iBeg:iFin] = -SA*dfadfl-SB*dfbdfl                  #array(nRef,)
    2092                            
    2093             dFdGf[iBeg:iFin] = 2.*(SA[:,nxs,nxs,nxs]*dfadGf[0]+SB[:,nxs,nxs,nxs]*dfbdGf[1])      #array(nRef,natom,nwave,2)
    2094             dFdGx[iBeg:iFin] = 2.*(SA[:,nxs,nxs,nxs]*dfadGx[0]+SB[:,nxs,nxs,nxs]*dfbdGx[1])      #array(nRef,natom,nwave,6)
    2095             dFdGz[iBeg:iFin] = 2.*(SA[:,nxs,nxs]*dfadGz[0]+SB[:,nxs,nxs]*dfbdGz[1])      #array(nRef,natom,5)
    2096             dFdGu[iBeg:iFin] = 2.*(SA[:,nxs,nxs,nxs]*dfadGu[0]+SB[:,nxs,nxs,nxs]*dfbdGu[1])      #array(nRef,natom,nwave,12)
    2097 #            GSASIIpath.IPyBreak()
    2098 #        dFdbab[iBeg:iFin] = 2.*fas[0,:,nxs]*np.array([np.sum(dfadba*dBabdA),np.sum(-dfadba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T+ \
    2099 #            2.*fbs[0,:,nxs]*np.array([np.sum(dfbdba*dBabdA),np.sum(-dfbdba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T
    2100         #loop over atoms - each dict entry is list of derivatives for all the reflections
    2101         print (' %d derivative time %.4f\r'%(iBeg,time.time()-time0),end='')
    2102         iBeg += blkSize
    2103     for i in range(len(Mdata)):     #loop over atoms
    2104         dFdvDict[pfx+'Afrac:'+str(i)] = dFdfr.T[i]
    2105         dFdvDict[pfx+'dAx:'+str(i)] = dFdx.T[0][i]
    2106         dFdvDict[pfx+'dAy:'+str(i)] = dFdx.T[1][i]
    2107         dFdvDict[pfx+'dAz:'+str(i)] = dFdx.T[2][i]
    2108         dFdvDict[pfx+'AUiso:'+str(i)] = dFdui.T[i]
    2109         dFdvDict[pfx+'AU11:'+str(i)] = dFdua.T[0][i]
    2110         dFdvDict[pfx+'AU22:'+str(i)] = dFdua.T[1][i]
    2111         dFdvDict[pfx+'AU33:'+str(i)] = dFdua.T[2][i]
    2112         dFdvDict[pfx+'AU12:'+str(i)] = 2.*dFdua.T[3][i]
    2113         dFdvDict[pfx+'AU13:'+str(i)] = 2.*dFdua.T[4][i]
    2114         dFdvDict[pfx+'AU23:'+str(i)] = 2.*dFdua.T[5][i]
    2115         for j in range(FSSdata.shape[1]):        #loop over waves Fzero & Fwid?
    2116             dFdvDict[pfx+'Fsin:'+str(i)+':'+str(j)] = dFdGf.T[0][j][i]
    2117             dFdvDict[pfx+'Fcos:'+str(i)+':'+str(j)] = dFdGf.T[1][j][i]
    2118         nx = 0
    2119         if waveTypes[i] in ['Block','ZigZag']:
    2120             nx = 1
    2121             dFdvDict[pfx+'Tmin:'+str(i)+':0'] = dFdGz.T[0][i]   #ZigZag/Block waves (if any)
    2122             dFdvDict[pfx+'Tmax:'+str(i)+':0'] = dFdGz.T[1][i]
    2123             dFdvDict[pfx+'Xmax:'+str(i)+':0'] = dFdGz.T[2][i]
    2124             dFdvDict[pfx+'Ymax:'+str(i)+':0'] = dFdGz.T[3][i]
    2125             dFdvDict[pfx+'Zmax:'+str(i)+':0'] = dFdGz.T[4][i]
    2126         for j in range(XSSdata.shape[1]-nx):       #loop over waves
    2127             dFdvDict[pfx+'Xsin:'+str(i)+':'+str(j+nx)] = dFdGx.T[0][j][i]
    2128             dFdvDict[pfx+'Ysin:'+str(i)+':'+str(j+nx)] = dFdGx.T[1][j][i]
    2129             dFdvDict[pfx+'Zsin:'+str(i)+':'+str(j+nx)] = dFdGx.T[2][j][i]
    2130             dFdvDict[pfx+'Xcos:'+str(i)+':'+str(j+nx)] = dFdGx.T[3][j][i]
    2131             dFdvDict[pfx+'Ycos:'+str(i)+':'+str(j+nx)] = dFdGx.T[4][j][i]
    2132             dFdvDict[pfx+'Zcos:'+str(i)+':'+str(j+nx)] = dFdGx.T[5][j][i]
    2133         for j in range(USSdata.shape[1]):       #loop over waves
    2134             dFdvDict[pfx+'U11sin:'+str(i)+':'+str(j)] = dFdGu.T[0][j][i]
    2135             dFdvDict[pfx+'U22sin:'+str(i)+':'+str(j)] = dFdGu.T[1][j][i]
    2136             dFdvDict[pfx+'U33sin:'+str(i)+':'+str(j)] = dFdGu.T[2][j][i]
    2137             dFdvDict[pfx+'U12sin:'+str(i)+':'+str(j)] = 2.*dFdGu.T[3][j][i]
    2138             dFdvDict[pfx+'U13sin:'+str(i)+':'+str(j)] = 2.*dFdGu.T[4][j][i]
    2139             dFdvDict[pfx+'U23sin:'+str(i)+':'+str(j)] = 2.*dFdGu.T[5][j][i]
    2140             dFdvDict[pfx+'U11cos:'+str(i)+':'+str(j)] = dFdGu.T[6][j][i]
    2141             dFdvDict[pfx+'U22cos:'+str(i)+':'+str(j)] = dFdGu.T[7][j][i]
    2142             dFdvDict[pfx+'U33cos:'+str(i)+':'+str(j)] = dFdGu.T[8][j][i]
    2143             dFdvDict[pfx+'U12cos:'+str(i)+':'+str(j)] = 2.*dFdGu.T[9][j][i]
    2144             dFdvDict[pfx+'U13cos:'+str(i)+':'+str(j)] = 2.*dFdGu.T[10][j][i]
    2145             dFdvDict[pfx+'U23cos:'+str(i)+':'+str(j)] = 2.*dFdGu.T[11][j][i]
    2146            
    2147 #        GSASIIpath.IPyBreak()
    2148     dFdvDict[phfx+'BabA'] = dFdbab.T[0]
    2149     dFdvDict[phfx+'BabU'] = dFdbab.T[1]
     1941    for parm in parmDict:
     1942        if parm.split(':')[2] in ['Tmin','Tmax','Xmax','Ymax','Zmax','Fzero','Fwid',]:
     1943            parmDict[parm] += dM
     1944            prefList = SStructureFactor(trefDict,G,hfx,pfx,SGData,SSGData,calcControls,parmDict)
     1945            parmDict[parm] -= 2*dM
     1946            mrefList = SStructureFactor(trefDict,G,hfx,pfx,SGData,SSGData,calcControls,parmDict)
     1947            parmDict[parm] += dM
     1948            dFdvDict[parm] = (prefList[:,9]-mrefList[:,9])/(2.*dM)
    21501949    return dFdvDict
    21511950   
     
    35103309            if im:
    35113310                dFdvDict = SStructureFactorDerv(refDict,im,G,hfx,pfx,SGData,SSGData,calcControls,parmDict)
     3311                dFdvDict.update(SStructureFactorDerv2(refDict,im,G,hfx,pfx,SGData,SSGData,calcControls,parmDict))
    35123312            else:
    35133313                if Phase['General']['Type'] == 'magnetic':
     
    37823582    if im: # split to nontwin/twin versions
    37833583        if len(TwinLaw) > 1:
    3784             dFdvDict = SStructureFactorDervTw(refDict,im,G,hfx,pfx,SGData,SSGData,calcControls,parmDict)    #?
     3584            dFdvDict = SStructureFactorDervTw(refDict,im,G,hfx,pfx,SGData,SSGData,calcControls,parmDict)    #not ok
    37853585        else:
    37863586            dFdvDict = SStructureFactorDerv(refDict,im,G,hfx,pfx,SGData,SSGData,calcControls,parmDict)  #OK
     3587            dFdvDict.update(SStructureFactorDerv2(refDict,im,G,hfx,pfx,SGData,SSGData,calcControls,parmDict))
    37873588    else:
    37883589        if len(TwinLaw) > 1:
  • trunk/config_example.py

    r3712 r3759  
    168168''' Specifices time in sec for one modulation loop; larger number will give more frames for same fps'
    169169'''
     170fullIntegrate = True
     171''' If True then full image integration is default; False otherwise
     172'''
    170173
    171174Multiprocessing_cores = 0
Note: See TracChangeset for help on using the changeset viewer.