Changeset 2835
- Timestamp:
- May 16, 2017 4:02:31 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIimage.py
r2826 r2835 319 319 320 320 def GetDetectorXY(dsp,azm,data): 321 'Needs a doc string' 322 321 '''Get detector x,y position from d-spacing (dsp), azimuth (azm,deg) 322 & image controls dictionary (data) 323 it seems to be only used in plotting 324 ''' 323 325 elcent,phi,radii = GetEllipse(dsp,data) 324 326 phi = data['rotation']-90. #to give rotation of major axis … … 363 365 def GetDetXYfromThAzm(Th,Azm,data): 364 366 '''Computes a detector position from a 2theta angle and an azimultal 365 angle (both in degrees) 367 angle (both in degrees) - apparently not used! 366 368 ''' 367 369 dsp = data['wavelength']/(2.0*npsind(Th)) -
trunk/GSASIIimgGUI.py
r2828 r2835 173 173 174 174 def OnCalibrate(event): 175 G2frame.dataFrame.GetStatusBar().SetStatusText('Select > 4 points on 1st used ring; LB to pick , RB on point to delete else RB to finish')175 G2frame.dataFrame.GetStatusBar().SetStatusText('Select > 4 points on 1st used ring; LB to pick (shift key to force pick), RB on point to delete else RB to finish') 176 176 G2frame.ifGetRing = True 177 177 -
trunk/GSASIIobj.py
r2820 r2835 1804 1804 self.repeatcount = 0 1805 1805 self.readfilename = '?' 1806 self.scriptable = False 1806 1807 #print 'created',self.__class__ 1807 1808 -
trunk/GSASIIplot.py
r2829 r2835 4489 4489 ypix = int(ypos*scaley) 4490 4490 Int = 0 4491 if (0 <= xpix < sizexy[ 1]) and (0 <= ypix < sizexy[0]):4491 if (0 <= xpix < sizexy[0]) and (0 <= ypix < sizexy[1]): 4492 4492 Int = G2frame.ImageZ[ypix][xpix] 4493 4493 tth,azm,D,dsp = G2img.GetTthAzmDsp(xpos,ypos,Data) … … 4571 4571 elif event.key in ['y',]: 4572 4572 Data['invert_y'] = not Data['invert_y'] 4573 else: 4574 return 4573 4575 wx.CallAfter(PlotImage,G2frame,newPlot=True) 4574 4576 … … 4838 4840 Xpix = Xpos*scalex 4839 4841 Ypix = Ypos*scaley 4840 xpos,ypos,I,J = G2img.ImageLocalMax(G2frame.ImageZ,pixLimit,Xpix,Ypix) 4842 if event.key == 'shift': #force selection at cursor position 4843 xpos = Xpix 4844 ypos = Ypix 4845 I = J = 10 4846 else: 4847 xpos,ypos,I,J = G2img.ImageLocalMax(G2frame.ImageZ,pixLimit,Xpix,Ypix) 4841 4848 if I and J: 4842 4849 xpos += .5 #shift to pixel center -
trunk/GSASIIscriptable.py
r2825 r2835 115 115 for a PWDR entry in GSASII data tree. 116 116 ''' 117 readerlist = ['G2pwd_fxye','G2pwd_xye','G2pwd_BrukerRAW','G2pwd_csv','G2pwd_FP', 118 'G2pwd_Panalytical','G2pwd_rigaku'] 119 if reader not in readerlist: 120 print '**** ERROR: unrecognized reader ',reader 117 if not reader.scriptable: 118 print '**** ERROR: not a scriptable reader ',reader 121 119 return None 122 120 rdfile,rdpath,descr = imp.find_module(reader) -
trunk/imports/G2img_1TIF.py
r2829 r2835 24 24 import numpy as np 25 25 import time 26 DEBUG = False26 DEBUG = True 27 27 GSASIIpath.SetVersionNumber("$Revision$") 28 28 class TIF_ReaderClass(G2obj.ImportImage): … … 40 40 longFormatName = 'Various .tif and pseudo-TIF formats' 41 41 ) 42 self.scriptable = True 42 43 43 44 def ContentsValidator(self, filepointer): … … 184 185 return lines,0,0,0 185 186 tifType = 'CheMin' 186 pixy = [40 ,40]187 pixy = [40.,40.] 187 188 image = np.flipud(np.array(Im.open(filename)))*10. 188 189 distance = 18.0 … … 196 197 tifType = 'Pilatus' 197 198 dataType = 0 198 pixy = [172 ,172]199 pixy = [172.,172.] 199 200 File.seek(4096) 200 201 print 'Read Pilatus tiff file: ',filename … … 204 205 if IFD[258][2][0] == 16: 205 206 tifType = 'GE' 206 pixy = [200 ,200]207 pixy = [200.,200.] 207 208 File.seek(8) 208 209 print 'Read GE-detector tiff file: ',filename … … 212 213 elif IFD[258][2][0] == 32: 213 214 tifType = 'CHESS' 214 pixy = [200 ,200]215 pixy = [200.,200.] 215 216 File.seek(8) 216 217 print 'Read CHESS-detector tiff file: ',filename … … 222 223 tifType = 'ImageJ' 223 224 dataType = 0 224 pixy = [200 ,200]*IFD[277][2][0]225 pixy = [200.,200.]*IFD[277][2][0] 225 226 File.seek(IFD[273][2][0]) 226 227 print 'Read ImageJ tiff file: ',filename 227 228 # image = ar.array('H',File.read(2*Npix)) 228 229 # image = File.read(2*Npix,dtype=np.uint16) 229 image = File.read(4*Npix) 230 if IFD[258][2][0] == 32: 231 image = File.read(4*Npix) 232 image = np.array(np.frombuffer(image,dtype=byteOrd+'i4'),dtype=np.int32) 233 elif IFD[258][2][0] == 16: 234 image = File.read(2*Npix) 235 pixy = [109.92,109.92] #for LCLS ImageJ tif files 236 image = np.array(np.frombuffer(image,dtype=byteOrd+'u2'),dtype=np.int32) 230 237 # if '>' in byteOrd: 231 238 # image.byteswap() 232 image = np.array(np.frombuffer(image,dtype=np.int),dtype=np.int32)233 239 # image = np.array(np.frombuffer(image),dtype=np.int32) 234 240 # image = np.array(np.asarray(image,dtype='H'),dtype=np.int32) 235 241 elif 262 in IFD and IFD[262][2][0] > 4: 236 242 tifType = 'DND' 237 pixy = [158 ,158]243 pixy = [158.,158.] 238 244 File.seek(512) 239 245 print 'Read DND SAX/WAX-detector tiff file: ',filename … … 243 249 elif sizexy == [1536,1536]: 244 250 tifType = 'APS Gold' 245 pixy = [150 ,150]251 pixy = [150.,150.] 246 252 File.seek(64) 247 253 print 'Read Gold tiff file:',filename … … 253 259 if IFD[258][2][0] == 32: 254 260 tifType = 'PE' 255 pixy = [200 ,200]261 pixy = [200.,200.] 256 262 File.seek(8) 257 263 print 'Read APS PE-detector tiff file: ',filename … … 274 280 elif IFD[273][2][0] == 4096: 275 281 if sizexy[0] == 3072: 276 pixy = [73 ,73]282 pixy = [73.,73.] 277 283 tifType = 'MAR225' 278 284 else: 279 pixy = [158 ,158]285 pixy = [158.,158.] 280 286 tifType = 'MAR325' 281 287 File.seek(4096) … … 286 292 elif IFD[273][2][0] == 512: 287 293 tifType = '11-ID-C' 288 pixy = [200 ,200]294 pixy = [200.,200.] 289 295 File.seek(512) 290 296 print 'Read 11-ID-C tiff file: ',filename … … 296 302 if IFD[258][2][0] == 16: 297 303 tifType = 'scanCCD' 298 pixy = [9 ,9]304 pixy = [9.,9.] 299 305 File.seek(8) 300 306 print 'Read APS scanCCD tiff file: ',filename … … 302 308 elif IFD[258][2][0] == 32: 303 309 tifType = 'PE4k' 304 pixy = [100 ,100]310 pixy = [100.,100.] 305 311 File.seek(8) 306 312 print 'Read PE 4Kx4K tiff file: ',filename -
trunk/imports/G2img_CheMin.py
r2817 r2835 41 41 ''' 42 42 import scipy.misc 43 self.Image = scipy.misc.imread(filename,flatten=True) .T43 self.Image = scipy.misc.imread(filename,flatten=True) 44 44 self.Npix = self.Image.size 45 45 if self.Npix == 0: … … 49 49 self.Comments = ['no metadata'] 50 50 pixy = list(self.Image.shape) 51 sizexy = [40 ,40]51 sizexy = [40.,40.] 52 52 self.Data = {'wavelength': 1.78892, 'pixelSize': sizexy, 'distance': 18.0,'size':pixy} 53 53 self.Data['center'] = [pixy[0]*sizexy[0]/1000.,pixy[1]*sizexy[1]/2000.] -
trunk/imports/G2pwd_BrukerRAW.py
r2817 r2835 31 31 longFormatName = 'Bruker .RAW powder data file' 32 32 ) 33 self.scriptable = True 33 34 34 35 # Validate the contents -- make sure we only have valid lines -
trunk/imports/G2pwd_FP.py
r2817 r2835 30 30 longFormatName = 'FullProf 1-10 column .dat powder data file' 31 31 ) 32 self.scriptable = True 32 33 33 34 # Validate the contents -- make sure we only have valid lines -
trunk/imports/G2pwd_Panalytical.py
r2817 r2835 25 25 longFormatName = 'Panalytical powder data as *.xrdml' 26 26 ) 27 self.scriptable = True 27 28 self.vals = None 28 29 self.stepsize = None -
trunk/imports/G2pwd_csv.py
r2817 r2835 30 30 longFormatName = 'Worksheet-type .csv powder data file' 31 31 ) 32 self.scriptable = True 32 33 33 34 # Validate the contents -- make sure we only have valid lines -
trunk/imports/G2pwd_rigaku.py
r2817 r2835 29 29 longFormatName = 'Rigaku powder data exported as .txt' 30 30 ) 31 self.scriptable = True 31 32 self.vals = None 32 33 self.stepsize = None -
trunk/imports/G2pwd_xye.py
r2817 r2835 29 29 longFormatName = 'Topas .xye or 2th Fit2D .chi powder data file' 30 30 ) 31 self.scriptable = True 31 32 32 33 # Validate the contents -- make sure we only have valid lines
Note: See TracChangeset
for help on using the changeset viewer.