Changeset 2008
- Timestamp:
- Oct 16, 2015 10:00:03 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r1996 r2008 372 372 Page.canvas.SetToolTipString(HKLtxt) 373 373 G2frame.G2plotNB.status.SetStatusText('HKL = '+HKLtxt,0) 374 G2frame.G2plotNB.status.SetStatusText('Use K-box to set plot controls',1)375 374 376 375 def OnSCPress(event): … … 421 420 Page.Choice += ('w: select |DFsq|/sig','1: select |DFsq|>sig','3: select |DFsq|>3sig',) 422 421 Page.SetFocus() 423 424 G2frame.G2plotNB.status.SetStatusText('Use K-box to set plot controls',1)425 422 Plot.set_aspect(aspect='equal') 426 423 … … 444 441 HKLF = [] 445 442 time0 = time.time() 443 sumFo = 0. 444 sumDF = 0. 445 # GSASIIpath.IPyBreak() 446 446 for refl in HKLref: 447 447 H = refl[:3] … … 460 460 if Type == 'Fosq': 461 461 A = scale*Fosq/FosqMax 462 sumFo += A 462 463 B = scale*Fcsq/FosqMax 463 464 C = abs(A-B) 465 sumDF += C 464 466 elif Type == 'Fo': 465 467 A = scale*math.sqrt(max(0,Fosq))/FoMax 468 sumFo += A 466 469 B = scale*math.sqrt(max(0,Fcsq))/FoMax 467 470 C = abs(A-B) 471 sumDF += C 468 472 elif Type == 'Unit Fc': 469 473 A = scale/2 … … 515 519 Plot.set_xlabel(xlabel[izone]+str(Data['Layer']),fontsize=12) 516 520 Plot.set_ylabel(ylabel[izone],fontsize=12) 521 if sumFo and sumDF: 522 G2frame.G2plotNB.status.SetStatusText('layer R = %6.2f%s'%(100.*sumDF/sumFo,'%'),1) 523 else: 524 G2frame.G2plotNB.status.SetStatusText('Use K-box to set plot controls',1) 517 525 if not newPlot: 518 526 Page.toolbar.push_current() … … 535 543 to F, F**2, etc. as requested as 3D array 536 544 ''' 537 545 super2 = unichr(0xb2) 538 546 global ifBox 539 547 ifBox = False … … 670 678 [uBox[4],uBox[5]],[uBox[5],uBox[6]],[uBox[6],uBox[7]],[uBox[7],uBox[4]]]) 671 679 uColors = [Rd,Gr,Bl, Wt,Wt,Wt, Wt,Wt,Wt, Wt,Wt,Wt] 680 672 681 def FillHKLRC(): 682 sumFo2 = 0. 683 sumDF2 = 0. 684 sumFo = 0. 685 sumDF = 0. 673 686 R = np.zeros(len(hklRef)) 674 687 C = [] … … 683 696 else: 684 697 Fosq,sig,Fcsq = refl[8+Super],1.0,refl[9+Super] 698 sumFo2 += Fosq 699 sumDF2 += abs(Fosq-Fcsq) 700 if Fosq > 0.: 701 sumFo += np.sqrt(Fosq) 702 sumDF += abs(np.sqrt(Fosq)-np.sqrt(Fcsq)) 685 703 if Super: 686 704 HKL.append(H+SuperVec*refl[3]) … … 727 745 C = np.array(C) 728 746 C = (C.T*R).T 729 R = np.ones_like(R)*0.05 730 return HKL,zip(list(R),C) 747 R = np.ones_like(R)*0.05 748 RF = 100. 749 RF2 = 100. 750 if sumFo and sumDF: 751 RF = 100.*sumDF/sumFo 752 RF2 = 100.*sumDF2/sumFo2 753 return HKL,zip(list(R),C),RF,RF2 731 754 732 755 def GetTruePosition(xy): … … 910 933 # print caller 911 934 # end of useful debug 912 G2frame.G2plotNB.status.SetStatusText('Plot type = %s for %s'%(Data['Type'],Name),1)913 935 VS = np.array(Page.canvas.GetSize()) 914 936 aspect = float(VS[0])/float(VS[1]) … … 925 947 GS[1][2] = GS[2][1] = math.sqrt(GS[1][1]*GS[2][2]) 926 948 927 HKL,RC = FillHKLRC() 949 HKL,RC,RF,RF2 = FillHKLRC() 950 G2frame.G2plotNB.status.SetStatusText \ 951 ('Plot type = %s for %s; RF = %6.2f%%, RF%s = %6.2f%%'%(Data['Type'],Name,RF,super2,RF2),1) 928 952 929 953 SetBackground()
Note: See TracChangeset
for help on using the changeset viewer.