Changeset 1491


Ignore:
Timestamp:
Sep 10, 2014 9:13:42 AM (7 years ago)
Author:
vondreele
Message:

DEBUG = False & remove stray print
TOF single xtal extinction & derivatives now appear to be right.
removed "dervCor" from SCExtinction; came from old GSAS & isn't needed in G2

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMain.py

    r1489 r1491  
    4242   
    4343ateln2 = 8.0*math.log(2.0)
    44 DEBUG = True
     44DEBUG = False
    4545
    4646def RefineCore(Controls,Histograms,Phases,restraintDict,rigidbodyDict,parmDict,varyList,
  • trunk/GSASIIstrMath.py

    r1490 r1491  
    802802    '''
    803803    extCor = 1.0
    804     dervCor = 1.0
    805804    dervDict = {}
    806805    if calcControls[phfx+'EType'] != 'None':
     
    860859            PF3 = 0.5*(CL+2.*AL*PF/(1.+BL*PF)-AL*PF**2*BL/(1.+BL*PF)**2)/(PF4*extCor)
    861860
    862         dervCor = (1.+PF)*PF3   #extinction corr for other derivatives
    863861        if 'Primary' in calcControls[phfx+'EType'] and phfx+'Ep' in varyList:
    864862            dervDict[phfx+'Ep'] = -ref[7]*PLZ*PF3
     
    868866            dervDict[phfx+'Eg'] = -ref[7]*PLZ*PF3*(PSIG/parmDict[phfx+'Eg'])**3*PL**2
    869867               
    870     return 1./extCor,dervCor,dervDict
     868    return 1./extCor,dervDict
    871869   
    872870def Dict2Values(parmdict, varylist):
     
    20032001        for iref,ref in enumerate(refDict['RefList']):
    20042002            if ref[6] > 0:
    2005                 dervCor,dervDict = SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist)[1:]
     2003                dervDict = SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist)[1]
    20062004                w = 1.0/ref[6]
    20072005                if w*ref[5] >= calcControls['minF/sig']:
     
    20092007                    for j,var in enumerate(varylist):
    20102008                        if var in dFdvDict:
    2011                             dMdvh[j][iref] = w*dFdvDict[var][iref]*parmDict[phfx+'Scale']*ref[11]   #*dervCor
     2009                            dMdvh[j][iref] = w*dFdvDict[var][iref]*parmDict[phfx+'Scale']*ref[11]
    20122010                    for var in dependentVars:
    20132011                        if var in dFdvDict:
    2014                             depDerivDict[var][iref] = w*dFdvDict[var][iref]*parmDict[phfx+'Scale']*ref[11]  #*dervCor
     2012                            depDerivDict[var][iref] = w*dFdvDict[var][iref]*parmDict[phfx+'Scale']*ref[11]
    20152013                    if phfx+'Scale' in varylist:
    2016                         dMdvh[varylist.index(phfx+'Scale')][iref] = w*ref[9]*ref[11]  #OK? *dervCor
     2014                        dMdvh[varylist.index(phfx+'Scale')][iref] = w*ref[9]*ref[11]
    20172015                    elif phfx+'Scale' in dependentVars:
    2018                         depDerivDict[phfx+'Scale'][iref] = w*ref[9]*ref[11]  #OK? *dervCor
     2016                        depDerivDict[phfx+'Scale'][iref] = w*ref[9]*ref[11]
    20192017                    for item in ['Ep','Es','Eg']:
    20202018                        if phfx+item in varylist and dervDict:
    2021                             dMdvh[varylist.index(phfx+item)][iref] = w*dervDict[phfx+item]/ref[11]  #OK? /dervCor
     2019                            dMdvh[varylist.index(phfx+item)][iref] = w*dervDict[phfx+item]/ref[11]  #OK
    20222020                        elif phfx+item in dependentVars and dervDict:
    2023                             depDerivDict[phfx+item][iref] = w*dervDict[phfx+item]/ref[11]  #OK? /dervCor
     2021                            depDerivDict[phfx+item][iref] = w*dervDict[phfx+item]/ref[11]  #OK
    20242022                    for item in ['BabA','BabU']:
    20252023                        if phfx+item in varylist:
    2026                             dMdvh[varylist.index(phfx+item)][iref] = w*dFdvDict[pfx+item][iref]*parmDict[phfx+'Scale']*dervCor
     2024                            dMdvh[varylist.index(phfx+item)][iref] = w*dFdvDict[pfx+item][iref]*parmDict[phfx+'Scale']*ref[11]
    20272025                        elif phfx+item in dependentVars:
    2028                             depDerivDict[phfx+item][iref] = w*dFdvDict[pfx+item][iref]*parmDict[phfx+'Scale']*dervCor
     2026                            depDerivDict[phfx+item][iref] = w*dFdvDict[pfx+item][iref]*parmDict[phfx+'Scale']*ref[11]
    20292027    else:
    20302028        for iref,ref in enumerate(refDict['RefList']):
    20312029            if ref[5] > 0.:
    2032                 dervCor,dervDict = SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist)[1:]
     2030                dervDict = SCExtinction(ref,phfx,hfx,pfx,calcControls,parmDict,varylist)[1]
    20332031                Fo = np.sqrt(ref[5])
    20342032                Fc = np.sqrt(ref[7])
     
    20382036                    for j,var in enumerate(varylist):
    20392037                        if var in dFdvDict:
    2040                             dMdvh[j][iref] = w*dFdvDict[var][iref]*parmDict[phfx+'Scale']*dervCor       #*ref[11]
     2038                            dMdvh[j][iref] = w*dFdvDict[var][iref]*parmDict[phfx+'Scale']*ref[11]
    20412039                    for var in dependentVars:
    20422040                        if var in dFdvDict:
    2043                             depDerivDict[var][iref] = w*dFdvDict[var][iref]*parmDict[phfx+'Scale']*dervCor      #*ref[11]
     2041                            depDerivDict[var][iref] = w*dFdvDict[var][iref]*parmDict[phfx+'Scale']*ref[11]
    20442042                    if phfx+'Scale' in varylist:
    2045                         dMdvh[varylist.index(phfx+'Scale')][iref] = w*ref[9]*ref[11]    #*dervCor
     2043                        dMdvh[varylist.index(phfx+'Scale')][iref] = w*ref[9]*ref[11]
    20462044                    elif phfx+'Scale' in dependentVars:
    2047                         depDerivDict[phfx+'Scale'][iref] = w*ref[9]*ref[11] #*dervCor                          
     2045                        depDerivDict[phfx+'Scale'][iref] = w*ref[9]*ref[11]                          
    20482046                    for item in ['Ep','Es','Eg']:
    20492047                        if phfx+item in varylist and dervDict:
     
    20532051                    for item in ['BabA','BabU']:
    20542052                        if phfx+item in varylist:
    2055                             dMdvh[varylist.index(phfx+item)][iref] = w*dFdvDict[pfx+item][iref]*parmDict[phfx+'Scale']*dervCor
     2053                            dMdvh[varylist.index(phfx+item)][iref] = w*dFdvDict[pfx+item][iref]*parmDict[phfx+'Scale']*ref[11]
    20562054                        elif phfx+item in dependentVars:
    2057                             depDerivDict[phfx+item][iref] = w*dFdvDict[pfx+item][iref]*parmDict[phfx+'Scale']*dervCor
     2055                            depDerivDict[phfx+item][iref] = w*dFdvDict[pfx+item][iref]*parmDict[phfx+'Scale']*ref[11]
    20582056    return dMdvh,depDerivDict,wdf
    20592057   
Note: See TracChangeset for help on using the changeset viewer.