opticspy / lightpipes

LightPipes for Python, "Pure Python version"
https://opticspy.github.io/lightpipes/
BSD 3-Clause "New" or "Revised" License
227 stars 52 forks source link

Use Field.copy on F in ZernikeFilter to prevent in-place modification #82

Open TAU-Reinier opened 8 months ago

TAU-Reinier commented 8 months ago

The line Fout = F did not create a copy of F, just a second reference, and the line Fout.field *= _np.exp(-1j * Ph) modified the object referenced by both Fout and F, so the input Field also came out filtered.