Skip to content

Commit 660a4ed

Browse files
committed
fix HDF5 image bug & cosmetics
1 parent 0d80637 commit 660a4ed

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

GSASII/GSASIIfiles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def NeededPackage(pkgDict):
160160
161161
Examples::
162162
163-
{'MIDAS Zarr importer':['zarr=2.18.*']}
163+
{'MIDAS Zarr importer':['zarr=3.18.*']}
164164
{'HDF5 image importer':['h5py','hdf5']}
165165
'''
166166
condaRequestList.update(pkgDict)

GSASII/GSASIIseqGUI.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,9 +1271,9 @@ def OnEditSelectPhaseVars(event):
12711271
phaseKeys = [i for i in parmDict if ':' in i and i.split(':')[1] == '']
12721272
phaseKeys = [i for i in phaseKeys if type(parmDict[i]) not in (int,str,bool)]
12731273
if len(selRows) == 1:
1274-
lbl = "\nin {histNames[selRows[0]]} "
1274+
lbl = f"\nin {histNames[selRows[0]]} "
12751275
else:
1276-
lbl = "\nin {len(selRows)} histograms"
1276+
lbl = f"\nin {len(selRows)} histograms"
12771277
dlg = G2G.G2MultiChoiceDialog(G2frame, 'Choose phase parmDict item(s) to set'+lbl,
12781278
'Choose items to edit', phaseKeys)
12791279
if dlg.ShowModal() == wx.ID_OK:

GSASII/imports/G2img_HDF5.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,9 @@ def readDataset(self,fp,imagenum=1,name=None,num=None):
284284
try:
285285
pixelsize = [float(fp['/instrument/Detector/PixelSizeX'][0]),
286286
float(fp['/instrument/Detector/PixelSizeY'][0])]
287+
print(f'Using PixelSize[XY] for Pixel size: {pixelsize}.')
287288
except:
288-
pass
289+
pixelsize = None
289290
try:
290291
if not pixelsize:
291292
misc = {}
@@ -300,9 +301,12 @@ def readDataset(self,fp,imagenum=1,name=None,num=None):
300301
pixelsize = [misc[f'DetPixelSize{i}'][j] for i in ('X','Y')]
301302
print(f'Using DetPixelSize* for Pixel size: {pixelsize}.')
302303
except:
303-
print(f'No DetSize* or DetPixelSize* Pixel size defaulting to {pixelsize}.')
304+
pixelsize = None
305+
print(f'No PixelSize[XY], DetSize[XY] or DetPixelSize[XY].')
304306
# default pixel size (for APS sector 6?)
305-
if not pixelsize: pixelsize = [74.8,74.8]
307+
if not pixelsize:
308+
pixelsize = [74.8,74.8]
309+
print(f'Pixel size defaulting to {pixelsize}')
306310
data = {'pixelSize':pixelsize,'wavelength':0.15,'distance':1000.,
307311
'center':[sizexy[0]*0.1,sizexy[1]*0.1],'size':sizexy,'det2theta':0.0}
308312
for item in self.Comments:

0 commit comments

Comments
 (0)