#!/bin/bash # to run do: bash CuFluo_exposure_sc.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 stop #just in case sls_detector_put powerchip 1 #Effective SC period = sc_delay + exptime + 2.1us (reset preamp and CDS) #Frame period = effective SC period *16 + 840 us * 16 = 14 ms (for readout) sls_detector_put period 0.1 #0.03 #0.002 sls_detector_put exptime 0.000010 #0.000010 sls_detector_put extrastoragecells 15 sls_detector_put storagecell_start 0 sls_detector_put storagecell_delay 0.000025875 #to achieve effective sc period of 35us ( 0.000025875+0.000007+0.0000021 ) 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 half_speed #sls_detector_put reg 0x59 0x1310 #0001 0011 0001 0000 #sls_detector_put readoutspeed 0 #sls_detector_put reg 0x59 0x0100 #0000 0001 0000 0000 KILLRCV="killall ju_udp_receiver_3threads_2_0" $KILLRCV CLI=/afs/psi.ch/project/sls_det_software/bin/xrayClient_sl7 $CLI setv 40 $CLI setc 60 $CLI HV on sls_detector_put clearbit 0x5d 0 $CLI shutter 1 off echo "warmin up the board" sls_detector_put frames 2500 #40000 sls_detector_put start sleep 260 #81 # 2500 * 100ms = 250s # 2500 * 30ms = 75s # 2500 * 20 ms = 50s sls_detector_put stop echo "end of board warm up" sls_detector_put frames 1000 $KILLRCV sleep 10 #1 $TKPG0 & echo "recording G0 pede" sls_detector_put start sleep 105 #35 # 1000 frames (per sc) at 10 frames per second (period 100ms) takes 100s # 1000 frames (per sc) at 34 frames per second (period 30ms) takes 35s echo "recording G0 pede" #sls_detector_put gainmode forceswitchg1 #consumes too much power sls_detector_put start sleep 105 #35 echo "recording G0 pede" #sls_detector_put gainmode forceswitchg2 #consumes too much power sls_detector_put start sleep 105 #35 sls_detector_put gainmode dynamic $KILLRCV echo "closed G0 pede file and open the G0 CuFluo file" sleep 10 #1 $TKFG0 & sls_detector_put frames 220000 $CLI shutter 1 on sleep 10 #1 sls_detector_put start sleep 22010 #6800 # 220k frames (per sc) at 10 frames per second (period 10ms) takes 22000s (6h 7min) # 220k frames (per sc) at 34 frames per second (period 30ms) takes 6600s (1h 50min) $CLI shutter 1 off #We are not interested in HG0 #$KILLRCV #echo "closed G0 CuFluo file and open HG0 pede file" #sleep 1 #$TKPHG0 & #sls_detector_put settings highgain0 #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 #$CLI shutter 1 on #sleep 1 #sls_detector_put start #sleep 450 # 200k frames at 500 frames per second takes 400s #$CLI shutter 1 off $CLI HV off $KILLRCV sls_detector_put highvoltage 0 echo "Script finished"