Changeset 2432
- Timestamp:
- Aug 18, 2016 4:36:19 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/imports/G2img_CBF.py
r2309 r2432 15 15 import sys 16 16 import os 17 import time 17 18 import GSASIIIO as G2IO 18 19 import GSASIIpath … … 50 51 import cPickle 51 52 52 # def analyze(stream):53 # listnpa = []54 # key16 = "\x80"55 # key32 = "\x00\x80"56 # key64 = "\x00\x00\x00\x80"57 # iBeg = True58 # st64 = stream.split(key64)59 # for iA,stA in enumerate(st64):60 # st32 = stA.split(key32)61 # for iB,stB in enumerate(st32):62 # st16 = stB.split(key16)63 # if not iB:64 # listnpa.append(np.fromstring(st16[0], dtype="int32"))65 # else:66 # for iC,stC in enumerate(st16):67 # if not iC:68 # listnpa.append(np.fromstring(stC, dtype="int8"))69 # else:70 # listnpa.append(np.fromstring(stC, dtype="int16"))71 72 73 74 75 53 def analyse(stream): 76 54 """ … … 157 135 cent = [cent[0]*pixSize[0]/1000.,cent[1]*pixSize[1]/1000.] 158 136 compImage = stream[imageBeg:imageBeg+compImageSize] 159 GSASIIpath.IPyBreak() 137 # GSASIIpath.IPyBreak() 138 time0 = time.time() 160 139 image = np.hstack(analyse(compImage)).cumsum() 161 140 image = np.reshape(image,(sizexy[1],sizexy[0])) 141 print 'import time:',time.time()-time0 162 142 data = {'pixelSize':pixSize,'wavelength':wave,'distance':dist,'center':cent,'size':sizexy} 163 143 Npix = sizexy[0]*sizexy[1]
Note: See TracChangeset
for help on using the changeset viewer.