Changeset 1897


Ignore:
Timestamp:
Jun 19, 2015 9:08:32 AM (8 years ago)
Author:
vondreele
Message:

fix unused histogram bug in G2strIO, uncomment dFdbab lines (they work) in G2strMath
fix copy flags for twins

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r1885 r1897  
    38963896        copyDict = {}
    38973897        if 'HKLF' in sourceDict['Histogram']:
    3898             copyNames = ['Scale','Extinction','Babinet','Flack']
     3898            copyNames = ['Scale','Extinction','Babinet','Flack','Twins']
    38993899        else:  #PWDR 
    3900             copyNames = ['Scale','Pref.Ori.','Size','Mustrain','HStrain','Extinction','Babinet','Twins']
     3900            copyNames = ['Scale','Pref.Ori.','Size','Mustrain','HStrain','Extinction','Babinet']
    39013901        babNames = ['BabA','BabU']
    39023902        for name in copyNames:
     
    39073907                        copyDict[name][item] = sourceDict[name][2][item][1]
    39083908                elif name == 'Twins':
    3909                     for it,twin in enumerate(sourceDict['Twins']):
    3910                         copyDict[name][it] = twin[1][1]
     3909                    copyDict[name] = sourceDict[name][0][1][1]
    39113910                else:
    39123911                    copyDict[name] = sourceDict[name][1]
     
    39423941                                        UseList[item][name][2][itm][1] = copy.deepcopy(copyDict[name][itm])
    39433942                                elif name == 'Twins':
    3944                                     for it,twin in enumerate(sourceDict['Twins']):
    3945                                         UseList[item]['Twins'][it][1][1] = copyDict['Twins'][it]
     3943                                    UseList[item]['Twins'][0][1][1] = copyDict['Twins']
    39463944                                else:
    39473945                                    UseList[item][name][1] = copy.deepcopy(copyDict[name])
  • trunk/GSASIIstrIO.py

    r1896 r1897  
    208208        pId = Phases[Phase]['pId']
    209209        for Histogram in Phases[Phase]['Histograms']:
    210             hId = Histograms[Histogram]['hId']
    211             phfx = '%d:%d:'%(pId,hId)
    212             if phfx+'TwinFr:0' in hapVary:
    213                 TwFixed.append('1.0')     #constraint value
    214                 nTwin = len(Phases[Phase]['Histograms'][Histogram]['Twins'])
    215                 TwConstr.append({phfx+'TwinFr:'+str(i):'1.0' for i in range(nTwin)})
     210            try:
     211                hId = Histograms[Histogram]['hId']
     212                phfx = '%d:%d:'%(pId,hId)
     213                if phfx+'TwinFr:0' in hapVary:
     214                    TwFixed.append('1.0')     #constraint value
     215                    nTwin = len(Phases[Phase]['Histograms'][Histogram]['Twins'])
     216                    TwConstr.append({phfx+'TwinFr:'+str(i):'1.0' for i in range(nTwin)})
     217            except KeyError:    #unused histograms?
     218                pass
    216219    return TwConstr,TwFixed   
    217220   
  • trunk/GSASIIstrMath.py

    r1896 r1897  
    10271027                dFdua[iref] = 2.*SA*(dfadua[0]+dfbdua[1])+2.*SB*(dfbdua[0]+dfadua[1])
    10281028                dFdfl[iref] = -SA*dfadfl-SB*dfbdfl
    1029 #        dFdbab[iref] = 2.*fas[0]*np.array([np.sum(dfadba*dBabdA),np.sum(-dfadba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T+ \
    1030 #            2.*fbs[0]*np.array([np.sum(dfbdba*dBabdA),np.sum(-dfbdba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T
     1029        dFdbab[iref] = 2.*fas[0]*np.array([np.sum(dfadba*dBabdA),np.sum(-dfadba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T+ \
     1030            2.*fbs[0]*np.array([np.sum(dfbdba*dBabdA),np.sum(-dfbdba*parmDict[phfx+'BabA']*SQfactor*dBabdA)]).T
    10311031           
    10321032        #loop over atoms - each dict entry is list of derivatives for all the reflections
Note: See TracChangeset for help on using the changeset viewer.