Changeset 245

Ignore:
Timestamp:
Feb 13, 2011 4:57:10 PM (11 years ago)
Message:

Location:
trunk
Files:
4 edited

Unmodified
Removed
• trunk/GSASIIimage.py

 r239 def FitDetector(rings,p0,wave): from scipy.optimize import leastsq def ellipseCalc(B,xyd,wave): def ellipseCalcD(B,xyd,wave): x = xyd[0] y = xyd[1] YR = X*npsind(phi)+Y*npcosd(phi) return (XR/R0)**2+(YR/R1)**2-1 result = leastsq(ellipseCalc,p0,args=(rings.T,wave)) return result[0] def ellipseCalcW(C,xyd): dist,x0,y0,phi,tilt,wave = C B = dist,x0,y0,phi,tilt return ellipseCalcD(B,xyd,wave) result = leastsq(ellipseCalcD,p0,args=(rings.T,wave)) if len(rings) > 1: p0 = result[0] p0 = np.append(p0,wave) resultW = leastsq(ellipseCalcW,p0,args=(rings.T,)) return result[0],resultW[0][-1] else: return result[0],wave def ImageLocalMax(image,w,Xpix,Ypix): Y /= scaley ring.append([X,Y,dsp]) if len(ring) < 20:             #want more than 1/4 of a circle if len(ring) < 10:             #want more than 20deg return [] return ring rings = np.concatenate((data['rings']),axis=0) p0 = [dist,cent[0],cent[1],phi,tilt] result = FitDetector(rings,p0,wave) result,newWave = FitDetector(rings,p0,wave) print 'Suggested new wavelength = ',('%.5f')%(newWave),' (not reliable if distance > 2m)' data['distance'] = result[0] data['center'] = result[1:3] H0 = np.zeros(shape=(numAzms,numChans),order='F',dtype=np.float32) imageN = len(image) nBlks = (imageN-1)/1024+1 dlg = wx.ProgressDialog("Elapsed time","2D image integration",nBlks*nBlks*3+3, Nx,Ny = data['size'] nXBlks = (Nx-1)/1024+1 nYBlks = (Ny-1)/1024+1 print Nx,Ny,nXBlks,nYBlks dlg = wx.ProgressDialog("Elapsed time","2D image integration",nXBlks*nYBlks*3+3, style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE) try: Nup = 0 dlg.Update(Nup) for iBlk in range(nBlks): for iBlk in range(nYBlks): iBeg = iBlk*1024 iFin = min(iBeg+1024,imageN) for jBlk in range(nBlks): iFin = min(iBeg+1024,Ny) for jBlk in range(nXBlks): jBeg = jBlk*1024 jFin = min(jBeg+1024,imageN) jFin = min(jBeg+1024,Nx) print 'Process map block',iBlk,jBlk,iBeg,iFin,jBeg,jFin TA,tam = Make2ThetaAzimuthMap(data,masks,(iBeg,iFin),(jBeg,jFin))           #2-theta & azimuth arrays & create position mask
• trunk/GSASIIimgGUI.py

 r243 def OnIOtth(event): Ltth = float(self.InnerTth.GetValue()) Ltth = max(float(self.InnerTth.GetValue()),0.001) Utth = float(self.OuterTth.GetValue()) if Ltth > Utth:
• trunk/GSASIIplot.py

 r244 if 'Line2D' in itemPicked and PickName == 'Image Controls': if 'line1' in itemPicked: Data['IOtth'][0] = tth Data['IOtth'][0] = max(tth,0.001) elif 'line2' in itemPicked: Data['IOtth'][1] = tth
• trunk/ImageCalibrants.py

 r240 'LaB6  SRM660a':(2,(4.1569162,4.1569162,4.1569162,90,90,90),0,(0.5,20,10)), 'LaB6  SRM660a skip 1':(2,(4.1569162,4.1569162,4.1569162,90,90,90),1,(0.5,20,10)), 'LaB6  SRM660a ID-1 hydra skip 6':(2,(4.1569162,4.1569162,4.1569162,90,90,90),6,(0.7,5,0.5)), 'LaB6  SRM660': (2,(4.15695,4.15695,4.15695,90,90,90),0,(0.5,20,10)), 'Si    SRM640c':(0,(5.4311946,5.4311946,5.4311946,90,90,90),0,(0.5,20,10)), 'Ni   @ 298K':(0,(3.52475,3.52475,3.52475,90,90,90),0,(0.5,20,10)), 'NaCl @ 298K':(0,(5.6402,5.6402,5.6402,90,90,90),0,(0.5,20,10)), 'CeO2  SRM674b skip 8':(0,(5.411651,5.411651,5.411651,90,90,90),8,(0.5,2,1)), 'Ag behenate':(6,(1.0,1.0,58.380,90,90,90),0,(7.0,5,1)), 'Spun Si grating':(6,(1.0,1.0,2777.78,90,90,90),2,(200.,5,1))
Note: See TracChangeset for help on using the changeset viewer.