Skip to content

Commit b03b0ab

Browse files
committed
add more parameters to HDF5 images read with a specified location
1 parent 5d04eba commit b03b0ab

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

GSASII/imports/G2img_HDF5.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ def Reader(self, filename, ParentFrame=None, **kwarg):
148148
# pointer to section of file & image number here
149149
if imageTag:
150150
self.Data['ImageTag'] = imageTag
151+
self.Data['ImageSection'] = imagenum[0]
151152
return True
152153
if self.Npix == 0:
153154
self.errors = 'No valid images found in file'
@@ -255,9 +256,6 @@ def readDataset(self,fp,imagenum=1,name=None,num=None):
255256
'''
256257
if name is None:
257258
name,num,size = self.buffer['imagemap'][imagenum-1] # look up image in map
258-
quick = False
259-
else:
260-
quick = True
261259
dset = fp[name]
262260
if num == None:
263261
image = dset[()]
@@ -272,9 +270,7 @@ def readDataset(self,fp,imagenum=1,name=None,num=None):
272270
msg = f'Unexpected image dimensions {name}'
273271
print(msg)
274272
raise Exception(msg)
275-
if quick:
276-
return {},None,image.T
277-
# add parametric values to the brginning of the comments
273+
# add parametric values to the beginning of the comments
278274
self.Comments = []
279275
for k in self.buffer.get('ParamTrackingVars',[]):
280276
arr = self.buffer['ParamTrackingVars'][k]
@@ -308,7 +304,7 @@ def readDataset(self,fp,imagenum=1,name=None,num=None):
308304
print(f'Using DetPixelSize* for Pixel size: {pixelsize}.')
309305
except:
310306
pixelsize = None
311-
print(f'No PixelSize[XY], DetSize[XY] or DetPixelSize[XY].')
307+
print('No PixelSize[XY], DetSize[XY] or DetPixelSize[XY].')
312308
# default pixel size (for APS sector 6?)
313309
if not pixelsize:
314310
pixelsize = [74.8,74.8]

0 commit comments

Comments
 (0)