Changeset 1172 for trunk/GSASIIphsGUI.py
- Timestamp:
- Dec 17, 2013 4:12:54 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIphsGUI.py
r1161 r1172 3264 3264 keyList = UseList.keys() 3265 3265 TextList = [] 3266 if G2frame.PatternTree.GetCount(): 3267 item, cookie = G2frame.PatternTree.GetFirstChild(G2frame.root) 3268 while item: 3269 name = G2frame.PatternTree.GetItemText(item) 3270 if name not in keyList and 'HKLF' in name: 3271 TextList.append(name) 3272 item, cookie = G2frame.PatternTree.GetNextChild(G2frame.root, cookie) 3273 dlg = wx.MultiChoiceDialog(G2frame, 'Which new data to use?', 'Use data', TextList, wx.CHOICEDLG_STYLE) 3274 try: 3275 if dlg.ShowModal() == wx.ID_OK: 3276 result = dlg.GetSelections() 3277 for i in result: 3278 histoName = TextList[i] 3279 UseList[histoName] = {'Histogram':histoName,'Show':False,'Scale':[1.0,True], 3280 'Babinet':{'BabA':[0.0,False],'BabU':[0.0,False]}, 3281 'Extinction':['Lorentzian','None', 3282 {'Tbar':0.1,'Cos2TM':0.955,'Eg':[1.e-10,False],'Es':[1.e-10,False],'Ep':[1.e-10,False]},]} 3283 wx.BeginBusyCursor() 3284 UpdateHKLFdata(histoName) 3285 wx.EndBusyCursor() 3286 data['Histograms'] = UseList 3287 wx.CallAfter(G2ddG.UpdateDData,G2frame,DData,data) 3288 finally: 3289 dlg.Destroy() 3266 if not G2frame.PatternTree.GetCount(): 3267 return 3268 3269 item, cookie = G2frame.PatternTree.GetFirstChild(G2frame.root) 3270 while item: 3271 name = G2frame.PatternTree.GetItemText(item) 3272 if name not in keyList and 'HKLF' in name: 3273 TextList.append(name) 3274 item, cookie = G2frame.PatternTree.GetNextChild(G2frame.root, cookie) 3275 dlg = wx.MultiChoiceDialog(G2frame, 'Which new data to use?', 'Use data', TextList, wx.CHOICEDLG_STYLE) 3276 try: 3277 if dlg.ShowModal() == wx.ID_OK: 3278 result = dlg.GetSelections() 3279 else: 3280 return 3281 finally: 3282 dlg.Destroy() 3283 3284 # get the histograms used in other phases 3285 phaseRIdList,usedHistograms = G2frame.GetPhaseInfofromTree() 3286 usedHKLFhists = [] # used single-crystal histograms 3287 for p in usedHistograms: 3288 for h in usedHistograms[p]: 3289 if h.startswith('HKLF ') and h not in usedHKLFhists: 3290 usedHKLFhists.append(h) 3291 # check that selected single crystal histograms are not already in use! 3292 for i in result: 3293 used = [TextList[i] for i in result if TextList[i] in usedHKLFhists] 3294 if used: 3295 msg = 'The following single crystal histogram(s) are already in use' 3296 for i in used: 3297 msg += '\n '+str(i) 3298 msg += '\nAre you sure you want to add them to this phase? ' 3299 msg += 'Associating a single crystal dataset to >1 histogram is usually an error, ' 3300 msg += 'so No is suggested here.' 3301 if G2frame.ErrorDialog('Likely error',msg,G2frame,wtype=wx.YES_NO) != wx.ID_YES: return 3302 3303 wx.BeginBusyCursor() 3304 for i in result: 3305 histoName = TextList[i] 3306 UseList[histoName] = {'Histogram':histoName,'Show':False,'Scale':[1.0,True], 3307 'Babinet':{'BabA':[0.0,False],'BabU':[0.0,False]}, 3308 'Extinction':['Lorentzian','None', 3309 {'Tbar':0.1,'Cos2TM':0.955,'Eg':[1.e-10,False],'Es':[1.e-10,False],'Ep':[1.e-10,False]},]} 3310 UpdateHKLFdata(histoName) 3311 data['Histograms'] = UseList 3312 wx.CallAfter(G2ddG.UpdateDData,G2frame,DData,data) 3313 wx.EndBusyCursor() 3290 3314 3291 3315 def UpdateHKLFdata(histoName): … … 3300 3324 ref[4] = np.sqrt(1./G2lat.calc_rDsq2(H,G)) 3301 3325 iabsnt,ref[3],Uniq,phi = G2spc.GenHKLf(H,SGData) 3302 G2frame.PatternTree.SetItemPyData(Id,[refDict,reflData])3326 #G2frame.PatternTree.SetItemPyData(Id,[refDict,reflData]) #removed by BHT -- not needed! 3303 3327 3304 3328 def OnPwdrAdd(event): … … 3326 3350 newList = TextList[1:] 3327 3351 for histoName in newList: 3328 pId = G2gd.GetPatternTreeItemId(G2frame,G2frame.root,histoName)3352 Id = G2gd.GetPatternTreeItemId(G2frame,G2frame.root,histoName) 3329 3353 UseList[histoName] = {'Histogram':histoName,'Show':False, 3330 3354 'Scale':[1.0,False],'Pref.Ori.':['MD',1.0,False,[0,0,1],0,{}], … … 3335 3359 'HStrain':[NDij*[0.0,],NDij*[False,]], 3336 3360 'Extinction':[0.0,False],'Babinet':{'BabA':[0.0,False],'BabU':[0.0,False]}} 3337 refList = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame, pId,'Reflection Lists'))3361 refList = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,Id,'Reflection Lists')) 3338 3362 refList[generalData['Name']] = [] 3339 3363 data['Histograms'] = UseList
Note: See TracChangeset
for help on using the changeset viewer.