// YAO parameter file
//-------------------------------
sim.name            = "Simili Altair LGS, full diffraction WFS, spot elongation";
sim.pupildiam       = 120;
sim.debug           = 0;
sim.verbose         = 0;

//-------------------------------
atm.dr0at05mic      = 40.;
atm.screen          = &(Y_USER+"data/screen"+["1","2","3","4"]+".fits");
atm.layerfrac       = &([0.4,0.2,0.3,0.1]);
atm.layerspeed      = &([11.,20,29,35]);
atm.layeralt        = &([0.,400,6000,9000]);
atm.winddir         = &([0,0,0,0]);

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

n   = 1;
wfs(n).type         = "hartmann";
wfs(n).subsystem    = 1;
wfs(n).lambda       = 0.65;
wfs(n).gspos        = [0.,0.];
wfs(n).gsalt        = 95000.;
wfs(n).gsdepth      = 10000.;
wfs(n).laserpower   = 25.;
wfs(n).skymag       = 20.;
wfs(n).shmethod     = 2;
wfs(n).shnxsub      = 12;
wfs(n).pixsize      = 0.5;
wfs(n).npixels      = 4;
wfs(n).shthreshold  = 0.;
wfs(n).nintegcycles = 1;
wfs(n).filtertilt   = 1;
wfs(n).correctUpTT  = 1;
wfs(n).uplinkgain   = 0.1;
wfs(n).kernel       = 1.0
wfs(n).dispzoom     = 2.;
wfs(n).noise        = 1;
wfs(n).ron          = 5;

n   = 2;
wfs(n).type         = "hartmann";
wfs(n).subsystem    = 2;
wfs(n).lambda       = 0.65;
wfs(n).gspos        = [0.,0.];
wfs(n).gsalt        = 0.;
wfs(n).gsmag        = 15.;
wfs(n).skymag       = 18.5;
wfs(n).shmethod     = 2;
wfs(n).shnxsub      = 1;
wfs(n).pixsize      = 0.5;
wfs(n).npixels      = 4;
wfs(n).shthreshold  = 0.;
wfs(n).nintegcycles = 1;
wfs(n).dispzoom     = 0.15;
wfs(n).noise        = 1;
wfs(n).ron          = 5;
wfs(n).darkcurrent  = 200;


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

n  =1;
dm(n).type          = "stackarray";
dm(n).subsystem     = 1;
dm(n).iffile        = "";
dm(n).nxact         = 13;
dm(n).pitch         = 10;
dm(n).alt           = 0.;
dm(n).unitpervolt   = 0.01;
dm(n).push4imat     = 50;
dm(n).elt           = 1;
dm(n).coupling      = 0.15;

n  =2;
dm(n).type          = "tiptilt";
dm(n).subsystem     = 2;
dm(n).iffile        = "";
dm(n).alt           = 0.;
dm(n).unitpervolt   =  0.0005;
dm(n).push4imat     = 10;
dm(n).gain          = 0.3;

//-------------------------------
mat.condition       = &([15.,15.]);
mat.file            = "";

//-------------------------------
tel.diam            = 7.9;
tel.cobs            = 0.1125;

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

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

//-------------------------------
loop.gain           = 0.6;
loop.framedelay     = 1;
loop.niter          = 1000;
loop.ittime         = 2e-3;
loop.startskip      = 10;
loop.skipevery      = 1000;
loop.skipby         = 10000;
loop.modalgainfile  = "simulModeGains.fits";

//-------------------------------
