MAOS
Multithreaded Adaptive Optics Simulator
|
We assume that maos
is already in the PATH so we can type maos
to launch it.
Use the following command to get the help message:
The valid command line arguments are listed as follows
All user modifiable options are configured through config files with suffix .conf or key=value in the command line. The supplied default setup files are stored in sub-folder
config/maos
. The config files are organized in a modular way. One .conf file can include another
.conf file with
include=filename.conf
. The .conf files in
config/maos
file are self-documented.
All the options are in the form of key=value
. The usually convention is: if the entry in parms
called parms->wfs.thetax
, the entry in .conf file will be in the form wfs.thetax=value
.
Some of the rules are:
[] and separated by
,The config key=value
can be specified multiple times for any key, in which case the latter value will override the previous value, except when key+=value
is used which causes it to append instead. The software will complain and exit if any key=value
pair is not understood or required but not provided.
The recommended way to organize config files for a specific problem is to keep a baseline .conf file in sub-folder
config/maos
in the source folder that specify all the necessary key=value
entries through optionally including other .conf files. The default entry is
default.conf
unless -c file.conf
switch is supplied in the command line.
Embed the overriding options in the command line (embrace it with quote if the option contains spaces, like arrays) or put in one or multiple overriding file (in the simulation folder, not inside -c config/maos) to override the values you want to change from the baseline.
The .conf files in the
config/maos
folder are only modified during code development and should not be modified by the end user. Use overriding .conf files in simulation folders or embed configurations in the command line to modify the values.
In the config/maos
folder, there are a few sample .conf files that is complete for each configuration:
Each of this file include a few other .conf files by specifying
include=
, for example, all these baseline filename.conf
.conf files include the following common
.conf
files that is independent on the simulation mode or geometry.
The following list the exclusive .conf
files used to specified particular set of configurations. Each group should only appear once.
atm_*.conf
: set to a different preconfigured turbulence profile.dm_*.conf
: set deformable mirror configuration.fov_*.conf
: set the science FoV.wfs_*.conf
: set the wfs group typeFor example, the baseline configuration for TMT MCAO system mcao_lgs.conf
includes atm_mk13n50p.conf
to specify MK13N median seeing turbulence profile, dm_dual.conf
to specify dual DM system, wfs_lgs_ttf_tt.conf
to specify WFS configuration as LGS WFS plus TTF NGS WFS plus TT NGS WFS, evl_sq34.conf
to specify the science FoV as simpson weighting on 3x3 points in the square 34x34" FoV, and fit_sq34.conf
to sepcify the DM fitting FoV as simpson weighting on 3x3 points in the square 34x34" FoV.
For an MCAO configuration, the DM fitting FoV can be larger than the science FoV in order to sharpen diffraction limited TTF NGS. For an LTAO configuration, use fit_oa.conf
to set only on axis DM fitting FoV. A GLAO system can be simulated by having a single DM but with a wide DM fitting FoV, as an alternative to setting recon.glao=0
which averages WFS measurements before reconstruction.
See Examples for more detailed explanations.
To run predefined AO modes:
To run simulation for sample AO systems:
The default case starts with default.conf
. It can be overriden by the environment variable MAOS_DEFAULT=filename
.
To customize number of components
Change aperture
Change turbulence
Configuring WFS. Adjust the number of elements depending on how many powfs is in use. A powfs is a type of WFS. Each type can have multiple WFS.
Adjust the controller
There are options to allow probing for error budget items, such as DM fitting error, tomography error, etc.
Note that the option sim.closeloop=0 atm.frozenflow=1
uses open loop correction (no servo lag) with frozen flow turbulence. The option sim.idealtomo=1
enables DM fitting directly from turbulence rather than from tomography output. For open loop simulations, truth wfs should not be included or disabled with sim.eptwfs=0, and non-iterative solvers (tomo.alg=0, fit.alg=0) usually work better than CG.
The following error budget items are computed:
DM fitting error
: step1 gives DM fitting error which depends on the actuator spacing.DM projection error
: the quadrature difference between step1 and step1b gives DM projecting error which depends on the field of view and number of DMs.WFS aliasing error
: the quadrature difference between step1 and step2 gives WFS aliasing error.Tomography error
: the quadrature difference between the RSS of the three terms above and step2b is the tomography error which depends on the asterism geometry.Servo lag error
: the quadrature difference between step2b and step3 gives servo lag error.WFS nonlinearity error
: the quadrature difference between step3 and step4 gives WFS non-linearity error.WFS noise effect
: the quadrature difference between step4 and step5 gives WFS noise error.We can optionally setup one or more static surfaces that cover science fields and/or wavefront sensors. Each surface file must contain a 2-d array of the OPD with a header specifying the following keys. If header is not available, the OPD is assumed to have 1/64 sampling and centered on the pupil.
Optionally, the header can also include the following keys to indicate its coverage
Use the write
mex routine, writebin.m
, or aolib.writebin
to write the bin file:
Or simply use fits format. Put the list of surface file names in key surf
.
It is also possible to specify NCPA with inline configuration:
The double quote is necessary here to group the single quoted entries together.
The amplitude map of the telescope can be specified with aper.fnamp=aper.bin
with a similar data format, with OPD replaced by amplitude map between 0 and 1. By default, NCPA are calibrated, use ncpa.calib=0
to disable calibration
The WFS configuration are mostly supplied in powfs
, which applies to all the wfs belonging to this type. For wfs specific parameters, use wfs
. If there is a single number in powfs
.[key], it applies to all powfs. The follow lists a few common options
WFS specific parameters usually include WFS coordinate
MAOS only computes RMS averaged wavefront errors by default, which are saved to Res_
[seed].bin and c Resp_[seed].bin. When desired, PSFs computing can be enabled for some or all of the science evaluation directions. Modify evl.thetax
, evl.thetay
, and evl.wt
to modify evaluation directions and relative weighting for field averaging. Notice that this will significantly slow down the simulation. Use the following parameters to enable PSF computation.
Due to pupil obscuration, there may be actuators that are not sensed by the WFS and therefore cannot be accurately reconstructed. The actuator coupling coefficient, computed using DM fitting ray tracing (HA in Minimum variance reconstruction) or gradient interaction matrix (GA in least squares reconstruction), is used to determine how accurately an actuator is sensed/controlled. Activated by
lsr.actslave=1 #or 2, for lsr fit.actslave=1 #or 2, for mvr
actslave=1
enables implementation with threshold
.actthres. When an actuator is outside of the pupil, its coupling coefficient is usually very small. When it is below lsr.acthres, its value is slaved to its neighboring actuators.actslave=2
in addition enables implementation with threshold
.actthres2. When an actautor is hidden by secondary mirror support struts, it may still have relatively strong coupling, but regions separated by the structs may have different piston values, so called island effect. The mitigation method is to limit the value gap around such actautors whoes coupling is below .actthres2.The sodium range variation is specified through the LLT configuration key llt.fnrange
in llt_CL.conf or llt_SL.conf. When supplied by user, use powfs0_llt.fnrange
. The file should contain additional change (wrt fnprof) of sodium height in meters with dimension nx1 or nxnLGS where n
can be less than, equal to or greater than the length of simulation and nLGS is the number of LGS in this powfs (6 for NFIRAOS).
The range variation is simulated by adding corresponding focus mode to LGS WFS wavefront.
The Rayleigh backscatter effect can be introduced using powfs.bkgrndfn=[filename,]
which contains simulation background level for each pixel defined at sim.dtref
. The file contains a cell array of nsa*nlgswfs
while each cell contains a npixpisax*npixpsay
numerical array. nlgswfs
is the number of wfs
for this powfs
.
The sky coverage simulation is done in two parts. maos
is run first used to prepare NGS mode and WFS PSF time series:
maos
-c nfiraos_lgs.conf skyc_10.conf -o 50p_za0_ncpa
The second step is to run skyc
in the sky sim folder cd
50p_za0_ncpa/skysim skyc
-d -o APD_JHKs_typeImr
The results are stored in Res1_1.bin
for maos
seed 1, skyc
seed 1. There are nsky=500
columns with the following row definitions:
maos
simulations) errorSee Simulation Results for further explanation and results interpretation.