import lentil
import numpy as np
import matplotlib.pyplot as plt
amp = lentil.circle((256,256), 120)
amp -= lentil.circle(shape=(256,256), radius=40)
for angle in (0, 90, 180, 270):
amp *= lentil.spider((256,256), 2, angle)
opd = lentil.zernike(amp, 2)*15e-6
p = lentil.Pupil(amplitude=amp, opd=opd, focal_length=10, pixelscale=1/240)
w = lentil.Wavefront(500e-9)
w *= p
w = lentil.propagate_dft(w, pixelscale=5e-6, shape=(256, 256))
psf = w.intensity/np.max(w.intensity)
fig, ax = plt.subplots(figsize=(2.5, 2.5))
ax.imshow(psf**0.1, cmap='inferno', vmin=0.15)
ax.set_title('Large tilt exposes periodic wraparound')