// YAO parameter file
//-------------------------------

//-------------------------------
tel.diam	   = 8;
tel.cobs	   = 0.;

sim.name           = "Toy simulation using mmse matrix reconstructor"
sim.pupildiam      = 128;
sim.debug          = 0;
sim.verbose        = 2;
  
YAO_SAVEPATH="~/.yorick/yao/"; // where to save the output to the simulations

//-------------------------------
nwfs               = 1; // number of WFSs (>1 if e.g. mcao)
wfs = array(wfss,nwfs);

n   = 1;
wfs(n).type	   = "hartmann";
wfs(n).lambda	   = 0.65;
wfs(n).gspos       = [0.,0.];
wfs(n).gsalt       = 0.;
wfs(n).gsmag       = 5.;
wfs(n).shmethod	   = 2;
wfs(n).shnxsub	   = 16;
wfs(n).npixpersub  = 8;
wfs(n).pixsize     = 0.3;
wfs(n).npixels     = 6;
wfs(n).noise       = 1;
wfs(n).ron         = 3.5;
wfs(n).shthreshold = 0.;
wfs(n).nintegcycles= 1;

//-------------------------------
ndm                = 2;
dm = array(dms,ndm);

n = 1;
dm(n).type	   = "stackarray";
dm(n).iffile	   = "";
dm(n).nxact	   = 17;
dm(n).pitch	   = 8;
dm(n).alt          = 0.;
dm(n).unitpervolt  = 0.01;
dm(n).push4imat    = 100;
dm(n).elt          = 1;
dm(n).gain         = 1.;
dm(n).regparam     = 1e-4;
dm(n).regtype      = "laplacian";

n = 2;
dm(n).type	   = "tiptilt";
dm(n).iffile	   = "";
dm(n).alt          = 0.;
dm(n).unitpervolt  = 0.0001;
dm(n).push4imat    = 100;
dm(n).gain         = 0.8;
dm(n).regparam     = 0.;

//-------------------------------
mat.method         = "mmse";

//-------------------------------
target.lambda	   = &([2.2]);
target.xposition   = &([0.]);
target.yposition   = &([0]);
target.dispzoom    = &([1.]);

r0 = 0.13
//-------------------------------
atm.dr0at05mic     = tel.diam/r0;
atm.screen	   = &(Y_USER+"data/screen"+["1","2"]+".fits");
atm.layerfrac      = &([0.6,0.4]);
atm.layerspeed     = &([12.,15.]);
atm.layeralt	   = &([0.,5000]);
atm.winddir        = &([0.,0.]);

//-------------------------------
gs.zeropoint	   = 1e11;

//-------------------------------
loop.gain	   = 0.5;
loop.framedelay    = 2;
loop.niter	   = 1000;
loop.ittime	   = 0.001;
loop.startskip     = 10;
loop.skipevery     = 10000;
loop.skipby        = 10000;
loop.stats_every   = 10;
loop.modalgainfile = "simulModeGains.fits";

 

