Closed mperrin closed 6 years ago
Comment by mperrin Friday Oct 31, 2014 at 19:37 GMT
Let's make the keyword radius
instead of size
so it's more explicit what exactly it's measuring. Thanks.
Comment by josePhoenix Friday Oct 31, 2014 at 20:08 GMT
Yep! Actually had already made that change, but called it "pupil_radius".
Joseph
On Oct 31, 2014, at 3:37 PM, Marshall Perrin notifications@github.com wrote:
Let's make the keyword radius instead of size so it's more explicit what exactly it's measuring. Thanks.
— Reply to this email directly or view it on GitHub.
Issue by josePhoenix Friday Oct 31, 2014 at 17:35 GMT Originally opened as https://github.com/mperrin/poppy/issues/14
While working on adapting the ThinLens optic to use the
poppy.zernike
library of functions, I noticed that the present implementation of ThinLens has a problem: the radius normalization changes when inserting an intermediate image plane between the pupil and the thin lens.Test case
With the
addImage()
call commented out as above, the resulting PSF looks like:With the
addImage()
call:Cause
The defocus analytic optic needs to know the extent of the aperture in order to normalize the radius such that rho = 1 at the edge of the illuminated portion. The way this works now, the radius is guessed from the pixels in the aperture.
From
poppy/optics.py
:ThinLens.getPhasor
wave.intensity > 0
is true for all pixels after a single back-and-forth FFT/IFFT, because numerical noise shows up in the zero pixels (~1e-46).Solution
The proposed solution is to require
ThinLens
instances to be instantiated with asize
keyword argument specifying their radius in meters in the original pupil plane.It may also be possible to make a better guess at which pixels are "close enough" to zero, and improve the guessing of the aperture radius. This would preserve backward compatibility, but may not be totally foolproof in the case of a grayscale pupil.
It's better to be explicit than implicit, so I'll update POPPY and the corresponding parts of WebbPSF to use a
size=
keyword argument.