Skip to content

Commit

Permalink
Convert upsample_factor from positional to key argument (#563)
Browse files Browse the repository at this point in the history
This is to overcome the error:
TypeError: phase_cross_correlation() takes 2 positional arguments but 3 were given
  • Loading branch information
dgursoy committed Sep 29, 2021
1 parent bf34307 commit a8f2457
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/tomopy/prep/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def align_seq(

# Register current projection in sub-pixel precision
shift, error, diffphase = phase_cross_correlation(
_prj[m], _sim[m], upsample_factor)
_prj[m], _sim[m], upsample_factor=upsample_factor)
err[m] = np.sqrt(shift[0]*shift[0] + shift[1]*shift[1])
sx[m] += shift[0]
sy[m] += shift[1]
Expand Down Expand Up @@ -329,7 +329,7 @@ def align_joint(

# Register current projection in sub-pixel precision
shift, error, diffphase = phase_cross_correlation(
_prj[m], _sim[m], upsample_factor)
_prj[m], _sim[m], upsample_factor=upsample_factor)
err[m] = np.sqrt(shift[0]*shift[0] + shift[1]*shift[1])
sx[m] += shift[0]
sy[m] += shift[1]
Expand Down

0 comments on commit a8f2457

Please sign in to comment.