yao
Links
Main pageInstallation
Examples and Scripts
Performance
Data structures and parfiles
Controlling Features
Screenshots
Algorithms
Yao tk dynamic control
News/Weblog
Data Structures
This page contains a description of the data structures defined at the end ofaosimul.i
, version 3.4
These structures are defined in extern in aoread()
, so they are accessible from all levels.
Only shown are the structure elements that are accessible from the parfile.The structures contain other internal variables not shown here, but that may be tinkered with. For curious users, see the structure definitions at the end of aosimul.i
.
Examples of parfiles for version 3.4 can be found in the yao/example subdirectory of the release package (*.par files).
/* DOCUMENT wfs, dm, atmospheric, etc.. structures: Main structures for the AO simul package parameters If additional parameters are needed, they should be entered in these structures definition and changes reflected in the parameter file (e.g. sh12.par) There are several type of entries: - long, float, string scalars: e.g. > atm.dr0at05mic = 33.; - pointers: These are pointers to variables that can have arbitrary number of elements. You have to define them in the following way: > wfs.nsubperring = &( [6,12,18] ); Structure members can be accessed in the following way: var = dm.type; var = *atm.layerfrac; // "*" dereference a pointer If there are several instance of a given structure: for instance, it is common to have a system with several dm: dm.type is thus a vector of the types of all instance of structure "dm" dm(1).type is a scalar *wfs(1).nsubperring is a vector. (*wfs(1).nsubperring)(1) is the first element of this vector. The variables with a "_" in front of them are internal variables. they are set and used while the program is running. You can still access them, and possibly modify them to reach a particular purpose. The following generic structures are instanced into structures of the same name, without the "_struct" appended, when the parameter file is read. For instance, "atm" will be the structure containing the atmospheric parameters as defined in the generic type atm_struct below. SYNTAX OF THE COMMENTS BELOW For each entries, we give the type (scalar, vectorptr -vector pointer-, etc), what the parameter is, possible comments, whether the parameter is required or optional, and the default between []. As a general comment: when the structures are instanciated, all their elements get a default value. This is zero (0) for a float or long (scalar or vector), empty string for a string, and 0x0 for a pointer. modified 2004july for aosimulv3.0 to 3.3 modified 2004jan-mar for aosimulv2.4 to 3.0 modified 2003dec20-24 for aosimul-v2.3 modified 2003dec19 for aosimul-v2.2 modified 2003feb19 for aosimul-v1.2 AUTHOR: F.Rigaut, beginning 2002 SEE ALSO: All ao simul functions (aoread, aoinit, aoloop). */ struct sim_struct { string name; // A name for this simulation run. Optional [none] long pupildiam; // Pupil diameter in pixels. Required [none] long debug; // set the debug level (0:no debug, 1:some, 2: most). Optional [0] long verbose; // set the verbose level (0:none, 1: some, 2: most). Optional [0] } struct atm_struct { float dr0at05mic; // Dr0 at sensing wavelength. Required [none] pointer screen; // string vectorptr. Screen file names. Required [none] pointer layerfrac; // float vectorptr. Layer fraction. Sum to one is insured // in aoinit. Required [none] pointer layerspeed; // float vectorptr. Layer speed. Required [none] pointer layeralt; // float vectorptr. Layer altitude (m). Specified at Zenith. // Required [none] pointer winddir; // Wind dir (use 0 for now) } struct wfs_struct { string type; // WFS type: "curvature", "hartmann" or "pyramid". Required [none] long subsystem; // Subsystem this WFS belongs to. Optional [1] float lambda; // WFS wavelength in microns. Required [none] long noise; // Enable noise (photon noise/read out noise). Optional [0=no]. float ron; // Read out noise in electrons. Optional [0] float darkcurrent; // dark current in e-/sec/pixel or APD. Optional [0] float gspos(2); // This WFS GS position (x<y) in arcsec. Optional [0,0] float gsalt; // This WFS guide star altitude in meter. 0 for infinity. // Specified at zenith. Optional [0] float gsdepth; // This WFS GS depth in meter (e.g. Na layer thickness). // Specified at zenith. Optional [0] float laserpower; // this wfs laser power (Na laser only), in Watts projected on sky. // Required when using lasers. Exclusive with gsmag; i.e. define one // OR the other. gs. float gsmag; // This WFS guide star magnitude. Optional [0]. For LGSs, see above. float skymag; // This WFS sky mag. Optional [no sky] long filtertilt; // Filter TT on this sensor? Optional [0=no] long correctUpTT; // Correct up link tp-tilt ? Optional [0=no] float uplinkgain; // Up link TT loop gain. Optional [0] float dispzoom; // Zoom factor for the display (typically around 1). Optional [1] float optthroughput; // optical throughput to WFS. Optional [1.0] // Curvature WFS only keywords: pointer nsubperring; // Long vectorptr. # subapertures per ring. Required [none] float l; // Extra focal distance in a F/60 beam. Required [none] float fieldstopdiam; // diameter of field stop in arcsec. Optinal [1]. used only // to compute sky contribution (with skymag). // Shack-Hartmann WFS only keywords: // Shack-Hartmann WFS only keywords: long shmethod; // 1 = simple gradient average, 2=full propagation. Required [none] long shnxsub; // # of subaperture in telescope diameter. Required [none] float pixsize; // Subaperture pixel size in arcsec. Required [none] long npixels; // Final # of pixels in subaperture. Required [none] float shthreshold; // Threshold in computation of subaperture signal, >=0. Optional [0] float biasrmserror; // rms error on WFS bias in electron. Optional [0] float flatrmserror; // rms error on WFS flat, referenced to 1. Optional [0] // Typical value can be 0.01 float kernel; // FWHM in arcsec of gaussian kernel for iMat calibration. Optional. // Default is computed as a functioin of D/r0 int nintegcycles; // # of cycles/iterations over which to integrate. Optional [1] float fracIllumin; // sub. fraction illuminated to be valid. Optional [0.5] float LLTxy(2); // 2 element vector with (x,y) of laser projector [m] long centGainOpt; // Centroid Gain optimization flag. only for LGS (correctupTT and // filtertilt must be set). Optional [0] int rayleighflag; // set to one to take rayleigh into account } struct dm_struct { string type; // "bimorph", "stackarray" "tiptilt", "zernike", "aniso". // Required [none] long subsystem; // Subsystem this DM belongs to. Optional [1] string iffile; // Influence function file name. Leave it alone. float alt; // Conjugation altitude in meter. Optional [0] float hyst; // DM actuator hysteresis (0. to 1.). Optional [0] float push4imat; // Voltage to apply for imat calibration. Optional [20]. // Note: the default is not OK for many configs. Change at will. float thresholdresp; // Normalized resp. thresh. for an act. to be valid. Optional [0.3] float unitpervolt; // Influence function sensitivity in unit/volt. Optional [0.01] // Stackarray: mic/volt, Tip-tilt: arcsec/volt. float maxvolt; // Saturation voltage (- and +) in volt. Optional [none if not set] float gain; // loop gain for this DM (total = this x loop.gain). Optional [1] float misreg(2); // dm misregistration (pixels). optional [0,0] // Bimorph-only keywords: pointer nelperring; // long vectorptr. # of elec. per ring, e.g &([6,12,18]). // Required [none] // Stackarray-only keywords: long nxact; // # of act. in pupil diameter. Required [none] long pitch; // Actuator pitch IN PIXEL. Required [none] float pitchMargin; // margin to include more corner actuators when creating inf.functions // optional [1.44] float coupling; // coupling coef in influence function. optional [0.2]. // valid values from 0.04 to 0.30. string ecmatfile; // valid to extrap. actuator matrix (extrap_com). Optional. long noextrap; // set to 1 if no extrapolated actuators whatsoever are to be used [0] long elt; // set to 1 if fast dmsum to be used // Zernike-only keywords: long nzer; // Number of modes, including piston. Required [none] } struct mat_struct { pointer condition; // float vecorptr. Condition numbers for SVD, per subsystem. // Required [none] string file; // iMat and cMat filename. Leave it alone. } struct tel_struct { float diam; // Telescope diameter in meters. Required [none] float cobs; // Central obstruction / telescope diameter ratio. Optional [0] } struct target_struct { pointer lambda; // float vectorptr. Image wavelengths in micron. Required [none] pointer xposition; // float vectorptr. X positions in arcsec. Required [none] pointer yposition; // float vectorptr. Y positions in arcsec. Required [none] pointer dispzoom; // float vectorptr. Display zoom (typically around 1.). Optional [1.] } struct gs_struct { float zeropoint; // Photometric zero point (#photons@pupil/s/full_aper, mag0 star). // Required [none] float zenithangle; // zenith angle. Optional [0.]. The zenith angle is used to compute: // - r0 off-zenith // - atmopheric turbulence layer altitude // - LGS altitude and thickness of Na Layer // - LGS brightness // note that dm altitude is unchanged. float lgsreturnperwatt; // Sodium LGS return in photons/cm2/s at entrance pupil. // Specified at zenith. Modified by gs.zenithangle. Optional [22.] // basically, you have to fold in this the sodium density // and your model of return. } struct loop_struct { float gain; // Loop gain. Required [0] long framedelay; // # of frame delay ON TOP OF normal 1 frame delay. Optional [0] long niter; // # of total iteration. Required [none] float ittime; // Iteration time in seconds. Required [none] long startskip; // # iter to skip before collecting statistics. Optional [10] long skipevery; // skip by "skipby" every "skipevery" iterations. Optional [0=none] long skipby; // see above. this is to get better statistical // coverage. Optional [10000] long jumps2swapscreen;// # of jumps (i.e. niter/skipevery) after which screens // will be swapped (rotation, 2->1, 3->2... 1->last string modalgainfile; // Name of file with mode gains. Optional. }