Changeset 700
- Timestamp:
- Aug 8, 2012 2:46:15 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIimage.py
r699 r700 13 13 import numpy as np 14 14 import numpy.linalg as nl 15 import copy 15 16 import GSASIIpath 16 17 GSASIIpath.SetVersionNumber("$Revision$") … … 386 387 387 388 def ImageRecalibrate(self,data): 388 import copy389 389 import ImageCalibrants as calFile 390 390 print 'Image recalibration:' … … 420 420 Ring,delt = makeRing(dsp,ellipse,pixLimit,cutoff,scalex,scaley,self.ImageZ) 421 421 if Ring: 422 numZ = len(Ring)422 # numZ = len(Ring) 423 423 data['rings'].append(np.array(Ring)) 424 424 data['ellipses'].append(copy.deepcopy(ellipse+('r',))) … … 750 750 751 751 # print 'Masks:',Masks 752 wave = Controls['wavelength'] 753 dist = Controls['distance'] 754 center = Controls['center'] 755 rot = Controls['rotation'] 756 tilt = Controls['tilt'] 757 imSize = Controls['size'] 758 pixSize = Controls['pixelSize'] 759 azmOff = Controls['azmthOff'] 752 StaControls = copy.deepcopy(Controls) 753 StaControls['distance'] += StrSta['Sample z']*cosd(StrSta['Sample phi']) 754 pixSize = StaControls['pixelSize'] 760 755 scalex = 1000./pixSize[0] 761 756 scaley = 1000./pixSize[1] 762 757 763 758 for ring in StrSta['d-zero']: 764 ellipse = GetEllipse(ring['Dset'], Controls)759 ellipse = GetEllipse(ring['Dset'],StaControls) 765 760 Ring,delt = makeRing(ring['Dset'],ellipse,ring['pixLimit'],ring['cutoff'],scalex,scaley,Image) 766 761 Ring = np.array(Ring).T 767 762 ring['ImxyObs'] = np.array(Ring[:2]) #need to apply masks to this to eliminate bad points 768 763 [x,y] = np.array(makeIdealRing(ellipse)).T 769 Tth,azm = GetTthAzm(x,y,Controls) 770 th = Tth/2. 771 th += np.sum(StrSta['strain']*calcFij(StrAta['phi'],0.,azm,th)) 772 Tth = th*2. 764 if len(x): 765 Tth,azm = GetTthAzm(x,y,StaControls) 766 azm += Controls['azmthOff'] #account for detector rotation 767 th = Tth/2. 768 th += 180.*np.sum(StrSta['strain']*calcFij(StrSta['Sample phi'],0.,azm,th))/(np.pi*1.e6) #in degrees 769 Tth = th*2. 773 770 774 771 … … 791 788 [c*d,c*e,c**2]]) 792 789 return -Fij*nptand(th) 793 790 791 def FitStrain(rings,p0,wave): 792 from scipy.optimize import leastsq 793 794 def StrainPrint(ValSig): 795 print 'Strain tensor:' 796 ptlbls = 'names :' 797 ptstr = 'values:' 798 sigstr = 'esds :' 799 for name,fmt,value,sig in ValSig: 800 ptlbls += "%s" % (name.rjust(12)) 801 ptstr += fmt % (value) 802 if sig: 803 sigstr += fmt % (sig) 804 else: 805 sigstr += 12*' ' 806 print ptlbls 807 print ptstr 808 print sigstr 809 810 def strainCalc(E,xyd,wave): 811 x,y,dsp = xyd 812 tth = 2.0*npasind(wave/(2.*dsp)) 813 -
trunk/GSASIIpwdGUI.py
r699 r700 1860 1860 if len(data) > 1: 1861 1861 G2frame.dataFrame.SelectPhase.Enable(True) 1862 refList = [refl[:11] for refl in data[G2frame.RefList]] 1862 refList = np.array([refl[:11] for refl in data[G2frame.RefList]]) 1863 Icorr = np.array([refl[13] for refl in data[G2frame.RefList]]) 1864 I100 = refList.T[8]*Icorr 1865 I100 *= 100.0/np.max(I100) 1866 refList = np.vstack((refList.T,I100)).T 1863 1867 for i in range(len(refList)): rowLabels.append(str(i)) 1864 1868 if HKLF: 1865 1869 colLabels = ['H','K','L','mul','d','Fosq','sig','Fcsq','FoTsq','FcTsq','phase',] 1866 1870 else: 1867 colLabels = ['H','K','L','mul','d','pos','sig','gam','Fosq','Fcsq','phase',] 1868 Types = 4*[wg.GRID_VALUE_LONG,]+4*[wg.GRID_VALUE_FLOAT+':10,4',]+2*[wg.GRID_VALUE_FLOAT+':10,2',]+[wg.GRID_VALUE_FLOAT+':10,3',] 1871 colLabels = ['H','K','L','mul','d','pos','sig','gam','Fosq','Fcsq','phase','I100',] 1872 Types = 4*[wg.GRID_VALUE_LONG,]+4*[wg.GRID_VALUE_FLOAT+':10,4',]+ \ 1873 2*[wg.GRID_VALUE_FLOAT+':10,2',]+[wg.GRID_VALUE_FLOAT+':10,3',]+ \ 1874 [wg.GRID_VALUE_FLOAT+':10,2',] 1869 1875 G2frame.PeakTable = G2gd.Table(refList,rowLabels=rowLabels,colLabels=colLabels,types=Types) 1870 1876 G2frame.dataFrame.SetLabel('Reflection List for '+phaseName) … … 1874 1880 G2frame.dataDisplay.SetMargins(0,0) 1875 1881 G2frame.dataDisplay.AutoSizeColumns(False) 1876 G2frame.dataFrame.setSizePosLeft([555,350]) 1877 1882 G2frame.dataDisplay.Fit() 1883 size = G2frame.dataDisplay.GetSize() 1884 G2frame.dataFrame.setSizePosLeft([size[0]+32,350]) 1878 1885 ################################################################################ 1879 1886 ##### PDF controls
Note: See TracChangeset
for help on using the changeset viewer.