Skip to content

Commit

Permalink
adding KeyError to correct place ...
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-rakowski committed Nov 10, 2023
1 parent 9657c42 commit dbfa1b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions py4DSTEM/io/filereaders/read_K2.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __init__(
try:
R_Ny = gtg.allTags[".SI Dimensions.Size Y"]
R_Nx = gtg.allTags[".SI Dimensions.Size X"]
except (ValueError,KeyError):
except ValueError:
print("Warning: scan shape not detected. Please check/set manually.")
R_Nx = self._guess_number_frames() // 32
R_Ny = 1
Expand All @@ -125,7 +125,7 @@ def __init__(
Q_Nx = gtg.allTags[".SI Image Tags.Acquisition.Parameters.Detector.height"]
Q_Ny = gtg.allTags[".SI Image Tags.Acquisition.Parameters.Detector.width"]
# TODO check this is the correct error type
except ValueError:
except (ValueError, KeyError):
print("Warning: diffraction pattern shape not detected!")
print("Assuming 1920x1792 as the diffraction pattern size!")
Q_Nx = 1792
Expand Down

0 comments on commit dbfa1b2

Please sign in to comment.