Skip to content
Snippets Groups Projects
README.md 1.71 KiB
Newer Older
# ophyd-tango-demo
Linus Pithan's avatar
Linus Pithan committed

## Getting started / preparation of the environment
Linus Pithan's avatar
Linus Pithan committed

Starting point of what is described is an empty mamba/conda environment
Linus Pithan's avatar
Linus Pithan committed

- prepare the mamba/conda env
Linus Pithan's avatar
Linus Pithan committed
```
Linus Pithan's avatar
Linus Pithan committed
mamba install --file requirements.txt -c conda-forge
Linus Pithan's avatar
Linus Pithan committed
```

- fetch the git submodule `ophyd-async` https://github.com/desy-fsec/ophyd-async.git 
- install ophyd+bluesky
Linus Pithan's avatar
Linus Pithan committed

```
cd ophyd-async/
Linus Pithan's avatar
Linus Pithan committed
git submodule init
git submodule update
pip install -e .
cd ..
```
Linus Pithan's avatar
Linus Pithan committed

- run `docker-compose` to start the tango db and device servers
Linus Pithan's avatar
Linus Pithan committed

```
docker-compose up -d
```
Linus Pithan's avatar
Linus Pithan committed

## run the first demo script
Linus Pithan's avatar
Linus Pithan committed

based on `ophyd-async/docs/user/examples/tango_scan.py`. a modified version 
of this file is in the root of this repo that uses the tango path available in 
the docker container.
Linus Pithan's avatar
Linus Pithan committed

```
TANGO_HOST=localhost:10000 python tango_scan.py
```
Linus Pithan's avatar
Linus Pithan committed

Note 1: make sure that the environment variable `TANGO_HOST` is set so that the python process can connect to the tango db inside the docker container
Linus Pithan's avatar
Linus Pithan committed
Note 2: it may take a few seconds before the scan starts. ... for the first scan it may even take almost a minute before the scan actually runs.
Linus Pithan's avatar
Linus Pithan committed

## Resources
- the forked ophyd-async repo with tango support: https://github.com/desy-fsec/ophyd-async.git 
- docker container + docker compose to run a tango DB + servers (preconfigured like at DESY): 
  https://gitlab.desy.de/marcus.fleck/fsecservers-in-default-tango-cs-docker
## to inspect Tango 
  in order to inspect the tango DB the most common tool to use would be `jive`. If conda is at hand, it 
  can e.g. installed using the conda env file provided in `tango_tool_env/tango_tools.yml` with 
  ```
  conda env create -n tango_tools --file tango_tool_env/tango_tools.yml
  conda activate tango_tools
  TANGO_HOST=localhost:10000 jive
  ```