Skip to content

Commit

Permalink
Merge pull request #109 from usnistgov/integrateImageStack_energy
Browse files Browse the repository at this point in the history
Fixed Error Handling for integrateImage energy
  • Loading branch information
pbeaucage authored Oct 2, 2023
2 parents 12c71b0 + 21b0b5d commit f15b8df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/PyHyperScattering/PFEnergySeriesIntegrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ def integrateSingleImage(self,img):
for i,n in enumerate(img.indexes[multiindex_name].names):
if n == 'energy':
idx_of_energy = i
en = float(getattr(img,multiindex_name).values[idx_of_energy][0])
try:
en = float(getattr(img,multiindex_name).values[idx_of_energy][0]) # this does not work for 2022-2 data; does it work for other cycles?
except IndexError:
en = float(getattr(img,multiindex_name).values[0][idx_of_energy])
except KeyError:
pass
if en is not None:
Expand Down

0 comments on commit f15b8df

Please sign in to comment.