It's advised to use a virtual environment, either venv or conda. Using conda is advised on the latest Mac architecture. See below for installation with conda.
If you are using Linux, skip to the Installing PyORBIT step. If you are installing on a macOS, you will need to install EPICS. After installing EPICS, add the following line to your bash_profile:
export PYEPICS_LIBCA=${EPICS_BASE}/lib/${EPICS_HOST_ARCH}/libca.dylibYou need to have PyORBIT3 installed in the same virtual environment.
The following will install the virtual accelerator in development mode, so you can edit the code and and immediately see the results without re-installation.
pip install -e .
pip list
# virtaccl should be in the list of installed packagesAlternatively, to install in isolated mode (into your site-packages).
pip install .or even without cloning the repository
pip install git+https://URL_OF_YOUR_REPO/virtual-accelerator.gitThis will install EPICS, PyORBIT3, the virtual accelerator, and define the needed environment variables. You will have the standard EPICS command line tools installed as well.
conda env create -f virac.yml
conda activate viracYour client environment, the one that connects to virtual accelerator, should have localhost included in CA search, so some setup may be needed.
For example, the following will ensure that the client connects to the virtual accelerator only while allowing large array transfers.
export EPICS_CA_ADDR_LIST=localhost
export EPICS_CA_AUTO_ADDR_LIST=NO
export EPICS_CA_MAX_ARRAY_BYTES=10000000To see help:
sns_va -hRun default MEBT -> HEBT1
sns_vaRun MEBT only (with printing all PVs)
sns_va --debug MEBTThere are two client program (they connect to VA) examples:
- Corrector.py scans SCL_Mag:DCH00 and prints out horizontal position at SCL_Diag:BPM04
- Wire.py performs a scan of MEBT_Diag:WS14 (PVs are fictional)
Both examples need VA running as a separate process (in a standalone terminla window),
default virtual_accelerator command will work.
To launch an example run
python -m virtaccl.examples.Corrector To see help:
btf_va -hRun with default bunch
btf_va --debugBTF example file:
python -m virtaccl.examples.BTF_Mag_Test To see help:
idmp_va -hRun with default bunch
idmp_va --debug