Skip to content

Commit

Permalink
add fixutre without flyback
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Ercius ncem-gauss jupyter committed Sep 16, 2024
1 parent 91dca0b commit 7339501
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 5 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ def cropped_multi_frames_v2(cropped_multi_frames_data_v2):
def cropped_multi_frames_v3(cropped_multi_frames_data_v3):
return SparseArray.from_hdf5(cropped_multi_frames_data_v3, dtype=np.uint16)

@pytest.fixture
def cropped_multi_frames_v3_noflyback(cropped_multi_frames_data_v3):
return SparseArray.from_hdf5(cropped_multi_frames_data_v3,
dtype=np.uint16, keep_flyback=False)

@pytest.fixture
def simulate_sparse_array():

Expand Down
12 changes: 5 additions & 7 deletions tests/test_sparse_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,15 +710,13 @@ def compare_with_sparse(full, sparse):
assert np.array_equal(m_array[[False, True], 0][0], position_one)


def test_keep_flyback(cropped_multi_frames_v3):
def test_keep_flyback(cropped_multi_frames_v3, cropped_multi_frames_v3_noflyback):
# Test keeping the flyback
flyback = SparseArray.from_hdf5(cropped_multi_frames_v3, keep_flyback=True)
assert flyback.scan_shape[1] == 20
assert flyback.num_frames_per_scan == 2
assert cropped_multi_frames_v3.scan_shape[1] == 20
assert cropped_multi_frames_v3.num_frames_per_scan == 2
# Test removing the flyback
no_flyback = SparseArray.from_hdf5(cropped_multi_frames_v3, keep_flyback=False)
assert no_flyback.scan_shape[1] == 19
assert flyback.num_frames_per_scan == 2
assert cropped_multi_frames_v3_noflyback.scan_shape[1] == 19
assert cropped_multi_frames_v3_noflyback.num_frames_per_scan == 2

# Test binning until this number
TEST_BINNING_UNTIL = 33
Expand Down

0 comments on commit 7339501

Please sign in to comment.