Changeset 1857


Ignore:
Timestamp:
May 16, 2015 3:20:58 PM (7 years ago)
Author:
vondreele
Message:

worki on derivatives - Fix Uij derivative (i!=j)

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrIO.py

    r1852 r1857  
    25452545                        %(Histogram['Residuals'][pfx+'Rf'],Histogram['Residuals'][pfx+'Rf^2'],Histogram['Residuals'][pfx+'Nref'],
    25462546                        Histogram['Residuals'][pfx+'Nrej'],Histogram['Residuals'][pfx+'Next'])
    2547                     if FFtables != None and 'T' not in Inst['Type'][0]:
     2547                    if FFtables != None and 'N' not in Inst['Type'][0]:
    25482548                        PrintFprime(FFtables,hfx,pFile)
    25492549                    print >>pFile,' HKLF histogram weight factor = ','%.3f'%(Histogram['wtFactor'])
     
    29942994            if Print:
    29952995                print >>pFile,' Instrument type: ',Sample['Type']
    2996                 if FFtables != None and 'T' not in Inst['Type'][0]:
     2996                if FFtables != None and 'N' not in Inst['Type'][0]:
    29972997                    PrintFprime(FFtables,pfx,pFile)
    29982998                PrintSampleParmsSig(Sample,sampSig)
  • trunk/GSASIIstrMath.py

    r1835 r1857  
    975975        dFdvDict[pfx+'AU22:'+str(i)] = dFdua.T[1][i]
    976976        dFdvDict[pfx+'AU33:'+str(i)] = dFdua.T[2][i]
    977         dFdvDict[pfx+'AU12:'+str(i)] = 2.*dFdua.T[3][i]
    978         dFdvDict[pfx+'AU13:'+str(i)] = 2.*dFdua.T[4][i]
    979         dFdvDict[pfx+'AU23:'+str(i)] = 2.*dFdua.T[5][i]
     977        dFdvDict[pfx+'AU12:'+str(i)] = 0.5*dFdua.T[3][i]
     978        dFdvDict[pfx+'AU13:'+str(i)] = 0.5*dFdua.T[4][i]
     979        dFdvDict[pfx+'AU23:'+str(i)] = 0.5*dFdua.T[5][i]
    980980    dFdvDict[pfx+'BabA'] = dFdbab.T[0]
    981981    dFdvDict[pfx+'BabU'] = dFdbab.T[1]
     
    10891089        dFdvDict[pfx+'AU22:'+str(i)] = dFdua.T[1][i]
    10901090        dFdvDict[pfx+'AU33:'+str(i)] = dFdua.T[2][i]
    1091         dFdvDict[pfx+'AU12:'+str(i)] = 2.*dFdua.T[3][i]
    1092         dFdvDict[pfx+'AU13:'+str(i)] = 2.*dFdua.T[4][i]
    1093         dFdvDict[pfx+'AU23:'+str(i)] = 2.*dFdua.T[5][i]
     1091        dFdvDict[pfx+'AU12:'+str(i)] = .5*dFdua.T[3][i]
     1092        dFdvDict[pfx+'AU13:'+str(i)] = .5*dFdua.T[4][i]
     1093        dFdvDict[pfx+'AU23:'+str(i)] = .5*dFdua.T[5][i]
    10941094        #need dFdvDict[pfx+'Xsin:'+str[i]:str(m)], etc for modulations...
    10951095    dFdvDict[pfx+'BabA'] = dFdbab.T[0]
     
    11021102    extCor = 1.0
    11031103    dervDict = {}
     1104    dervCor = 1.0
    11041105    if calcControls[phfx+'EType'] != 'None':
    11051106        SQ = 1/(4.*ref[4+im]**2)
     
    11581159            PF3 = 0.5*(CL+2.*AL*PF/(1.+BL*PF)-AL*PF**2*BL/(1.+BL*PF)**2)/(PF4*extCor)
    11591160
     1161        dervCor = (1.+PF)*PF3   #extinction corr for other derivatives
    11601162        if 'Primary' in calcControls[phfx+'EType'] and phfx+'Ep' in varyList:
    11611163            dervDict[phfx+'Ep'] = -ref[7+im]*PLZ*PF3
     
    11651167            dervDict[phfx+'Eg'] = -ref[7+im]*PLZ*PF3*(PSIG/parmDict[phfx+'Eg'])**3*PL**2
    11661168               
    1167     return 1./extCor,dervDict
     1169    return 1./extCor,dervDict,dervCor
    11681170   
    11691171def Dict2Values(parmdict, varylist):
     
    24432445        for iref,ref in enumerate(refDict['RefList']):
    24442446            if ref[6+im] > 0:
    2445                 dervDict = SCExtinction(ref,im,phfx,hfx,pfx,calcControls,parmDict,varylist+dependentVars)[1]
     2447                dervDict,dervCor = SCExtinction(ref,im,phfx,hfx,pfx,calcControls,parmDict,varylist+dependentVars)[1:]
    24462448                w = 1.0/ref[6+im]
    24472449                if ref[3+im] > 0:
     
    24542456                            depDerivDict[var][iref] = w*dFdvDict[var][iref]*parmDict[phfx+'Scale']*ref[11+im]
    24552457                    if phfx+'Scale' in varylist:
    2456                         dMdvh[varylist.index(phfx+'Scale')][iref] = w*ref[9+im]*ref[11+im]
     2458                        dMdvh[varylist.index(phfx+'Scale')][iref] = w*ref[9+im]*ref[11+im]  #OK
    24572459                    elif phfx+'Scale' in dependentVars:
    2458                         depDerivDict[phfx+'Scale'][iref] = w*ref[9+im]*ref[11+im]
     2460                        depDerivDict[phfx+'Scale'][iref] = w*ref[9+im]*ref[11+im]   #OK
    24592461                    for item in ['Ep','Es','Eg']:
    24602462                        if phfx+item in varylist and phfx+item in dervDict:
     
    24672469                        elif phfx+item in dependentVars:
    24682470                            depDerivDict[phfx+item][iref] = w*dFdvDict[pfx+item][iref]*parmDict[phfx+'Scale']*ref[11+im]
    2469     else:
     2471    else:   #F refinement
    24702472        for iref,ref in enumerate(refDict['RefList']):
    24712473            if ref[5+im] > 0.:
    2472                 dervDict = SCExtinction(ref,im,phfx,hfx,pfx,calcControls,parmDict,varylist+dependentVars)[1]
     2474                dervDict,dervCor = SCExtinction(ref,im,phfx,hfx,pfx,calcControls,parmDict,varylist+dependentVars)[1:]
    24732475                Fo = np.sqrt(ref[5+im])
    24742476                Fc = np.sqrt(ref[7+im])
     
    24882490                    for item in ['Ep','Es','Eg']:
    24892491                        if phfx+item in varylist and phfx+item in dervDict:
    2490                             dMdvh[varylist.index(phfx+item)][iref] = w*dervDict[phfx+item]/ref[11+im]  #correct
     2492                            dMdvh[varylist.index(phfx+item)][iref] = w*dervDict[phfx+item]*dervCor/ref[11+im] 
    24912493                        elif phfx+item in dependentVars and phfx+item in dervDict:
    2492                             depDerivDict[phfx+item][iref] = w*dervDict[phfx+item]/ref[11+im]
     2494                            depDerivDict[phfx+item][iref] = w*dervDict[phfx+item]*dervCor/ref[11+im]
    24932495                    for item in ['BabA','BabU']:
    24942496                        if phfx+item in varylist:
Note: See TracChangeset for help on using the changeset viewer.