#!/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 shutter=2 sls_detector_put stop #just in case sls_detector_put powerchip 0 sleep 1 sls_detector_put stop; #sls_detector_put setbit 0x5d 7 sls_detector_put powerchip 1 sleep 3 sls_detector_put period 0.002 sls_detector_put exptime 0.000010 sls_detector_put highvoltage 200 # configure for receiver on mpc2012 sls_detector_put udp_dstport 32410 sls_detector_put udp_dstip $DSTIP #10.1.4.105 sls_detector_put udp_dstmac $DSTMAC #3C:FD:FE:A2:14:D8 sls_detector_put udp_srcip $SRCIP #10.1.4.9 sls_detector_put udp_srcmac 00:ab:be:cc:dd:e2 sls_detector_put readoutspeed 1 KILLRCV="killall ju_udp_receiver_3threads_2_0" $KILLRCV sls_detector_put start sls_detector_put stop #this puts the chip in a known state. sleep 1 #sls_detector_put reg 0x5b 0xffffffff #sls_detector_put reg 0x5a 0xffffffff #sls_detector_put setbit 0x58 30 ; sls_detector_put clearbit 0x58 30; #set colum select register to ffffffff, normal state. sls_detector_put reg 0x7f 0xff1f #sls_detector_put reg 0x59 0x1110 CLI=/afs/psi.ch/project/sls_det_software/bin/xrayClient_sl7 $CLI setv 40 $CLI setc 60 $CLI HV on $CLI shutter $shutter off #$CLI shutter 1 off echo "warmin up the board" sls_detector_put frames 40000 sls_detector_put start sleep 81 echo "end of board warm up" ##if false; then ##### temporary sls_detector_put frames 1000 $KILLRCV sleep 1 $TKPG0 & sls_detector_put stop sls_detector_put settings gain0 #clearbit 0x5d 0 #sls_detector_put reg 0x58 0x10800f ; sls_detector_put setbit 0x58 31 ; sls_detector_put clearbit 0x58 31; #setting G0, H filter, 1 SC , 4FC echo "recording G0 pede" sls_detector_put start sleep 3 # 1000 frames at 500 frames per second takes 2s echo "recording G1 pede" sls_detector_put gainmode forceswitchg1 #setbit 0x5d 12 sls_detector_put start sleep 3 echo "recording G2 pede" sls_detector_put gainmode forceswitchg2 #setbit 0x5d 13 sls_detector_put start sleep 3 sls_detector_put gainmode dynamic #clearbit 0x5d 12 #sls_detector_put clearbit 0x5d 13 $KILLRCV echo "closed G0 pede file and open the G0 CuFluo file" sleep 1 $TKFG0 & sls_detector_put frames 220000 $CLI shutter $shutter on #$CLI shutter 1 on sleep 1 sls_detector_put start sleep 450 # 200k frames at 500 frames per second takes 400s $CLI shutter $shutter off #$CLI shutter 1 off $KILLRCV echo "closed G0 CuFluo file and open HG0 pede file" sleep 1 $TKPHG0 & sls_detector_put settings highgain0 #setbit 0x5d 0 #sls_detector_put reg 0x58 0x00800f ; sls_detector_put setbit 0x58 31 ; sls_detector_put clearbit 0x58 31; #setting HG0, H filter, 1 SC , 4FC sls_detector_put frames 1000 echo "recording HG0 pede" sls_detector_put start sleep 3 # 1000 frames at 500 frames per second takes 2s $KILLRCV echo "closed HG0 pede file and open the HG0 CuFluo file" sleep 1 $TKFHG0 & sls_detector_put frames 220000 #220000 $CLI shutter $shutter on #$CLI shutter 1 on sleep 1 sls_detector_put start sleep 450 # 200k frames at 500 frames per second takes 400s $CLI shutter $shutter off #$CLI shutter 1 off $KILLRCV sls_detector_put settings gain0 #clearbit 0x5d 0 sls_detector_put highvoltage 0 echo "Script finished"