manoharan-lab/holopy

Transfer function in propagation appears to be incorrect

Opened this issue · 0 comments

This line in convolution_propagation.py is supposed to set the transfer function to be zero at all nonphysical spatial frequencies. But we previously set the root variable equal to zero wherever it is negative (that is, wherever taking sqrt(root) would result in an imaginary value). So the line g = g * (root >= 0) will not actually do anything! The transfer function remains unchanged because root >= 0 everywhere, and at the points where root = 0, the transfer function will be equal to 1, which is incorrect. This line should read g = g * (root > 0) instead.

Need to fix and include a test against known transfer functions.