Python 2/3 divide issue

Issue #22 resolved
Jason Wang created an issue

I found this in BKA but I think extractSpec and FMMF also have copied this line of code:

x_psf_grid, y_psf_grid = np.meshgrid(np.arange(nx_psf * 1.)-nx_psf/2,np.arange(ny_psf* 1.)-ny_psf/2)

which would be off by half a pixel in python 3, since in python 3, this isn't integer divide. So instead we should cast it with //:

x_psf_grid, y_psf_grid = np.meshgrid(np.arange(nx_psf * 1.) - nx_psf//2, np.arange(ny_psf * 1.) - ny_psf//2)

Comments (1)

  1. Log in to comment