Changeset 271
- Timestamp:
- Apr 28, 2011 1:11:32 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r267 r271 252 252 self.dirname = '' 253 253 self.undofile = '' 254 self.Offset = 0.0254 self.Offset = [0.0,0.0] 255 255 self.Weight = False 256 256 self.IparmName = '' … … 544 544 mainSizer.Add(topLabl,0,wx.ALIGN_CENTER_VERTICAL|wx.LEFT,10) 545 545 mainSizer.Add((10,10),1) 546 dataGridSizer = wx.FlexGridSizer(rows=len(data),cols=2,hgap=2,vgap=2) 546 ncols = len(data)/40+1 547 dataGridSizer = wx.FlexGridSizer(rows=len(data),cols=ncols,hgap=2,vgap=2) 547 548 for id,item in enumerate(self.data): 548 549 ckbox = wx.CheckBox(panel,id,item[1]) … … 583 584 584 585 def GetData(self): 585 586 return self.data 586 587 587 588 class SumDialog(wx.Dialog): … … 1013 1014 while item and not Id: 1014 1015 name = self.PatternTree.GetItemText(item) 1015 if name[:4] in ['PWDR','HKLF','IMG ','PDF']:1016 if name[:4] in ['PWDR','HKLF','IMG ','PDF ']: 1016 1017 Id = item 1017 1018 elif name == 'Controls': … … 1234 1235 1235 1236 def OnExportPDF(self,event): 1237 #need S(Q) and G(R) to be saved here - probably best from selection? 1236 1238 event.Skip() 1237 1239 … … 1281 1283 self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(Id,text='F(Q)'+PWDRname),[]) 1282 1284 self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(Id,text='G(R)'+PWDRname),[]) 1285 self.ExportPDF.Enable(True) 1283 1286 finally: 1284 1287 dlg.Destroy() -
trunk/GSASIIgrid.py
r265 r271 750 750 elif 'PDF' in self.PatternTree.GetItemText(item): 751 751 self.PatternId = item 752 self.ExportPDF.Enable(True) 752 753 G2plt.PlotISFG(self,type='S(Q)') 753 754 -
trunk/GSASIIimage.py
r268 r271 593 593 tax = np.where(tax < LRazm[0],tax+360.,tax) 594 594 NST,H0 = h2d.histogram2d(len(tax),tax,tay,taz,numAzms,numChans,LRazm,LUtth,Dazm,Dtth,NST,H0) 595 print 'block done' 595 596 del tax,tay,taz 596 597 Nup += 1 -
trunk/GSASIIimgGUI.py
r268 r271 231 231 def OnIntegrateAll(event): 232 232 print 'integrate all' 233 TextList = [ ]233 TextList = [[False,'All IMG',0]] 234 234 Names = [] 235 235 if self.PatternTree.GetCount(): … … 241 241 TextList.append([False,name,id]) 242 242 id, cookie = self.PatternTree.GetNextChild(self.root, cookie) 243 if not len(TextList):243 if len(TextList) == 1: 244 244 self.ErrorDialog('Nothing to integrate','There must some "IMG" patterns') 245 245 return … … 248 248 if dlg.ShowModal() == wx.ID_OK: 249 249 result = dlg.GetData() 250 if result[0][0]: #the 'All IMG' is True 251 result = TextList[1:] 252 for item in result: item[0] = True 250 253 for item in result: 251 254 ifintegrate,name,id = item … … 272 275 def OnCopyControls(event): 273 276 import copy 274 TextList = [ ]277 TextList = [[False,'All IMG',0]] 275 278 Names = [] 276 279 if self.PatternTree.GetCount(): … … 291 294 TextList.append([False,name,id]) 292 295 id, cookie = self.PatternTree.GetNextChild(self.root, cookie) 293 if not len(TextList):296 if len(TextList) == 1: 294 297 self.ErrorDialog('Nothing to copy controls to','There must be more than one "IMG" pattern') 295 298 return … … 298 301 if dlg.ShowModal() == wx.ID_OK: 299 302 result = dlg.GetData() 303 if result[0][0]: 304 result = TextList[1:] 305 for item in result: item[0] = True 300 306 for i,item in enumerate(result): 301 307 ifcopy,name,id = item … … 321 327 File = open(filename,'w') 322 328 save = {} 323 keys = ['type','wavelength','calibrant','distance','center','tilt','rotation','azmthOff'] 329 keys = ['type','wavelength','calibrant','distance','center', 330 'tilt','rotation','azmthOff','fullIntegrate','LRazimuth', 331 'IOtth','outAzimuths'] 324 332 for key in keys: 325 333 File.write(key+':'+str(data[key])+'\n') … … 348 356 elif key in ['wavelength','distance','tilt','rotation']: 349 357 save[key] = float(val) 350 elif key in ['center',]: 351 vals = val.strip('[] ').split() 358 elif key in ['fullIntegrate',]: 359 save[key] = bool(val) 360 elif key in ['outAzimuths',]: 361 save[key] = int(val) 362 elif key in ['LRazimuth',]: 363 if ',' in val: 364 vals = val.strip('[] ').split(',') 365 else: 366 vals = val.strip('[] ').split() 367 save[key] = [int(vals[0]),int(vals[1])] 368 elif key in ['center','IOtth']: 369 if ',' in val: 370 vals = val.strip('[] ').split(',') 371 else: 372 vals = val.strip('[] ').split() 352 373 save[key] = [float(vals[0]),float(vals[1])] 353 374 S = File.readline() 354 375 data.update(save) 355 calSel.SetValue(data['calibrant']) 356 waveSel.SetValue("%6.5f" % (data['wavelength'])) 357 cent = data['center'] 358 centText.SetValue(("%8.3f,%8.3f" % (cent[0],cent[1]))) 359 distSel.SetValue("%8.3f"%(data['distance'])) 360 tiltSel.SetValue("%9.3f"%(data['tilt'])) 361 rotSel.SetValue("%9.3f"%(data['rotation'])) 376 UpdateImageControls(self,data,masks) 377 G2plt.PlotExposedImage(self,event=event) 378 362 379 File.close() 363 380 finally: -
trunk/GSASIIplot.py
r268 r271 21 21 import GSASIIgrid as G2gd 22 22 import GSASIIimage as G2img 23 import GSASIIpwd as G2pwd 23 24 import GSASIIIO as G2IO 24 25 import GSASIIpwdGUI as G2pdG … … 96 97 self.status = parent.CreateStatusBar() 97 98 self.status.SetFieldsCount(2) 98 self.status.SetStatusWidths([1 25,-1])99 self.status.SetStatusWidths([150,-1]) 99 100 self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, self.OnPageChanged) 100 101 … … 201 202 Page.figure.clf() 202 203 Plot = Page.figure.gca() #get a fresh plot after clf() 203 except ValueError ,error:204 except ValueError: 204 205 Plot = self.G2plotNB.addMpl('Structure Factors').gca() 205 206 plotNum = self.G2plotNB.plotList.index('Structure Factors') … … 337 338 self.Weight = True 338 339 print 'plot weighting:',self.Weight 339 elif event.key == ' l':340 elif event.key == 'n': 340 341 if self.Contour: 341 342 pass … … 344 345 self.logPlot = False 345 346 else: 346 self.Offset = 0347 self.Offset[0] = 0 347 348 self.logPlot = True 348 349 elif event.key == 'u': … … 351 352 elif self.logPlot: 352 353 pass 353 elif self.Offset < 100.:354 self.Offset += 1.354 elif self.Offset[0] < 100.: 355 self.Offset[0] += 1. 355 356 elif event.key == 'd': 356 357 if self.Contour: … … 358 359 elif self.logPlot: 359 360 pass 360 elif self.Offset > 0.: 361 self.Offset -= 1. 361 elif self.Offset[0] > 0.: 362 self.Offset[0] -= 1. 363 elif event.key == 'l': 364 self.Offset[1] -= 1. 365 elif event.key == 'r': 366 self.Offset[1] += 1. 362 367 elif event.key == 'c': 363 368 newPlot = True … … 367 372 self.Contour = True 368 373 self.SinglePlot = False 369 self.Offset = 0374 self.Offset = [0.,0.] 370 375 elif event.key == 'q': 371 376 newPlot = True … … 499 504 Page.figure.clf() 500 505 Plot = Page.figure.gca() #get a fresh plot after clf() 501 except ValueError ,error:506 except ValueError: 502 507 newPlot = True 503 508 self.Cmax = 1.0 … … 516 521 else: 517 522 if self.logPlot: 518 Choice = (' key press',' l: log(I) off',523 Choice = (' key press','n: log(I) off','l: offset left','r: offset right', 519 524 'c: contour on','q: toggle q plot','s: toggle single plot','+: no selection') 520 525 else: 521 Choice = (' key press','d: offset down','u: offset up','l: log(I) on', 522 'c: contour on','q: toggle q plot','s: toggle single plot','+: no selection') 526 Choice = (' key press','l: offset left','r: offset right','d: offset down', 527 'u: offset up','n: log(I) on','c: contour on','q: toggle q plot', 528 's: toggle single plot','+: no selection') 523 529 cb = wx.ComboBox(self.G2plotNB.status,style=wx.CB_DROPDOWN|wx.CB_READONLY, 524 530 choices=Choice) … … 555 561 xye = Pattern[1] 556 562 Ymax = max(Ymax,max(xye[1])) 557 offset = self.Offset *Ymax/100.0563 offset = self.Offset[0]*Ymax/100.0 558 564 Title = 'Powder Patterns: '+os.path.split(self.GSASprojectfile)[1] 559 565 if self.logPlot: … … 600 606 Plot.set_ylabel('Data sequence',fontsize=12) 601 607 else: 602 X += self.Offset *.01*N608 X += self.Offset[1]*.005*N 603 609 if ifpicked: 604 610 Z = xye[3]+offset*N … … 685 691 if self.Contour: 686 692 self.Cmax = min(1.0,self.Cmax*1.2) 687 elif self.Offset < 100.:688 self.Offset += 1.693 elif self.Offset[0] < 100.: 694 self.Offset[0] += 1. 689 695 elif event.key == 'd': 690 696 if self.Contour: 691 697 self.Cmax = max(0.0,self.Cmax*0.8) 692 elif self.Offset > 0.: 693 self.Offset -= 1. 698 elif self.Offset[0] > 0.: 699 self.Offset[0] -= 1. 700 elif event.key == 'l': 701 self.Offset[1] -= 1. 702 elif event.key == 'r': 703 self.Offset[1] += 1. 694 704 elif event.key == 'c': 695 705 newPlot = True … … 699 709 self.Contour = True 700 710 self.SinglePlot = False 701 self.Offset = 0711 self.Offset = [0.,0.] 702 712 elif event.key == 's': 703 713 if self.Contour: … … 763 773 Page.figure.clf() 764 774 Plot = Page.figure.gca() 765 except ValueError ,error:775 except ValueError: 766 776 newPlot = True 767 777 self.Cmax = 1.0 … … 778 788 'i: interpolation method','s: color scheme','c: contour off') 779 789 else: 780 Choice = (' key press',' d: offset down','u: offset up','t: toggle legend',781 ' c: contour on','s: toggle single plot')790 Choice = (' key press','l: offset left','r: offset right','d: offset down', 791 'u: offset up','t: toggle legend','c: contour on','s: toggle single plot') 782 792 cb = wx.ComboBox(self.G2plotNB.status,style=wx.CB_DROPDOWN|wx.CB_READONLY, 783 793 choices=Choice) … … 794 804 colors=['b','g','r','c','m','k'] 795 805 name = self.PatternTree.GetItemText(PatternId)[4:] 796 G2gd.GetPatternTreeItemId(self,PatternId, 'Instrument Parameters')797 806 Pattern = [] 798 807 if self.SinglePlot: … … 816 825 PlotList.append(Pattern) 817 826 item, cookie = self.PatternTree.GetNextChild(self.root, cookie) 827 PDFdata = self.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(self,PatternId, 'PDF Controls')) 828 numbDen = G2pwd.GetNumDensity(PDFdata['ElList'],PDFdata['Form Vol']) 829 Xb = [0.,10.] 830 Yb = [0.,-40.*np.pi*numbDen] 818 831 Ymax = 1.0 819 832 lenX = 0 … … 821 834 xye = Pattern[1] 822 835 Ymax = max(Ymax,max(xye[1])) 823 offset = self.Offset *Ymax/100.0836 offset = self.Offset[0]*Ymax/100.0 824 837 if self.Contour: 825 838 ContourZ = [] … … 842 855 Plot.set_ylabel('Data sequence',fontsize=12) 843 856 else: 844 X = xye[0]+self.Offset *.1*N857 X = xye[0]+self.Offset[1]*.005*N 845 858 if ifpicked: 846 859 Plot.plot(X,Y,colors[N%6]+'+',picker=3.,clip_on=False) … … 852 865 Plot.plot(X,Y,colors[N%6],picker=False) 853 866 if type == 'G(R)': 854 Plot. axhline(0.,color=wx.BLACK)867 Plot.plot(Xb,Yb,color='k',dashes=(5,5)) 855 868 elif type == 'F(Q)': 856 869 Plot.axhline(0.,color=wx.BLACK) … … 895 908 Page.figure.clf() 896 909 Plot = Page.figure.gca() 897 except ValueError ,error:910 except ValueError: 898 911 newPlot = True 899 912 Plot = self.G2plotNB.addMpl(type).gca() … … 948 961 Page.figure.clf() 949 962 Plot = Page.figure.gca() 950 except ValueError ,error:963 except ValueError: 951 964 Plot = self.G2plotNB.addMpl('Powder Lines').gca() 952 965 plotNum = self.G2plotNB.plotList.index('Powder Lines') … … 998 1011 Page.figure.clf() 999 1012 Plot = Page.figure.gca() 1000 except ValueError ,error:1013 except ValueError: 1001 1014 Plot = self.G2plotNB.addMpl('Peak Widths').gca() 1002 1015 plotNum = self.G2plotNB.plotList.index('Peak Widths') … … 1080 1093 Page.figure.clf() 1081 1094 Plot = mp3d.Axes3D(Page.figure) 1082 except ValueError ,error:1095 except ValueError: 1083 1096 Plot = mp3d.Axes3D(self.G2plotNB.add3D('Microstrain')) 1084 1097 plotNum = self.G2plotNB.plotList.index('Microstrain') … … 1408 1421 Plot = Page.figure.gca() #get a fresh plot after clf() 1409 1422 1410 except ValueError ,error:1423 except ValueError: 1411 1424 Plot = self.G2plotNB.addMpl('2D Powder Image').gca() 1412 1425 plotNum = self.G2plotNB.plotList.index('2D Powder Image') … … 1596 1609 Plot = Page.figure.gca() #get a fresh plot after clf() 1597 1610 1598 except ValueError ,error:1611 except ValueError: 1599 1612 Plot = self.G2plotNB.addMpl('2D Integration').gca() 1600 1613 plotNum = self.G2plotNB.plotList.index('2D Integration') … … 1661 1674 Plot = Page.figure.gca() #get a fresh plot after clf() 1662 1675 1663 except ValueError ,error:1676 except ValueError: 1664 1677 Plot = self.G2plotNB.addMpl('2D Transformed Powder Image').gca() 1665 1678 plotNum = self.G2plotNB.plotList.index('2D Transformed Powder Image') … … 1808 1821 panel[names.index('cameraSlider')].SetValue(drawingData['cameraPos']) 1809 1822 Draw() 1823 1824 def getSelection(): 1825 if self.dataDisplay: 1826 return self.dataDisplay.GetSelection() 1827 else: 1828 return 0 1810 1829 1811 1830 def SetViewPointText(VP): 1812 page = self.dataDisplay.GetSelection()1831 page = getSelection() 1813 1832 if page: 1814 1833 if self.dataDisplay.GetPageText(page) == 'Draw Options': … … 1818 1837 1819 1838 def ClearSelectedAtoms(): 1820 page = self.dataDisplay.GetSelection()1839 page = getSelection() 1821 1840 if page: 1822 1841 if self.dataDisplay.GetPageText(page) == 'Draw Atoms': … … 1826 1845 1827 1846 def SetSelectedAtoms(ind): 1828 page = self.dataDisplay.GetSelection()1847 page = getSelection() 1829 1848 if page: 1830 1849 if self.dataDisplay.GetPageText(page) == 'Draw Atoms': … … 1837 1856 1838 1857 def GetSelectedAtoms(): 1839 page = self.dataDisplay.GetSelection()1858 page = getSelection() 1840 1859 Ind = [] 1841 1860 if page: … … 2257 2276 plotNum = self.G2plotNB.plotList.index(generalData['Name']) 2258 2277 Page = self.G2plotNB.nb.GetPage(plotNum) 2259 except (ValueError,error):2278 except ValueError: 2260 2279 Plot = self.G2plotNB.addOgl(generalData['Name']) 2261 2280 plotNum = self.G2plotNB.plotList.index(generalData['Name']) -
trunk/GSASIIpwd.py
r269 r271 4 4 # $Author: vondreele $ 5 5 # $Revision: 267 $ 6 # $URL: https://subversion.xor.aps.anl.gov/pyGSAS/trunk/GSASIIp eak.py $7 # $Id: GSASIIp eak.py 267 2011-04-20 18:09:53Z vondreele $6 # $URL: https://subversion.xor.aps.anl.gov/pyGSAS/trunk/GSASIIpwd.py $ 7 # $Id: GSASIIpwd.py 267 2011-04-20 18:09:53Z vondreele $ 8 8 ########### SVN repository information ################### 9 9 import sys … … 184 184 return 1.0/((1.0+dlam/RulCoff)*(1.0+(np.pi*dlam_c/(dlam+RulCoff))**2)) 185 185 186 def LorchWeight(Q): 187 return np.sin(np.pi*(Q[-1]-Q)/(2.0*Q[-1])) 188 186 189 def lambdaCompton(DetType,wave,Q): 187 190 hmc = 0.024262734687 … … 210 213 CF += cf*el['FormulaNo']/sumNoAtoms 211 214 return FF2,FF**2,CF 215 216 def GetNumDensity(ElList,Vol): 217 sumNoAtoms = 0.0 218 for El in ElList: 219 sumNoAtoms += ElList[El]['FormulaNo'] 220 return sumNoAtoms/Vol 212 221 213 222 def MultGetQ(Tth,MuT,Geometry,b=88.0,a=0.01): … … 710 719 xydata['SofQ'][1][1] -= CF 711 720 xydata['SofQ'][1][1] = xydata['SofQ'][1][1]/SqFF 712 713 721 scale = len(xydata['SofQ'][1][1][minQ:maxQ])/np.sum(xydata['SofQ'][1][1][minQ:maxQ]) 722 xydata['SofQ'][1][1] *= scale 723 714 724 xydata['FofQ'] = copy.deepcopy(xydata['SofQ']) 715 725 xydata['FofQ'][1][1] = xydata['FofQ'][1][0]*(xydata['SofQ'][1][1]-1.0) 716 xydata['FofQ'][1][1] *= np.sin(np.pi*(qLimits[1]-Q)/(2.0*qLimits[1])) 726 if data['Lorch']: 727 xydata['FofQ'][1][1] *= LorchWeight(Q) 717 728 718 729 xydata['GofR'] = copy.deepcopy(xydata['FofQ']) -
trunk/GSASIIpwdGUI.py
r270 r271 1077 1077 1078 1078 def UpdatePDFGrid(self,data): 1079 global inst 1079 1080 tth2q = lambda t,w:4.0*math.pi*sind(t/2.0)/w 1080 1081 dataFile = self.PatternTree.GetItemText(self.PatternId) … … 1148 1149 sumVol += Avol*ElList[El]['FormulaNo'] 1149 1150 return sumVol 1151 auxPlot = ComputePDF(data) 1152 G2plt.PlotISFG(self,newPlot=False) 1150 1153 1151 1154 def FillElemSizer(elemSizer,ElData): … … 1161 1164 formVol.SetValue('%.2f'%(data['Form Vol'])) 1162 1165 UpdatePDFGrid(self,data) 1166 auxPlot = ComputePDF(data) 1167 G2plt.PlotISFG(self,newPlot=False) 1163 1168 1164 1169 elemSizer.Add(wx.StaticText(parent=self.dataDisplay, … … 1175 1180 data['Geometry'] = geometry.GetValue() 1176 1181 UpdatePDFGrid(self,data) 1182 auxPlot = ComputePDF(data) 1183 G2plt.PlotISFG(self,newPlot=False) 1177 1184 1178 1185 def OnDetType(event): 1179 1186 data['DetType'] = detType.GetValue() 1180 1187 UpdatePDFGrid(self,data) 1188 auxPlot = ComputePDF(data) 1189 G2plt.PlotISFG(self,newPlot=False) 1181 1190 1182 1191 def OnFormVol(event): … … 1190 1199 UpdatePDFGrid(self,data) 1191 1200 auxPlot = ComputePDF(data) 1192 G2plt.PlotISFG(self,newPlot= True)1201 G2plt.PlotISFG(self,newPlot=False) 1193 1202 1194 1203 def OnDiameter(event): … … 1202 1211 UpdatePDFGrid(self,data) 1203 1212 auxPlot = ComputePDF(data) 1204 G2plt.PlotISFG(self,newPlot=True) 1205 1213 G2plt.PlotISFG(self,newPlot=False) 1214 1215 def OnPolaVal(event): 1216 try: 1217 value = float(polaVal.GetValue()) 1218 if not (0.0 <= value <= 1.0): 1219 raise ValueError 1220 except ValueError: 1221 value = inst['Polariz.'] 1222 inst['Polariz.'] = value 1223 polaVal.SetValue('%.2f'%(inst['Polariz.'])) 1224 UpdatePDFGrid(self,data) 1225 auxPlot = ComputePDF(data) 1226 G2plt.PlotISFG(self,newPlot=False) 1227 1228 def OnAzimVal(event): 1229 try: 1230 value = float(azimVal.GetValue()) 1231 if not (0. <= value <= 360.): 1232 raise ValueError 1233 except ValueError: 1234 value = inst['Azimuth'] 1235 inst['Azimuth'] = value 1236 azimVal.SetValue('%.1f'%(inst['Azimuth'])) 1237 UpdatePDFGrid(self,data) 1238 auxPlot = ComputePDF(data) 1239 G2plt.PlotISFG(self,newPlot=False) 1240 1206 1241 def OnObliqCoeff(event): 1207 1242 try: … … 1216 1251 obliqCoeff.SetValue('%.3f'%(value)) 1217 1252 auxPlot = ComputePDF(data) 1218 G2plt.PlotISFG(self,newPlot= True)1253 G2plt.PlotISFG(self,newPlot=False) 1219 1254 1220 1255 def OnRulandWdt(event): … … 1230 1265 rulandWdt.SetValue('%.3f'%(value)) 1231 1266 auxPlot = ComputePDF(data) 1232 G2plt.PlotISFG(self,newPlot= True)1267 G2plt.PlotISFG(self,newPlot=False) 1233 1268 1234 1269 def OnLorch(event): 1235 1270 data['Lorch'] = lorch.GetValue() 1236 1271 auxPlot = ComputePDF(data) 1237 G2plt.PlotISFG(self,newPlot=True) 1238 1239 1272 G2plt.PlotISFG(self,newPlot=False) 1273 1240 1274 def OnPacking(event): 1241 1275 try: … … 1247 1281 data['Pack'] = value 1248 1282 UpdatePDFGrid(self,data) 1249 G2plt.PlotISFG(self,newPlot= True)1283 G2plt.PlotISFG(self,newPlot=False) 1250 1284 1251 1285 def OnSQmin(event): … … 1259 1293 SQmin.SetValue('%.1f'%(value)) 1260 1294 auxPlot = ComputePDF(data) 1295 G2plt.PlotISFG(self,newPlot=True) 1261 1296 1262 1297 def OnSQmax(event): … … 1268 1303 value = min(qLimits[1],data['QScaleLim'][1]) 1269 1304 data['QScaleLim'][1] = value 1305 if value < data['QScaleLim'][0]: 1306 data['QScaleLim'][0] = 0.90*value 1307 SQmin.SetValue('%.1f'%(data['QScaleLim'][0])) 1270 1308 SQmax.SetValue('%.1f'%(value)) 1271 1309 auxPlot = ComputePDF(data) … … 1300 1338 import copy 1301 1339 TextList,Source = GetFileList('PDF',skip=self.PatternId) 1340 TextList[0] = [False,'All PDF',0] 1302 1341 if len(TextList) == 1: 1303 1342 self.ErrorDialog('Nothing to copy controls to','There must be more than one "PDF" pattern') 1304 1343 return 1305 dlg = self.CopyDialog(self,'Copy PDF controls','Copy controls from '+Source+' to:',TextList [1:])1344 dlg = self.CopyDialog(self,'Copy PDF controls','Copy controls from '+Source+' to:',TextList) 1306 1345 try: 1307 1346 if dlg.ShowModal() == wx.ID_OK: 1308 1347 result = dlg.GetData() 1348 if result[0][0]: 1349 result = TextList[1:] 1350 for item in result: item[0] = True 1309 1351 for i,item in enumerate(result): 1310 1352 ifcopy,name,id = item … … 1315 1357 olddata['Sample'] = sample 1316 1358 self.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(self,id, 'PDF Controls'),olddata) 1359 Status.SetStatusText('PDF controls copied') 1317 1360 finally: 1318 1361 dlg.Destroy() … … 1373 1416 print 'Calculating PDF:' 1374 1417 auxPlot = ComputePDF(data) 1418 Status.SetStatusText('PDF computed') 1375 1419 for plot in auxPlot: 1376 1420 G2plt.PlotXY(self,plot[:2],type=plot[2]) … … 1391 1435 auxPlot = ComputePDF(Data) 1392 1436 id, cookie = self.PatternTree.GetNextChild(self.root, cookie) 1437 Status.SetStatusText('All PDFs computed') 1393 1438 G2plt.PlotISFG(self,newPlot=True,type='G(R)') 1394 1439 1395 1440 def OnShowTip(self,tip): 1396 print tip 1397 1441 print tip 1398 1442 1399 1443 if self.dataDisplay: … … 1415 1459 str = ' Sample file: PWDR %s Wavelength, A: %.5f Energy, keV: %.3f Polariz.: %.2f '%(dataFile[3:],wave,keV,polariz) 1416 1460 mainSizer.Add(wx.StaticText(parent=self.dataDisplay,label=str),0,wx.ALIGN_CENTER_VERTICAL) 1461 # dataSizer = wx.BoxSizer(wx.HORIZONTAL) 1462 # dataSizer.Add(wx.StaticText(parent=self.dataDisplay,label='Azimuth'),0,wx.ALIGN_CENTER_VERTICAL) 1463 # azimVal = wx.TextCtrl(self.dataDisplay,value='%.2f'%(inst['Azimuth'])) 1464 # azimVal.Bind(wx.EVT_TEXT_ENTER,OnAzimVal) 1465 # azimVal.Bind(wx.EVT_KILL_FOCUS,OnAzimVal) 1466 # dataSizer.Add(azimVal,0) 1467 # dataSizer.Add(wx.StaticText(parent=self.dataDisplay,label='Polarization'),0,wx.ALIGN_CENTER_VERTICAL) 1468 # polaVal = wx.TextCtrl(self.dataDisplay,value='%.2f'%(inst['Polariz.'])) 1469 # polaVal.Bind(wx.EVT_TEXT_ENTER,OnPolaVal) 1470 # polaVal.Bind(wx.EVT_KILL_FOCUS,OnPolaVal) 1471 # dataSizer.Add(polaVal,0) 1472 # mainSizer.Add(dataSizer,0) 1417 1473 mainSizer.Add((5,5),0) 1418 1474 fileSizer = wx.FlexGridSizer(3,6,5,1) -
trunk/fsource/histogram2d.for
r248 r271 31 31 REAL*8 DX,DY 32 32 33 34 DO K=0,N 33 DO K=0,N-1 35 34 IF ( ( X(K) .GE. XLIM(0) .AND. X(K) .LE. XLIM(1)) .AND. 36 35 1 (Y(K) .GE. YLIM(0) .AND. Y(K). LE. YLIM(1)) ) THEN 37 I = INT((X(K)-XLIM(0))/DX)38 J = INT((Y(K)-YLIM(0))/DY)36 I = NINT((X(K)-XLIM(0))/DX) 37 J = NINT((Y(K)-YLIM(0))/DY) 39 38 IF ( (I .GE. 0 .AND. I .LT. NXBINS) .AND. 40 39 1 (J .GE. 0 .AND. J .LT. NYBINS) ) THEN
Note: See TracChangeset
for help on using the changeset viewer.