Running a loop from an example¶
cacao ships example loop configurations in AOloopControl/examples/. Each
example is a directory named <CONFNAME>-conf. Deploying an example is the
recommended way to start a new loop: copy the closest example, then edit it.
Available examples¶
The recommended starting point is scexao-vispyr-bin2. Its README.md walks
through a full simulated loop, from DM setup to closing the loop.
CONFNAME |
System |
LOOPNAME |
|---|---|---|
|
SCExAO visible pyramid WFS, 2x2 binned (recommended) |
|
|
SCExAO visible pyramid WFS, unbinned |
|
|
SCExAO |
|
|
SCExAO NIR photonic lantern |
|
|
SCExAO |
|
|
KalAO, Shack-Hartmann WFS and main DM |
|
|
KalAO, tip-tilt offload |
|
|
MMT MAPS, visible pyramid WFS |
|
|
Subaru AO3k |
|
|
Subaru AO3k |
|
|
Subaru AO3k |
|
|
Subaru AO3k NIR pyramid WFS |
|
|
Subaru AO3k tip-tilt offload |
|
The LOOPNAME column is the default set in each example’s cacaovars.bash.
Quickstart¶
From a work directory where you have read and write permission:
# Copy the configuration from the cacao source tree into the work directory
cacao-loop-deploy -c scexao-vispyr-bin2
# Optionally edit scexao-vispyr-bin2-conf/cacaovars.bash, then run the setup
cacao-loop-deploy -r scexao-vispyr-bin2
cacao-loop-deploy <CONFNAME>, without an option, copies and runs in one step.
cacao-loop-deploy -h lists all options and the available configurations. The
environment variables CACAO_LOOPNUMBER, CACAO_LOOPNAME, CACAO_DMINDEX and
CACAO_DMSIMINDEX override the corresponding values in cacaovars.bash:
CACAO_LOOPNUMBER=7 CACAO_DMINDEX="03" cacao-loop-deploy -c scexao-vispyr-bin2
Then use milk’s tools to control and monitor the loop:
milk-fpsCTRL # view and set function parameters, start/stop processes
milk-streamCTRL # monitor streams
milk-procCTRL # monitor processes
Loop operations are run from LOOPROOTDIR with the cacao-aorun-XXX-yyyy
commands. XXX gives the usual order of execution and yyyy describes the
step. For example:
cacao-aorun-001-dmsim start # start the DM simulator
cacao-aorun-005-takedark -n 2000
cacao-aorun-030-acqlinResp -n 4 HpokeC
Each command takes -h. The example’s README.md lists the full sequence.
Naming conventions¶
Four names identify a deployed loop:
- CONFNAME
The configuration name. The configuration lives in the directory
<CONFNAME>-conf.- LOOPNAME
The loop name, used for process names, tmux sessions and file names. Set by
CACAO_LOOPNAMEincacaovars.bash.- LOOPROOTDIR
The directory where cacao installs the loop’s files, and where most commands are run from. Set by
CACAO_LOOPROOTDIRincacaovars.bash.- LOOPRUNDIR
The subdirectory of
LOOPROOTDIRthat the processes run in. Set byCACAO_LOOPRUNDIRincacaovars.bash.
These can all be the same string when one configuration runs one loop in one directory. They differ when you deploy several copies of a loop, or keep several configurations for the same loop.
Configuration directory contents¶
<CONFNAME>-conf/
├── tasklist.txt tasks run by cacao-task-manager
├── cacaovars.bash loop variables and the processes cacao-setup starts
├── fpssetup.setval.conf (optional) parameter values applied by milk-fpsCTRL at launch
├── fpstmuxenv (optional) environment for processes in tmux
├── scripts/ (optional) loop-specific scripts
└── simLHS/ (optional) linear hardware simulation files
Setup tasks¶
cacao-loop-deploy -r runs the setup through cacao-task-manager, which
executes the tasks listed in tasklist.txt in order. Each task code XXX
corresponds to an executable cacaotask-XXX on the PATH.
cacao-task-manager -h <CONFNAME> # help
cacao-task-manager <CONFNAME> # list tasks and their status
cacao-task-manager -X 3 <CONFNAME> # run tasks up to and including task 3
A typical task list:
0 INITSETUP DONE READY Initial setup:
1 GETSIMCONFFILES DONE READY Get simulation files:
2 TESTCONFIG DONE READY Test configuration:
3 CACAOSETUP DONE READY Run cacao-setup:
Task numbers depend on the example: if an example has no GETSIMCONFFILES or
TESTCONFIG, CACAOSETUP is task 1.
- INITSETUP
Creates
LOOPROOTDIR, containingcacaovars.LOOPNAME.bashandfpssetup.setval.LOOPNAME.conf.- GETSIMCONFFILES
Downloads calibration files used to simulate the AO system.
- TESTCONFIG
Checks the configuration.
- CACAOSETUP
Runs
cacao-setupinLOOPROOTDIR. It readscacaovars.LOOPNAME.bash, creates the tmux sessions, launches the configuration processes, and starts amilk-fpsCTRLinstance in its own tmux session. Seecacao-setup -h.
Controlling processes through fpsCTRL¶
The milk-fpsCTRL instance started by CACAOSETUP reads commands from the
fifo <LOOPNAME>_fpsCTRL.fifo in the shared-memory directory
(/milk/shm/<LOOPNAME>_fpsCTRL.fifo by default). Scripts, including the
cacao-aorun-* commands, write to this fifo to set parameters and to start and
stop processes. You can do the same operations interactively in the
milk-fpsCTRL interface.
FPS directories¶
Each process managed by the function parameter structure (FPS) framework uses
these directories under LOOPROOTDIR/LOOPRUNDIR/:
fps.<fpsname>.dataWorking directory. Results are written here, both temporary files and output to keep.
fps.<fpsname>.confConfiguration directory, mostly input to the FPS.
fps.<fpsname>.archiveArchive directory, usually a symlink to another location.