Phase screens are computed with an Atmosphere
and a Source
object.
Lets import the ceo
module first.
import math
import numpy as np
import ceo
%pylab inline
The atmosphere is defined with
atm = ceo.GmtAtmosphere(0.15,60)
A constellation of 6 Laser guide stars evenly located on a 1 arcmin diameter circle is defined first,
NL = 60
NA = NL+1
lgs = ceo.Source("V",
zenith=np.ones(6)*30*math.pi/180/3600,
azimuth=np.linspace(0,5,6)*2*math.pi/6,
height = 90e3,
resolution=(NA,NA))
The telescope pupil is defined as the Giant Magellan Telescope and mask for the deformable mirror actuators is also set.
D = 25.5
#tel = ceo.Telescope(NL*16)
#dm = ceo.Telescope(NA)
tel = ceo.GMT(NL*16,D)
dm = ceo.Mask(NA,D)
A Centroiding
object is defined, it will contains the phase screen gradient corresponding to the LGS.
The fried_geometry
method computes the DM valid actuator mask according to the telescope pupil shape and the given intensity threshlod
.
The lgs
Source
object is masked with the dm mask.
d = D/NL
cog = ceo.Centroiding(NL,N_SOURCE=lgs.size)
cog.fried_geometry(dm, tel, 16, 0.5)
lgs.masked(dm)
dm_mask = dm.f
The phase screen gradient is computed with the Atmosphere
method get_phase_screen_gradient
.
The gradient is computed over a square lenslet array of size $N_L \times N_L$ with $d$ the pitch in meter.
The phase screen gradient is computed for a given Source
object that contains one or more guide stars.
The phase screen gradient can be computed for a given time delay.
The $c_x$ and $c_y$ centroids are saved in a Centroiding
object.
atm.get_phase_screen_gradient(cog,NL,d,lgs,0.0)
c = cog.c.host(units='arcsec')
imshow(c.reshape(NL*lgs.size*2,NL).transpose(),interpolation='none')
#ceog.heatmap(c.reshape(NL*6*2,NL).transpose(), filename=PLOTLY_PATH+"wavefront gradient")
The on-axis source is defined and is propagated throught the atmosphere:
src = ceo.Source("K",resolution=(NA,NA))
src.masked(dm)
atm.get_phase_screen(src,d,NA,d,NA,0.0)
From the phase gradient, the phase screen can be reconstructed with a linear minimim mean square error reconstructor (LMMSE).
A Lmmse
object is used to perform the phase estimation.
The parameters are:
Atmosphere
object,Source
object representing the guide star(s),Source
object representing the star(s) in the estimation direction(s),Mask
object representing the pupil,et = ceo.StopWatch()
et.tic()
src_lmmse = ceo.Lmmse(atm,lgs,src,d,NL,dm,"MINRES")
et.toc()
print "ET = %.2fms"%et.elapsedTime
et.tic()
src_lmmse.reset()
src_lmmse.estimation(cog)
et.toc()
src_phase = src.phase
src_lmmse_phase = src_lmmse.phase
print "ET = %.2fms"%et.elapsedTime
ps_e = src_lmmse_phase.host(units='micron',
zm=True,mask=dm_mask.host()) - src_phase.host(units='micron',zm=True,mask=dm_mask.host_data)
print "wavefront error: %6.2fnm" % (np.std(ps_e[dm_mask.host_data.reshape((NA,NA))!=0])*1e3)
imshow(np.concatenate((src_phase.host_data, src_lmmse_phase.host_data),axis=1),
interpolation='none')
colorbar()
imshow(ps_e*1e3,interpolation='none')
colorbar()