Skip to content

Commit

Permalink
close silx-kit#459
Browse files Browse the repository at this point in the history
  • Loading branch information
kif committed Nov 4, 2021
1 parent 8eaedd1 commit 811c23e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions fabio/edfimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,17 @@ def get_data_rank(header=None, capsHeader=None):
if capsHeader is not None:
rank = 0
for key in capsHeader:
if key[0:4] == "DIM_":
try:
index = int(key[4:])
except ValueError:
logger.error("Unable converting index of {} to integer.".format(key))
if index > rank:
rank = index
return(rank)
if key.startswith("DIM_"):
sidx = key[4:]
if sidx.isdecimal():
try:
index = int(sidx)
except ValueError:
logger.error("Unable converting index of {} to integer.".format(key))
else:
if index > rank:
rank = index
return rank

@staticmethod
def get_data_shape(rank=0, header=None, capsHeader=None):
Expand Down

0 comments on commit 811c23e

Please sign in to comment.