Changeset 2461 for trunk/imports/G2img_GE.py
- Timestamp:
- Sep 8, 2016 9:09:47 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/imports/G2img_GE.py ¶
r2418 r2461 125 125 sizexy = [2048,2048] 126 126 Npix = sizexy[0]*sizexy[1] 127 image = np.array(ar.array('f',File.read(4*Npix)),dtype=np.int32) 127 image = np.array(np.frombuffer(File.read(4*Npix),dtype=np.float32),dtype=np.int32) 128 # image = np.array(ar.array('f',File.read(4*Npix)),dtype=np.int32) 128 129 elif filename.split('.')[-1] in ['avg','cor']: 129 130 File.seek(0,2) … … 134 135 sizexy = [2048,2048] 135 136 Npix = sizexy[0]*sizexy[1] 136 image = np.array(ar.array('H',File.read(2*Npix)),dtype=np.int32) 137 image = np.array(np.frombuffer(File.read(2*Npix),dtype=np.int16),dtype=np.int32) 138 # image = np.array(ar.array('H',File.read(2*Npix)),dtype=np.int32) 137 139 else: 138 140 head = ['GE detector raw data',] … … 153 155 pos = 8192 + (imagenum-1)*2*Npix 154 156 File.seek(pos) 155 image = np.array(ar.array('H',File.read(2*Npix)),dtype=np.int32) 157 image = np.array(np.frombuffer(File.read(2*Npix),dtype=np.int16),dtype=np.int32) 158 # image = np.array(ar.array('H',File.read(2*Npix)),dtype=np.int32) 156 159 if len(image) != sizexy[1]*sizexy[0]: 157 160 print('not enough images while reading GE file: '+filename+'image #'+str(imagenum)) … … 162 165 while nframes > 1: #OK, this will sum the frames. 163 166 try: 164 image += np.array(ar.array('H',File.read(2*Npix)),dtype=np.int32) 167 image += np.array(np.frombuffer(File.read(2*Npix),dtype=np.int16),dtype=np.int32) 168 # image += np.array(ar.array('H',File.read(2*Npix)),dtype=np.int32) 165 169 except ValueError: 166 170 break
Note: See TracChangeset
for help on using the changeset viewer.