In [1]:
import numpy as np
import matplotlib.pyplot as pl
import wavefront as wf
%matplotlib inline

Let us consider the point spread function of a telescope with a diameter of 0.5 m at 630 nm, both with and without seeing. First, let us build the aperture:


In [41]:
npix = 64
aperture = wf.aperture(npix = npix, cent_obs = 0.2, spider=2)

Now we compute the wavefront in both cases. The case with seeing is obtained by a linear combination of Zernike polynomials with normal random coefficients.


In [47]:
D = 0.5  # m
r0 = 10  # cm
pixSize = 0.03      # arcsec
lambda0 = 6301.0    # A
wavefront = wf.seeing(D * 100.0 / r0, npix = npix, nterms = 0, quiet=True)
wavefrontSeeing = wf.seeing(D * 100.0 / r0, npix = npix, nterms = 40, quiet=True)

In [48]:
f, ax = pl.subplots(ncols=3, nrows=1, figsize=(15,8))
ax[0].imshow(aperture)
ax[1].imshow(wavefront)
ax[2].imshow(wavefrontSeeing)


Out[48]:
<matplotlib.image.AxesImage at 0x843a150>

The PSF is computed from the aperture and wavefront as the absolute value of the Fourier transform of the following function

$$ h(x,y) = A(x,y) e^{i\phi(x,y)} $$

In [49]:
psf = wf.psf(aperture, wavefront, overfill = wf.psfScale(D, lambda0, pixSize))

In [50]:
psfSeeing = wf.psf(aperture, wavefrontSeeing, overfill = wf.psfScale(D, lambda0, pixSize))

In [51]:
f, ax = pl.subplots(ncols=2, nrows=2, figsize=(12,12))
ax[0,0].imshow(psf)
ax[0,1].imshow(np.log(psf))
ax[1,0].imshow(psfSeeing)
ax[1,1].imshow(np.log(psfSeeing))


Out[51]:
<matplotlib.image.AxesImage at 0x8ebcc50>

In [ ]: