brandondube / prysm

physical optics: integrated modeling, phase retrieval, segmented systems, polynomials and fitting, sequential raytracing...
https://prysm.readthedocs.io/en/stable/
MIT License
267 stars 46 forks source link

dm: replace ndimage.zoom #81

Closed brandondube closed 2 years ago

brandondube commented 2 years ago

Reported in https://github.com/scipy/scipy/issues/15495, ndimage.zoom is bugged and introduces a linear phase (shift) in images. This destroys the accuracy of the DM model when upsample != 1. A simple crop/zero-pad in the Fourier domain implements the same thing we get out of ndimage.zoom call, assuming the influence function is band-limited (a constraint we can pass along to the user without any trouble). The impact on performance may be non-trivial, but with MKL FFTs should be quite fast.