-
Notifications
You must be signed in to change notification settings - Fork 0
/
txm-control
executable file
·82 lines (60 loc) · 2.54 KB
/
txm-control
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
# WARNING : This file is managed by ansible scripts.
# Any changes to this are periodically overwritten.
. /opt/conda/etc/profile.d/conda.sh
# tack on additional PYTHONPATH information
if [ ! -z "$BS_PYTHONPATH" ]; then
if [ ! -z "$PYTHONPATH" ]; then
export PYTHONPATH=$PYTHONPATH:$BS_PYTHONPATH
else
export PYTHONPATH=$BS_PYTHONPATH
fi
fi
# If the above has not defined BS_AN_ENV and BS_AN_PROFILE we will error out
# violently on `conda activate` below.
conda_cmd="conda activate $BS_ENV"
$conda_cmd || exit 1
# Conditionally invoke LD_PRELOAD workaround for 2020-2 profiles.
if [[ "${BS_ENV}" == *"2020-2"* ]]; then
echo "Adding LD_PRELOAD"
export LD_PRELOAD=/opt/conda_envs/${BS_ENV}/lib/libgomp.so
fi
ipython_cmd="ipython --profile=$BS_PROFILE --IPCompleter.use_jedi=False /nsls2/data/fxi-new/shared/software/fxi_control/txm_control.py"
#ipython_cmd="ipython --profile=$BS_PROFILE --IPCompleter.use_jedi=False /home/xf18id/Downloads/test_qt_ipython.py"
$conda_cmd || exit 1
args=$(python -c 'import sys; print(" ".join([x if " " not in x else repr(x) for x in sys.argv[1:]]))' "$@")
cat << EOL
$(tput smul; tput bold)Versions of DAMA software:$(tput sgr0)
$(python -c '\
msg = "Not installed"
try:
import bluesky
bluesky_version = "v{}".format(bluesky.__version__)
except ImportError:
bluesky_version = msg
try:
import ophyd
ophyd_version = "v{}".format(ophyd.__version__)
except ImportError:
ophyd_version = msg
try:
import databroker
databroker_version = "v{}".format(databroker.__version__)
except ImportError:
databroker_version = msg
print(" - Bluesky : {}".format(bluesky_version))
print(" - Ophyd : {}".format(ophyd_version))
print(" - Databroker : {}".format(databroker_version))
')
$(tput smul; tput bold)Links to Bluesky and Databroker tutorials:$(tput sgr0)
- $(tput setaf 4)http://nsls-ii.github.io/bluesky/tutorial.html$(tput sgr0)
- $(tput setaf 4)http://nsls-ii.github.io/databroker/tutorial.html$(tput sgr0)
If you get lost or confused, then we want to know! We have a friendly chat channel:
$(tput bold; tput setaf 1)https://gitter.im/NSLS-II/DAMA$(tput sgr0)
or you can file a bug to let us know where our documentation could be made more clear:
$(tput bold; tput setaf 1)https://github.com/NSLS-II/Bug-Reports/issues$(tput sgr0)
$(tput bold)bsui$(tput sgr0) is running these commands now to start an interactive computing environment for data acquisition:
$ ${conda_cmd}
$ ${ipython_cmd} ${args}
EOL
$ipython_cmd "$@"