Skip to content

Commit

Permalink
Fix in est_shift2D method and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
francisco-dlp committed Oct 13, 2023
1 parent 5b06c0a commit 0633281
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hyperspy/_signals/signal2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,8 @@ def estimate_shift2D(self,
('shift', np.int32,
(2,))]))
nshift, max_value = estimate_image_shift(
self(),
self(),
self._get_current_data(),
self._get_current_data(),
roi=roi,
sobel=sobel,
medfilter=medfilter,
Expand Down
5 changes: 3 additions & 2 deletions hyperspy/tests/signals/test_2D_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ def test_align_subpix(self):
def test_estimate_subpix(self, normalize_corr, reference):
s = self.signal
shifts = s.estimate_shift2D(sub_pixel_factor=200,
normalize_corr=normalize_corr)
np.testing.assert_allclose(shifts, self.shifts, rtol=0.2, atol=0.2,
normalize_corr=normalize_corr,
reference=reference)
np.testing.assert_allclose(shifts, self.shifts, rtol=2, atol=0.2,
verbose=True)

@pytest.mark.parametrize(("plot"), [True, 'reuse'])
Expand Down

0 comments on commit 0633281

Please sign in to comment.