In [ ]:
%matplotlib inline

load the modules


In [ ]:
from lsst.cwfs.instrument import Instrument
from lsst.cwfs.algorithm import Algorithm
from lsst.cwfs.image import Image, readFile
import lsst.cwfs.plots as plots

Define the image objects. Input arguments: file name, field coordinates in deg, image type

The colorbar() below may produce a warning message if your matplotlib version is older than 1.5.0 ( https://github.com/matplotlib/matplotlib/issues/5209 )


In [ ]:
fieldXY = [1.185,1.185]

I1 = Image(readFile('../tests/testImages/LSST_NE_SN25/z11_0.25_intra.txt'), fieldXY, Image.INTRA)
I2 = Image(readFile('../tests/testImages/LSST_NE_SN25/z11_0.25_extra.txt'), fieldXY, Image.EXTRA)

In [ ]:
plots.plotImage(I1.image,'intra')
plots.plotImage(I2.image,'extra')

Define the instrument. Input arguments: instrument name, size of image stamps


In [ ]:
inst=Instrument('lsst',I1.sizeinPix)

Define the algorithm being used. Input arguments: baseline algorithm, instrument, debug level


In [ ]:
algo=Algorithm('exp',inst,0)

Run it


In [ ]:
algo.runIt(inst,I1,I2,'offAxis')

In [ ]:
print(algo.zer4UpNm)

plot the Zernikes Zn (n>=4)


In [ ]:
plots.plotZer(algo.zer4UpNm,'nm')

In [ ]:
plots.plotImage(algo.Wconverge,'Final wavefront')

In [ ]:
plots.plotImage(algo.Wconverge,'Final wavefront with pupil mask applied', mask=algo.pMask)