diff --git a/BP_scan_JF11.sh b/BP_scan_JF11.sh index 1cf32f5..7343d9d 100644 --- a/BP_scan_JF11.sh +++ b/BP_scan_JF11.sh @@ -12,30 +12,16 @@ if [ "$1" == "" ] || [ $# -gt 1 ]; then echo "Parameter 1 is empty specify G0 for normal, HG0 for HG0G1G2" - exit 0 + return 0 fi sls_detector_put stop; +sls_detector_put powerchip 0 +sleep 3 sls_detector_put setbit 0x5d 7 sls_detector_put powerchip 1 -sleep 1 -if [ "$1" == 'HG0' ]; then -sls_detector_put reg 0x58 0x00800f ; sls_detector_put setbit 0x58 31 ; sls_detector_put clearbit 0x58 31; -echo "HG0G1G2 mode" -else -sls_detector_put reg 0x58 0x10800f ; sls_detector_put setbit 0x58 31 ; sls_detector_put clearbit 0x58 31; -echo "normal mode" -fi - -sls_detector_put reg 0x7f 0xff1f -sls_detector_put reg 0x59 0x1110 - - -sls_detector_put reg 0x5b 0xffffffff -sls_detector_put reg 0x5a 0xffffffff -sls_detector_put setbit 0x58 30 ; sls_detector_put clearbit 0x58 30; #sls_detector_put setbit 0x5d 0 @@ -54,6 +40,34 @@ sls_detector_put detectorip 10.1.4.9 sls_detector_put detectormac 00:ab:be:cc:dd:e2 #sls_detector_put configuremac 0 sls_detector_put speed 1 +sls_detector_put start # this puts the chip in a known state. +sls_detector_put stop + +sleep 3 + +if [ "$1" == 'HG0' ]; then +sls_detector_put setbit 0x5d 0 +sls_detector_put reg 0x58 0x00800f ; sls_detector_put setbit 0x58 31 ; sls_detector_put clearbit 0x58 31; +echo "HG0G1G2 mode" +else +sls_detector_put clearbit 0x5d 0 +sls_detector_put reg 0x58 0x10800f ; sls_detector_put setbit 0x58 31 ; sls_detector_put clearbit 0x58 31; +echo "normal mode" +fi + +sls_detector_put reg 0x7f 0xff1f +sls_detector_put reg 0x59 0x1110 + +sleep 1 + +#sls_detector_put reg 0x5b 0xffffffff +#sls_detector_put reg 0x5a 0xffffffff +sleep 1 +sls_detector_put setbit 0x58 30 ; sleep 1 ;sls_detector_put clearbit 0x58 30; +sleep 1 + + + #sls_detector_put reg 0x5b 0xffffffff @@ -115,7 +129,7 @@ if [[ $input = "q" ]]; then fi # high voltage -sls_detector_put vhighvoltage 130 +sls_detector_put vhighvoltage 200 # output on /afs/psi.ch/project/sls_det_software/serial_control_software/minidelay/minidelay OUTP ON sleep 0.2 @@ -137,6 +151,10 @@ if [[ $input = "q" ]]; then fi + + + + # the scan for ivpulse in {10..1000..10} do diff --git a/CS_analysis.cpp b/CS_analysis.cpp index 13d955f..4a316c8 100644 --- a/CS_analysis.cpp +++ b/CS_analysis.cpp @@ -247,6 +247,11 @@ int main(int argc, char* argv[]) { scan_v6.push_back("334"); scan_v6.push_back("337"); scan_v6.push_back("347"); + scan_v6.push_back("361"); + scan_v6.push_back("362"); + scan_v6.push_back("355"); + scan_v6.push_back("364"); + scan_v6.push_back("366"); jungfrauFile *thisfile = new jungfrauFile(); @@ -274,6 +279,10 @@ int main(int argc, char* argv[]) { int createHistoFile = 1; //set 0 for a fit-only run int createPerStepHistos = 0; //debug +#ifdef JF11 + cout << "COMPILED for JF11 !!!" << endl; +#endif + // create necessary directories with permissions drwxrwxr-x // data/Mxxx sprintf(savename,"data/M%s", module_str.c_str()); @@ -537,9 +546,9 @@ int main(int argc, char* argv[]) { adcmap_all->Fill(i%NC,i/NC,adc); gainmap_all->Fill(i%NC,i/NC,gain); } -#ifdef JF11 - if (((i/NC <= 255) && (((i%64)) == 63-(j)%64)) || - ((i/NC >= 256) &&( ((-1*(i-524287))%64) == 63-(j)%64))) { //scanning on "+-i") +#ifdef NONSERVE //in reality it is shift in the right direction 0x5b=80000000 and 0x5a=00000000 + if (((i/NC <= 255) && (((i%64)) == 63-(j-1)%64)) || + ((i/NC >= 256) &&( ((-1*(i-524287))%64) == 63-(j-1)%64))) { //scanning on "+-i") #else if (((i/NC <= 255) && (i%64 == (j-1)%64)) || ((i/NC >= 256) &&((-1*(i-524287))%64 == (j-1)%64))) { @@ -1818,7 +1827,7 @@ int main(int argc, char* argv[]) { #ifdef JF11 g1overg2map->GetZaxis()->SetRangeUser(11,12.5); #else - g1overg2map->GetZaxis()->SetRangeUser(12,13.2); + g1overg2map->GetZaxis()->SetRangeUser(12,13.2); #endif g1overg2map->Draw("colz"); diff --git a/CS_analysis_JF11 b/CS_analysis_JF11 index 0c006c6..c13dcd8 100755 Binary files a/CS_analysis_JF11 and b/CS_analysis_JF11 differ diff --git a/CS_scan_JF11.sh b/CS_scan_JF11.sh index 60b0d33..b99316e 100644 --- a/CS_scan_JF11.sh +++ b/CS_scan_JF11.sh @@ -11,7 +11,8 @@ if [ "$1" == "" ] || [ $# -gt 1 ]; then exit 0 fi - +KILLRCV="killall ju_udp_receiver_3threads_2_0" +$KILLRCV sls_detector_put powerchip 0 sleep 1 @@ -20,34 +21,14 @@ sls_detector_put stop; sls_detector_put setbit 0x5d 7 sls_detector_put powerchip 1 -sleep 2 +sleep 3 -if [ "$1" == 'HG0' ]; then -sls_detector_put reg 0x58 0x00800f ; sls_detector_put setbit 0x58 31 ; sls_detector_put clearbit 0x58 31; -echo "HG0G1G2 mode" -else -sls_detector_put reg 0x58 0x10800f ; sls_detector_put setbit 0x58 31 ; sls_detector_put clearbit 0x58 31; -echo "normal mode" -fi - -sls_detector_put reg 0x7f 0xff1f -sls_detector_put reg 0x59 0x1110 - - -sls_detector_put reg 0x5b 0xffffffff -sls_detector_put reg 0x5a 0xffffffff -sls_detector_put setbit 0x58 30 ; sls_detector_put clearbit 0x58 30; - -sls_detector_put clearbit 0x5d 16 -sls_detector_put clearbit 0x5d 17 - - sls_detector_put frames 640 sls_detector_put period 0.005 sls_detector_put exptime 0.000010 -sls_detector_put vhighvoltage 200 +sls_detector_put vhighvoltage 90 # configure for receiver on mpc2012 sls_detector_put rx_udpport 32410 @@ -56,15 +37,44 @@ sls_detector_put rx_udpmac 3C:FD:FE:A2:14:D8 sls_detector_put detectorip 10.1.4.9 sls_detector_put detectormac 00:ab:be:cc:dd:e2 +sls_detector_put speed 1 +sls_detector_put start # this puts the chip in a known state. +sls_detector_put stop -echo "The receiver should be waiting for data" -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 + + +if [ "$1" == 'HG0' ]; then +sls_detector_put setbit 0x5d 0 +sls_detector_put reg 0x58 0x00800f ; sls_detector_put setbit 0x58 31 ; sls_detector_put clearbit 0x58 31; +echo "HG0G1G2 mode" +else +sls_detector_put clearbit 0x5d 0 +sls_detector_put reg 0x58 0x10800f ; sls_detector_put setbit 0x58 31 ; sls_detector_put clearbit 0x58 31; +echo "normal mode" +fi + +sls_detector_put reg 0x7f 0xff1f +sls_detector_put reg 0x59 0x1110 + + +#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, switch enabled. + +sls_detector_put clearbit 0x5d 16 +sls_detector_put clearbit 0x5d 17 + + + + +if [ "$1" == 'HG0' ]; then +$TKCSHG0 & +else +$TKCSG0 & +fi +sleep 2 echo "recording G0 pede" @@ -93,9 +103,9 @@ sls_detector_put clearbit 0x5d 13 # bit 16 high bit 17 high = cal col selected with bits 26-20 - -sls_detector_put reg 0x5b 0x00000001 -sls_detector_put reg 0x5a 0x00000001 +sls_detector_put reg 0x5b 0x80000000 +sls_detector_put reg 0x5a 0x00000000 +#sls_detector_put reg 0x5a 0x00000001 sls_detector_put setbit 0x58 30 ; sls_detector_put clearbit 0x58 30; @@ -216,3 +226,5 @@ sls_detector_put period 0.002 sls_detector_put frames 1000000 sls_detector_put clearbit 0x5d 16 echo "Script finished" + +$KILLRCV diff --git a/CuFluo_exposure_JF11.sh b/CuFluo_exposure_JF11.sh new file mode 100644 index 0000000..b54face --- /dev/null +++ b/CuFluo_exposure_JF11.sh @@ -0,0 +1,148 @@ +#!/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 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 vhighvoltage 200 + + +# configure for receiver on mpc2012 +sls_detector_put rx_udpport 32410 +sls_detector_put rx_udpip 10.1.4.105 +sls_detector_put rx_udpmac 3C:FD:FE:A2:14:D8 +sls_detector_put detectorip 10.1.4.9 +sls_detector_put detectormac 00:ab:be:cc:dd:e2 +sls_detector_put speed 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 1 off +echo "warmin up the board" +sls_detector_put frames 10000 +sls_detector_put start +sleep 21 +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 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 setbit 0x5d 12 +sls_detector_put start +sleep 3 + + +echo "recording G2 pede" +sls_detector_put setbit 0x5d 13 +sls_detector_put start +sleep 3 + + +sls_detector_put 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 1 on + sleep 1 +sls_detector_put start +sleep 450 +# 200k frames at 500 frames per second takes 400s +$CLI shutter 1 off + + +$KILLRCV +echo "closed G0 CuFluo file and open HG0 pede file" +sleep 1 +$TKPHG0 & +sls_detector_put 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 1 on +sleep 1 +sls_detector_put start +sleep 450 +# 200k frames at 500 frames per second takes 400s +$CLI shutter 1 off + + +$KILLRCV + +sls_detector_put clearbit 0x5d 0 +echo "Script finished" diff --git a/filename_creator.sh b/filename_creator.sh index 02abdf8..f51f0f0 100644 --- a/filename_creator.sh +++ b/filename_creator.sh @@ -1,4 +1,12 @@ #!/bin/bash +echo "#############################################################################" +echo "#############################################################################" +echo "#############################################################################" +echo "####### REMEMBER TO USE SOURCE, NOT SH to call this script ############" +echo "#############################################################################" +echo "#############################################################################" +echo "#############################################################################" + echo "printing filenames for module " $1 echo "copy paste to execute " datafolder="/mnt/pcmoench_jungfrau_calib/data/Module_"$1"_Calib/" @@ -6,11 +14,15 @@ datestring=$(date +%F) echo "mkdir "$datafolder echo "./ju_udp_receiver_3threads_2_0 S "$datafolder"BP_M"$1"_"$datestring"_ 10.1.4.105" -echo "./ju_udp_receiver_3threads_2_0 S "$datafolder"CS_M"$1"_"$datestring"_ 10.1.4.105" + echo "additional lines for JF11" -echo "./ju_udp_receiver_3threads_2_0 S "$datafolder"BP_M"$1"_"$datestring"_HGOG1G2 10.1.4.105" -echo "./ju_udp_receiver_3threads_2_0 S "$datafolder"CS_M"$1"_"$datestring"_HGOG1G2 10.1.4.105" +echo "./ju_udp_receiver_3threads_2_0 S "$datafolder"BP_M"$1"_"$datestring"_HGOG1G2_ 10.1.4.105" + +export TKCSHG0="ju_udp_receiver_3threads_2_0 S "$datafolder"CS_M"$1"_"$datestring"_HGOG1G2_ 10.1.4.105" + +export TKCSG0="ju_udp_receiver_3threads_2_0 S "$datafolder"CS_M"$1"_"$datestring"_ 10.1.4.105" + echo "exporting the fluorescence receiver commands " @@ -20,6 +32,9 @@ export TKPG0="ju_udp_receiver_3threads_2_0 S "$datafolder"pedeG0_M"$1"_"$datestr export TKPHG0="ju_udp_receiver_3threads_2_0 S "$datafolder"pedeHG0_M"$1"_"$datestring"_ 10.1.4.105" + + + echo "printing the analysis commands " for file in $(find $datafolder -type f -exec basename {} \; | grep 000000 ); do prefix=${file%_000000.dat} @@ -62,7 +77,7 @@ echo "---------------------START OF ANALYSIS CLI commands --------------------" echo "----------------------------------------------------------------------" echo "./CuFluo_analysis "$1" G0 "$datafolder $pgofile $cgofile echo "./CuFluo_analysis "$1" HG0 "$datafolder $phgofile $chgofile -echo "./BP_analysis "$1" "$datafolder"/"$bpfile +echo "./BP_analysis "$1" "$datafolder$bpfile echo "./CS_analysis "$1" "$datafolder $csfile echo "./JFMC_CalibWriter_wBP" "$1" echo "----------------------------------------------------------------------" diff --git a/slsDetector_bin/g b/slsDetector_bin/g deleted file mode 100755 index 06cecae..0000000 Binary files a/slsDetector_bin/g and /dev/null differ diff --git a/slsDetector_bin/p b/slsDetector_bin/p deleted file mode 100755 index 5c130b1..0000000 Binary files a/slsDetector_bin/p and /dev/null differ