diff --git a/CuFluo_exposure.sh b/CuFluo_exposure.sh new file mode 100644 index 0000000..2e98a56 --- /dev/null +++ b/CuFluo_exposure.sh @@ -0,0 +1,120 @@ +#!/bin/bash + +# to run do: bash CuFluo_exposure.sh + +# prerequisites: +# - the hostname is set +# - export PATH=/afs/psi.ch/project/sls_det_software/latest_slsDetectorPackage/build/bin:$PATH +# - export LD_LIBRARY_PATH=/afs/psi.ch/project/sls_det_software/latest_slsDetectorPackage/build/bin:$LD_LIBRARY_PATH +# - detector is on +# - xray tube is on and ramped for 40 kV, 60 mA, set to Cu + +sls_detector_put powerchip 1 + +# set ADCINVERSionreg (by trial and error) +sls_detector_put reg 0x43 0x453b2a9c + +sls_detector_put adcphase 72 +sls_detector_put period 0.002 +sls_detector_put exptime 0.000010 +sls_detector_put vhighvoltage 200 + +# configure for receiver on mpc2012 +sls_detector_put rx_udpport 32410 +sls_detector_put rx_udpip 10.1.3.105 +sls_detector_put rx_udpmac 3C:FD:FE:A2:14:D9 +sls_detector_put detectorip 10.1.3.9 +sls_detector_put detectormac 00:ab:be:cc:dd:e2 +sls_detector_put configuremac 0 + + +CLI=/afs/psi.ch/project/sls_det_software/bin/xrayClient64 +$CLI setv 40 +$CLI setc 60 + +echo "The receiver should be waiting for data (G0 pede file)" +echo "Please check and press any key to continue, or press q to exit this script" +read -n 1 -s input +if [[ $input = "q" ]]; then + echo "Exiting script" + exit 1 +fi + +sls_detector_put frames 1000 + +echo "recording G0 pede" +sls_detector_put status start +sleep 3 +# 1000 frames at 500 frames per second takes 2s + + +echo "recording G1 pede" +sls_detector_put setbit 0x5d 12 +sls_detector_put status start +sleep 3 + + +echo "recording G2 pede" +sls_detector_put setbit 0x5d 13 +sls_detector_put status start +sleep 3 + + +sls_detector_put clearbit 0x5d 12 +sls_detector_put clearbit 0x5d 13 + + +echo "Please close the G0 pede file and open the G0 CuFluo file" +echo "Please check and press any key to continue, or press q to exit this script" +read -n 1 -s input +if [[ $input = "q" ]]; then + echo "Exiting script" + exit 1 +fi + + +sls_detector_put frames 200000 +$CLI shutter 1 on +sleep 1 +sls_detector_put status start +sleep 410 +# 200k frames at 500 frames per second takes 400s +$CLI shutter 1 off + +echo "Please close the G0 CuFluo file and open HG0 pede file" +echo "Please check and press any key to continue, or press q to exit this script" +read -n 1 -s input +if [[ $input = "q" ]]; then + echo "Exiting script" + exit 1 +fi + +sls_detector_put setbit 0x5d 0 + +sls_detector_put frames 1000 + +echo "recording HG0 pede" +sls_detector_put status start +sleep 3 +# 1000 frames at 500 frames per second takes 2s + + +echo "Please close the HG0 pede file and open the HG0 CuFluo file" +echo "Please check and press any key to continue, or press q to exit this script" +read -n 1 -s input +if [[ $input = "q" ]]; then + echo "Exiting script" + exit 1 +fi + + +sls_detector_put frames 200000 +$CLI shutter 1 on +sleep 1 +sls_detector_put status start +sleep 410 +# 200k frames at 500 frames per second takes 400s +$CLI shutter 1 off + +echo "You can close the HG0 CuFluo file" +echo "Script finished"