LRIS2 Instrument Control Software
daemons/– libby hardware daemons, one script per device typeconfig/– one YAML per daemon instance, named for itspeer_idsystemd/– per-instance env files and the host setup scriptgui/– Graphical interfaces (slitmaskgui,demo)scripts/– AIT and utility scriptssrc/driver/– Hardware driver submodulestests/– Unit tests
# 1) Clone
git clone <repo-url>
cd lris2
# 2) Make sure submodule URLs are in sync
git submodule sync --recursive
git submodule update --init --recursive
# 3) Install the package for development
pip install -U pip
pip install -e ".[dev]"daemons/camera serves the Archon as lris2.rcam: the generic camera
keywords, every declared bias channel, and the HeaterX setpoints and
temperatures. It needs more than the other daemons, since it drives camerad
in-process rather than over a socket:
pip install -e ".[camera]"
pip install <lris2-camerad-instrument> # builds the camera_interface module
daemons/camera -c config/r/rcam.yamlOn a deployed host it runs as a service and both checkouts live under
/opt/lris2; see systemd/README.md.
Reading does not need the detector powered. Opening the link is enough:
libby modify lris2.rcam.isopen true
libby show "lris2.rcam.%"A keyword write needs loadfirmware first, so the controller holds the
configuration camerad parsed; a write patches a single configuration line and
the line numbers have to agree. The controller also refuses to apply a bias
change while the detector is unpowered.
config/r/rcam.yaml names every channel that gets a keyword, and carries
the voltage limits for the four module 4 rails that have them.
This repo uses submodules under src/driver/:
| Submodule | Path | Import |
|---|---|---|
| coo-ethercat | src/driver/coo_ethercat |
lris2.driver.coo_ethercat |
| lris2-csu | src/driver/lris2_csu |
lris2.driver.lris2_csu |
| sunpower | src/driver/sunpower |
lris2.driver.sunpower |
git submodule sync --recursive
git submodule update --init --recursiveOnly do this if you intend to move submodule pointers and commit them.
# One-off refresh to submodules' tracked branches
git submodule update --remote --merge --recursive
# Record updated pointers in parent repo
git add .gitmodules .
git commit -m "Update submodules to latest on main"Each daemon takes its config with -c and serves keywords over libby
(RabbitMQ by default), addressed as lris2.<peer_id>.<keyword>:
daemons/vacuum-gauge -c config/lris2_rpress.yaml
libby show lris2.rpress.pressure1The libby CLI reads ~/.libby/cli_config.yaml; on the instrument host it
needs only:
transport: rabbitmq
rabbitmq_url: amqp://localhostFor running daemons as services, see systemd/README.md.
Tests mirror the src/ layout under tests/.
To run tests from the project root:
pytest- Create a feature branch.
- Include tests for new behavior.
- Run
pytestbefore opening a PR.