Example #1
0
 def test_single_pixel_spot(self, shifts_expected, sigma):
     z = np.zeros((50, 50))
     z[28, 24] = 1
     z = gaussian_filter(z, sigma=sigma, truncate=3)
     shifts = find_beam_offset_cross_correlation(z, 1, 6)
     assert np.allclose(shifts, shifts_expected, atol=0.2)
Example #2
0
 def test_broader_starting_square_spot(self, shifts_expected):
     z = np.zeros((50, 50))
     z[28:31, 24:27] = 1
     z = gaussian_filter(z, sigma=2, truncate=3)
     shifts = find_beam_offset_cross_correlation(z, 1, 4)
     assert np.allclose(shifts, shifts_expected, atol=0.2)
Example #3
0
 def test_perfectly_centered_spot(self, shifts_expected):
     z = np.zeros((50, 50))
     z[24:26, 24:26] = 1
     z = gaussian_filter(z, sigma=2, truncate=3)
     shifts = find_beam_offset_cross_correlation(z, 1, 4)
     assert np.allclose(shifts, shifts_expected, atol=0.2)