diff --git a/anaconda_env b/anaconda_env new file mode 100644 index 0000000..897bb71 --- /dev/null +++ b/anaconda_env @@ -0,0 +1,15 @@ +#!/bin/bash + +#if [ $# != 1 ]; then +# echo "Usage: $0 [alvra|bernina]" +# exit 1 +#fi + +dest=/sf/bernina/anaconda/4.4.0 + +echo Loading PSI Anaconda Python distribution 3.6 +module load psi-python36/4.4.0 + +echo Activating BERNINA Conda environment +source activate $dest + diff --git a/chromeAs b/chromeAs new file mode 100755 index 0000000..8c15ad4 --- /dev/null +++ b/chromeAs @@ -0,0 +1,11 @@ +#!/bin/bash +#function set-title() { +# if [[ -z "$ORIG" ]]; then +# ORIG=$PS1 +# fi +# TITLE="\[\e]2;$*\a\]" +# PS1=${ORIG}${TITLE} +#} +#set-title "chrome terminal" + +gnome-terminal -e "su $1 -c google-chrome" diff --git a/correlation_panel b/correlation_panel new file mode 100755 index 0000000..dca7bf3 --- /dev/null +++ b/correlation_panel @@ -0,0 +1,10 @@ +#!/bin/bash + +/opt/gfa/pshell/pshell \ + -jvmarg="-Duser.home=/sf/bernina/data" \ + -dlaf \ + -home=/sf/bernina/config/pshell_be \ + -data=/sf/bernina/config/pshell_data \ + -l -d -k -q -b \ + -p=Correlation.java $@ + diff --git a/eco b/eco index 72fa0fd..7082696 100755 --- a/eco +++ b/eco @@ -1,7 +1,7 @@ #/bin/bash source /opt/gfa/python export PYTHONPATH=$PYTHONPATH:/sf/bernina/config/src/python -ipython --no-banner -c "\ +ipython --pylab --no-banner -c "\ print(' ___ _______\n / -_) __/ _ \ \n Experiment Control \__/\__/\___/ \n\n');\ from eco.instruments import bernina;\ from eco.instruments.bernina import *;\ diff --git a/ecotest b/ecotest new file mode 100755 index 0000000..17b68c8 --- /dev/null +++ b/ecotest @@ -0,0 +1,10 @@ +#/bin/bash +#source /opt/gfa/python +source activate /sf/bernina/jungfrau/envs/jungfrau_client +export PYTHONPATH=$PYTHONPATH:/sf/bernina/config/src/python +ipython --no-banner -c "\ +print(' ___ _______\n / -_) __/ _ \ \n Experiment Control \__/\__/\___/ \n\n');\ +from eco.instruments import bernina;\ +from eco.instruments.bernina import *;\ +" -i + diff --git a/jungfrau_console b/jungfrau_console new file mode 100755 index 0000000..c346f1e --- /dev/null +++ b/jungfrau_console @@ -0,0 +1,23 @@ +#!/bin/bash + +BL=bernina +check=`which conda 2> /dev/null | grep /$BL/anaconda/4.4.0` + +if [ "$check" == "" ]; then + source /sf/$BL/bin/anaconda_env +fi + +MATPLOT_TRY='exec("try: import matplotlib.pyplot as plt\nexcept: sys.exit(1)");' + +CONFIG='import sys; from detector_integration_api import DetectorIntegrationClient; api_address = "http://sf-daq-1:10000"; client_1p5 = DetectorIntegrationClient(api_address); print("\nJungfrau Integration API on %s" % api_address);import h5py;import numpy as np;'$MATPLOT_TRY'import dask.array as da;print("Imported matplotlib (as plt), h5py, numpy (as np), dask.array (as da)"); exec("""if "client_1p5" in locals(): print("Jungfrau 1.5M client available as client_1p5. Try: client_1p5.get_status() ") """);' + +echo Starting Interactive Python session +export QT_XKB_CONFIG_ROOT=/sf/alvra/anaconda/4.4.0/jungfrau_utils/lib +if [ "$1" == "nox" ]; then + export QT_QPA_PLATFORM='offscreen' + echo "Starting no-graphics version" +else + echo If you get \"Could not connect to display\" or similar, try: \"jungfrau_console nox\" +fi +ipython -i -c "$CONFIG" + diff --git a/jungfrau_console_nox~ b/jungfrau_console_nox~ new file mode 100755 index 0000000..7edef8d --- /dev/null +++ b/jungfrau_console_nox~ @@ -0,0 +1,18 @@ +#!/bin/bash + +BL=bernina +check=`which conda | grep /$BL/anaconda/4.4.0` + +if [ "$check" == "" ]; then + source /sf/$BL/bin/anaconda_env +fi + +MATPLOT_TRY='exec("try: import matplotlib.pyplot as plt\nexcept: sys.exit(1)");' + +CONFIG='import sys; from detector_integration_api import DetectorIntegrationClient; api_address = "http://sf-daq-1:10000"; client_1p5 = DetectorIntegrationClient(api_address); print("\nJungfrau Integration API on %s" % api_address);import h5py;import numpy as np;'$MATPLOT_TRY'import dask.array as da;print("Imported matplotlib (as plt), h5py, numpy (as np), dask.array (as da)"); exec("""if "client_4p5" in locals(): print("Jungfrau 1.5M client available as client_1p5. Try: client_1p5.get_status() ") """);' + +echo Starting Interactive Python session - no graphical display version +export QT_XKB_CONFIG_ROOT=/sf/alvra/anaconda/4.4.0/jungfrau_utils/lib +export QT_QPA_PLATFORM='offscreen' +ipython -i -c "$CONFIG" + diff --git a/launcher b/launcher index 87d6380..0adfd6c 100755 --- a/launcher +++ b/launcher @@ -7,3 +7,6 @@ if [ "$#" -eq 0 ]; then else pylauncher -m /sf/bernina/config/launcher_mapping $@ fi +sleep 5 +wmctrl -r "SF-Bernina Launcher" -b add,above + diff --git a/launcher_dev b/launcher_dev new file mode 100755 index 0000000..ce58414 --- /dev/null +++ b/launcher_dev @@ -0,0 +1,9 @@ +#!/bin/bash + +source /opt/gfa/python 3.5 + +if [ "$#" -eq 0 ]; then + pylauncher -m /sf/bernina/config/launcher_mapping --position 80 -120 /sf/bernina/config/launcher_dev/S_Bernina.json +else + pylauncher -m /sf/bernina/config/launcher_mapping $@ +fi diff --git a/pshell_be b/pshell_be new file mode 100755 index 0000000..82cfe73 --- /dev/null +++ b/pshell_be @@ -0,0 +1,13 @@ +#!/bin/bash + +/opt/gfa/pshell/pshell \ + -jvmarg="-Duser.home=/sf/bernina/data" \ + -last \ + -dlaf \ + -r \ + -py3 \ + -home=/sf/bernina/config/pshell_be \ + -data=/sf/bernina/config/pshell_data \ + -strh=/sf/bernina/config/pshell_be/stripchart \ + $@ + diff --git a/record_camera b/record_camera new file mode 100755 index 0000000..22e20c4 --- /dev/null +++ b/record_camera @@ -0,0 +1,13 @@ +#!/bin/bash + +if (( $# != 2 )); then + echo "usage: $0 " + exit -1 +fi + +CAMERA_NAME=$1 +FILENAME=$2 + +STREAM=$(curl -s http://sf-daqsync-01:8889/api/v1/pipeline/instance/${CAMERA_NAME}_sp1 | sed -e 's/.*"stream": "\([^"]*\)".*/\1/') +echo $STREAM +bs h5 -s $STREAM -m sub $FILENAME diff --git a/remoteDesktop b/remoteDesktop new file mode 100755 index 0000000..501dba9 --- /dev/null +++ b/remoteDesktop @@ -0,0 +1,2 @@ +#!/bin/bash +xfreerdp -u $1 --no-nla -d PSICH -g 2000x1000 $2 diff --git a/screen_panel b/screen_panel new file mode 100755 index 0000000..a724597 --- /dev/null +++ b/screen_panel @@ -0,0 +1,15 @@ +#!/bin/bash + + +/opt/gfa/pshell/pshell \ + -jvmarg="-Duser.home=/sf/bernina/data" \ + -test -dlaf \ + -home=/sf/bernina/config/pshell_be \ + -data=/sf/bernina/config/pshell_data \ + -l -d -k -q -b -e -g -n -buf=10 -poll=250 -clog=SEVERE \ + -p=SfCamera.java \ + -p=Inventory.java \ + -p=CameraCalibrationDialog.java \ + -p=ScreenPanel2.java \ + -srv_url=sf-daqsync-01:8889 -cam_srv_url=sf-daqsync-01:8888 $@ + diff --git a/strip_chart b/strip_chart new file mode 100755 index 0000000..d18e258 --- /dev/null +++ b/strip_chart @@ -0,0 +1,11 @@ +#!/bin/bash + + +/opt/gfa/pshell/pshell \ + -jvmarg="-Duser.home=/sf/bernina/config/pshell_be/stripchart" \ + -home=/sf/bernina/config/pshell_be \ + -data=/sf/bernina/config/pshell_data \ + -l -b \ + -dlaf \ + -strp \ + -strh=/sf/bernina/config/pshell_be/stripchart $@ diff --git a/swissfelStatus b/swissfelStatus new file mode 100755 index 0000000..02870d2 --- /dev/null +++ b/swissfelStatus @@ -0,0 +1,2 @@ +#!/bin/bash +caqtdm -stylefile sfop.qss -macro "chargelim=15" -attach S_OP_overview_for_photonics.ui diff --git a/terminalAs b/terminalAs new file mode 100755 index 0000000..b412150 --- /dev/null +++ b/terminalAs @@ -0,0 +1,11 @@ +#!/bin/bash +#function set-title() { +# if [[ -z "$ORIG" ]]; then +# ORIG=$PS1 +# fi +# TITLE="\[\e]2;$*\a\]" +# PS1=${ORIG}${TITLE} +#} +#set-title "chrome terminal" + +gnome-terminal -e "bash -c 'su $1;$SHELL'" diff --git a/winterm b/winterm new file mode 100755 index 0000000..539e271 --- /dev/null +++ b/winterm @@ -0,0 +1,2 @@ +#!/bin/bash +xfreerdp -u $1 --no-nla -d PSICH -g 2000x1500 winterm1