Changeset 1792 for trunk/GSASIIphsGUI.py
- Timestamp:
- Apr 17, 2015 11:50:01 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIphsGUI.py
r1790 r1792 3808 3808 UseList = data['Histograms'] 3809 3809 hist = DData.G2hist 3810 keyList = G2frame.GetHistogramNames(hist[:4]) 3810 3811 sourceDict = UseList[hist] 3811 3812 if 'HKLF' in sourceDict['Histogram']: … … 3816 3817 for name in copyNames: 3817 3818 copyDict[name] = copy.deepcopy(sourceDict[name]) #force copy 3818 keyList = sorted(UseList.keys())3819 3819 if UseList: 3820 3820 dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame, 'Copy parameters', 3821 'Copy parameters to which histograms?', 3822 keyList) 3821 'Copy parameters to which histograms?',keyList) 3823 3822 try: 3824 3823 if dlg.ShowModal() == wx.ID_OK: … … 3860 3859 for bab in babNames: 3861 3860 copyDict[name][bab] = sourceDict[name][bab][1] 3862 keyList = sorted(UseList.keys())3861 keyList = G2frame.GetHistogramNames(hist[:4]) 3863 3862 if UseList: 3864 3863 dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame, 'Copy parameters', … … 3895 3894 finally: 3896 3895 dlg.Destroy() 3897 3898 3896 3899 3897 def OnSelDataCopy(event): 3900 hst = G2frame.PatternTree.GetItemText(G2frame.PatternId) 3901 histList = GetHistsLikeSelected(G2frame) 3902 if not histList: 3903 G2frame.ErrorDialog('No match','No histograms match '+hst,G2frame.dataFrame) 3904 return 3905 # # Assemble a list of item labels 3906 # TextTable = {key:label for key,label,dig in 3907 # SetupSampleLabels(hst,data.get('Type'),Inst['Type'][0]) 3908 # } 3909 # # get flexible labels 3910 # TextTable.update({ 3911 # key:Controls[key] for key in Controls if key.startswith('FreePrm') 3912 # }) 3913 # # add a few extra 3914 # TextTable.update({ 3915 # 'Type':'Diffractometer type', 3916 # 'InstrName':'Instrument Name', 3917 # }) 3918 # # Assemble a list of dict entries that would be labeled in the Sample 3919 # # params data window (drop ranId and items not used). 3920 # keyList = [i for i in data.keys() if i in TextTable] 3921 # keyText = [TextTable[i] for i in keyList] 3922 # # sort both lists together, ordered by keyText 3923 # keyText, keyList = zip(*sorted(zip(keyText,keyList))) # sort lists 3924 # selectedKeys = [] 3925 # dlg = G2G.G2MultiChoiceDialog( 3926 # G2frame.dataFrame, 3927 # 'Select which sample parameters\nto copy', 3928 # 'Select sample parameters', keyText) 3929 # try: 3930 # if dlg.ShowModal() == wx.ID_OK: 3931 # selectedKeys = [keyList[i] for i in dlg.GetSelections()] 3932 # finally: 3933 # dlg.Destroy() 3934 # if not selectedKeys: return # nothing to copy 3935 # copyDict = {} 3936 # for parm in selectedKeys: 3937 # copyDict[parm] = data[parm] 3938 # dlg = G2G.G2MultiChoiceDialog( 3939 # G2frame.dataFrame, 3940 # 'Copy sample params from\n'+str(hst[5:])+' to...', 3941 # 'Copy sample parameters', histList) 3942 # try: 3943 # if dlg.ShowModal() == wx.ID_OK: 3944 # result = dlg.GetSelections() 3945 # for i in result: 3946 # item = histList[i] 3947 # Id = G2gd.GetPatternTreeItemId(G2frame,G2frame.root,item) 3948 # sampleData = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,Id,'Sample Parameters')) 3949 # sampleData.update(copy.deepcopy(copyDict)) 3950 # finally: 3951 # dlg.Destroy() 3952 G2plt.PlotPatterns(G2frame,plotType='SASD',newPlot=False) 3898 UseList = data['Histograms'] 3899 hist = DData.G2hist 3900 keyList = G2frame.GetHistogramNames(hist[:4]) 3901 sourceDict = UseList[hist] 3902 copyDict = {} 3903 if 'HKLF' in sourceDict['Histogram']: 3904 copyNames = ['Scale','Extinction','Babinet'] 3905 else: #PWDR 3906 copyNames = ['Scale','Pref.Ori.','Size','Mustrain','HStrain','Extinction','Babinet'] 3907 dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame,'Select which parameters to copy', 3908 'Select phase data parameters', copyNames) 3909 try: 3910 if dlg.ShowModal() == wx.ID_OK: 3911 selectedItems = [copyNames[i] for i in dlg.GetSelections()] 3912 finally: 3913 dlg.Destroy() 3914 if not selectedItems: return # nothing to copy 3915 copyDict = {} 3916 for parm in selectedItems: 3917 copyDict[parm] = copy.deepcopy(sourceDict[parm]) 3918 if UseList: 3919 dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame, 'Copy parameters', 3920 'Copy parameters to which histograms?',keyList) 3921 try: 3922 if dlg.ShowModal() == wx.ID_OK: 3923 for sel in dlg.GetSelections(): 3924 UseList[keyList[sel]].update(copy.deepcopy(copyDict)) 3925 finally: 3926 dlg.Destroy() 3953 3927 3954 3928 … … 5926 5900 phaseName = General['Name'] 5927 5901 Histograms = data['Histograms'] 5902 keyList = G2frame.GetHistogramNames('PWDR') 5928 5903 histNames = [] 5929 5904 refData = {} 5930 5905 Gangls = {} 5931 for name in Histograms.keys():5906 for name in keyList: 5932 5907 if 'PWDR' in name: 5933 5908 im = 0 … … 5947 5922 else: # xray - typical caked 2D image data 5948 5923 refData[name] = np.column_stack((Refs[0],Refs[1],Refs[2],Refs[5+im],Refs[8+im],Refs[12+im+it],np.zeros_like(Refs[0]))) 5949 Error = G2mth.FitTexture(General,Gangls,refData )5924 Error = G2mth.FitTexture(General,Gangls,refData,keyList) 5950 5925 if Error: 5951 5926 wx.MessageBox(Error,caption='Fit Texture Error',style=wx.ICON_EXCLAMATION)
Note: See TracChangeset
for help on using the changeset viewer.