Skip to content

Commit

Permalink
Fix reshape with interrupted acquisition
Browse files Browse the repository at this point in the history
  • Loading branch information
ericpre committed Apr 1, 2024
1 parent ee999ab commit 468482c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions rsciio/quantumdetector/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ def load_mib_data(
# Reshape only when the slice from zeros
if first_frame == 0 and len(navigation_shape) > 1:
navigation_shape = (
navigation_shape[1],
frame_number_in_file // navigation_shape[1],
)
navigation_shape[0],
frame_number_in_file // navigation_shape[0],
)[::-1]
else:
navigation_shape = (number_of_frames_to_load,)
elif number_of_frames_to_load < frame_number:
Expand Down
2 changes: 1 addition & 1 deletion rsciio/tests/test_quantumdetector.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def test_mib_properties_quad__repr__():
def test_interrupted_acquisition():
fname = TEST_DATA_DIR_UNZIPPED / "Single_9_Frame_CounterDepth_1_Rows_256.mib"
# There is only 9 frames, simulate interrupted acquisition using 10 lines
s = hs.load(fname, navigation_shape=(10, 2))
s = hs.load(fname, navigation_shape=(4, 3))
assert s.axes_manager.signal_shape == (256, 256)
assert s.axes_manager.navigation_shape == (4, 2)

Expand Down

0 comments on commit 468482c

Please sign in to comment.