Changeset 1894 for trunk/GSASIIpwdGUI.py


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

Twins & Flack parameter can't exist together - make each exclusive
rename TwinFr?;n as TwinFr:n so constraint will work
Add a "Clear" option for fixed background points
Prevent Add, Move, Del ops. for fixed points when toolbar active

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r1893 r1894  
    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?
     
    865865        # show the updated background values
    866866        wx.CallLater(100,UpdateBackground,G2frame,data)
     867       
     868    def OnBkgClear(event):
     869        if 'FixedPoints' not in data[1]:
     870            return
     871        else:
     872            del data[1]['FixedPoints']
     873            G2plt.PlotPatterns(G2frame,plotType='PWDR')
    867874   
    868875    def OnPeaksMove(event):
     
    10691076    G2frame.Bind(wx.EVT_MENU,OnPeaksMove,id=G2gd.wxID_PEAKSMOVE)
    10701077    G2frame.Bind(wx.EVT_MENU,OnBkgFit,id=G2frame.dataFrame.wxID_BackPts['Fit'])
     1078    G2frame.Bind(wx.EVT_MENU,OnBkgClear,id=G2frame.dataFrame.wxID_BackPts['Clear'])   
    10711079    BackId = G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId, 'Background')
    10721080    Choices = ['chebyschev','cosine','Q^2 power series','Q^-2 powder series','lin interpolate','inv interpolate','log interpolate']
Note: See TracChangeset for help on using the changeset viewer.