Changeset 3764


Ignore:
Timestamp:
Dec 14, 2018 12:05:45 PM (4 years ago)
Author:
vondreele
Message:

fixes to nonFourier modulation & derivatives - zigzag works

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMain.py

    r3748 r3764  
    278278
    279279#for testing purposes!!!
    280     if DEBUG and IfOK:
     280    if DEBUG:   # and IfOK:
    281281#needs: values,HistoPhases,parmDict,varylist,calcControls,pawleyLookup
    282282        fl = open(ospath.splitext(GPXfile)[0]+'.testDeriv','wb')
  • trunk/GSASIIstrMath.py

    r3759 r3764  
    638638        'MXsin:':MSSdata[0],'MYsin:':MSSdata[1],'MZsin:':MSSdata[2],'MXcos:':MSSdata[3],'MYcos:':MSSdata[4],'MZcos:':MSSdata[5]}
    639639    for iatm in range(Natoms):
    640         for kind in ['F','P','A','M']:
    641             wavetype = []
    642             wavetype += [parmDict.get(pfx+kind+'waveType:'+str(iatm),''),]
    643             waveTypes.append(wavetype)
     640        wavetype = [parmDict.get(pfx+kind+'waveType:'+str(iatm),'') for kind in ['F','P','A','M']]
     641        waveTypes.append(wavetype)
    644642        for key in keys:
    645643            for m in range(Nwave[key[0]]):
     
    647645                if parm in parmDict:
    648646                    keys[key][m][iatm] = parmDict[parm]
    649     return np.array(waveTypes),FSSdata,XSSdata,USSdata,MSSdata
     647    return waveTypes,FSSdata,XSSdata,USSdata,MSSdata
    650648   
    651649def StructureFactor2(refDict,G,hfx,pfx,SGData,calcControls,parmDict):
     
    16961694        refl.T[11] = atan2d(fbs[0].T[0],fas[0].T[0])  #ignore f' & f"
    16971695        iBeg += blkSize
    1698     print ('nRef %d time %.4f\r'%(nRef,time.time()-time0))
     1696#    print ('nRef %d time %.4f\r'%(nRef,time.time()-time0))
    16991697
    17001698def SStructureFactorDerv(refDict,im,G,hfx,pfx,SGData,SSGData,calcControls,parmDict):
     
    19371935
    19381936    trefDict = copy.deepcopy(refDict)
    1939     dM = 1.e-6
     1937    dM = 1.e-4
    19401938    dFdvDict = {}
    19411939    for parm in parmDict:
     1940        if parm == '0':
     1941            continue
    19421942        if parm.split(':')[2] in ['Tmin','Tmax','Xmax','Ymax','Zmax','Fzero','Fwid',]:
    19431943            parmDict[parm] += dM
     
    19461946            mrefList = SStructureFactor(trefDict,G,hfx,pfx,SGData,SSGData,calcControls,parmDict)
    19471947            parmDict[parm] += dM
    1948             dFdvDict[parm] = (prefList[:,9]-mrefList[:,9])/(2.*dM)
     1948            dFdvDict[parm] = (prefList[:,9+im]-mrefList[:,9+im])/(2.*dM)
    19491949    return dFdvDict
    19501950   
Note: See TracChangeset for help on using the changeset viewer.