Changeset 1895


Ignore:
Timestamp:
Jun 17, 2015 1:28:30 PM (7 years ago)
Author:
vondreele
Message:

fixes to background & twin stuff

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r1894 r1895  
    792792
    793793    def OnBkgFit(event):
    794 #        def SetInstParms(Inst):
    795 #            dataType = Inst['Type'][0]
    796 #            insVary = []
    797 #            insNames = []
    798 #            insVals = []
    799 #            for parm in Inst:
    800 #                insNames.append(parm)
    801 #                insVals.append(Inst[parm][1])
    802 #                if parm in ['U','V','W','X','Y','SH/L','I(L2)/I(L1)','alpha',
    803 #                    'beta-0','beta-1','beta-q','sig-0','sig-1','sig-2','sig-q',] and Inst[parm][2]:
    804 #                        insVary.append(parm)
    805 #            instDict = dict(zip(insNames,insVals))
    806 #            instDict['X'] = max(instDict['X'],0.01)
    807 #            instDict['Y'] = max(instDict['Y'],0.01)
    808 #            if 'SH/L' in instDict:
    809 #                instDict['SH/L'] = max(instDict['SH/L'],0.002)
    810 #            return dataType,instDict,insVary
     794        def SetInstParms(Inst):
     795            dataType = Inst['Type'][0]
     796            insVary = []
     797            insNames = []
     798            insVals = []
     799            for parm in Inst:
     800                insNames.append(parm)
     801                insVals.append(Inst[parm][1])
     802                if parm in ['U','V','W','X','Y','SH/L','I(L2)/I(L1)','alpha',
     803                    'beta-0','beta-1','beta-q','sig-0','sig-1','sig-2','sig-q',] and Inst[parm][2]:
     804                        insVary.append(parm)
     805            instDict = dict(zip(insNames,insVals))
     806            instDict['X'] = max(instDict['X'],0.01)
     807            instDict['Y'] = max(instDict['Y'],0.01)
     808            if 'SH/L' in instDict:
     809                instDict['SH/L'] = max(instDict['SH/L'],0.002)
     810            return dataType,instDict,insVary
    811811   
    812812        PatternId = G2frame.PatternId       
     
    836836
    837837        # load instrument and background params
    838 #        dataType,insDict,insVary = SetInstParms(inst)
     838        dataType,insDict,insVary = SetInstParms(inst)
    839839        bakType,bakDict,bakVary = G2pwd.SetBackgroundParms(background)
    840840        # how many background parameters are refined?
  • trunk/GSASIIstrMath.py

    r1894 r1895  
    822822        TwinLaw = calcControls[phfx+'TwinLaw']
    823823        TwinFr = np.array([parmDict[phfx+'TwinFr:'+str(i)] for i in range(len(TwinLaw))])
    824         if len(TwinLaw) > 1:
    825             TwinFr[0] = 1.-np.sum(TwinFr[1:])       
    826824    Tdata,Mdata,Fdata,Xdata,dXdata,IAdata,Uisodata,Uijdata = GetAtomFXU(pfx,calcControls,parmDict)
    827825    FF = np.zeros(len(Tdata))
     
    917915        TwinLaw = calcControls[phfx+'TwinLaw']
    918916        TwinFr = np.array([parmDict[phfx+'TwinFr:'+str(i)] for i in range(len(TwinLaw))])
    919         if len(TwinLaw) > 1:
    920             TwinFr[0] = 1.-np.sum(TwinFr[1:])
    921917    nTwin = len(TwinLaw)       
    922918    nRef = len(refDict['RefList'])
Note: See TracChangeset for help on using the changeset viewer.