Fixed HG0 setting for JF11 (bit 1 of reg 0x5d + conf register reload)

CS script changed to start and kill receivers autoamtically.
Mudules 347 361 362 355 364 366 calibrated with these scripts
This commit is contained in:
mozzanica
2021-03-15 08:15:20 +01:00
parent d4fff9739a
commit 0641de6e13
8 changed files with 261 additions and 59 deletions

View File

@ -12,30 +12,16 @@
if [ "$1" == "" ] || [ $# -gt 1 ]; then if [ "$1" == "" ] || [ $# -gt 1 ]; then
echo "Parameter 1 is empty specify G0 for normal, HG0 for HG0G1G2" echo "Parameter 1 is empty specify G0 for normal, HG0 for HG0G1G2"
exit 0 return 0
fi fi
sls_detector_put stop; sls_detector_put stop;
sls_detector_put powerchip 0
sleep 3
sls_detector_put setbit 0x5d 7 sls_detector_put setbit 0x5d 7
sls_detector_put powerchip 1 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 #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 detectormac 00:ab:be:cc:dd:e2
#sls_detector_put configuremac 0 #sls_detector_put configuremac 0
sls_detector_put speed 1 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 #sls_detector_put reg 0x5b 0xffffffff
@ -115,7 +129,7 @@ if [[ $input = "q" ]]; then
fi fi
# high voltage # high voltage
sls_detector_put vhighvoltage 130 sls_detector_put vhighvoltage 200
# output on # output on
/afs/psi.ch/project/sls_det_software/serial_control_software/minidelay/minidelay OUTP ON /afs/psi.ch/project/sls_det_software/serial_control_software/minidelay/minidelay OUTP ON
sleep 0.2 sleep 0.2
@ -137,6 +151,10 @@ if [[ $input = "q" ]]; then
fi fi
# the scan # the scan
for ivpulse in {10..1000..10} for ivpulse in {10..1000..10}
do do

View File

@ -247,6 +247,11 @@ int main(int argc, char* argv[]) {
scan_v6.push_back("334"); scan_v6.push_back("334");
scan_v6.push_back("337"); scan_v6.push_back("337");
scan_v6.push_back("347"); 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(); 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 createHistoFile = 1; //set 0 for a fit-only run
int createPerStepHistos = 0; //debug int createPerStepHistos = 0; //debug
#ifdef JF11
cout << "COMPILED for JF11 !!!" << endl;
#endif
// create necessary directories with permissions drwxrwxr-x // create necessary directories with permissions drwxrwxr-x
// data/Mxxx // data/Mxxx
sprintf(savename,"data/M%s", module_str.c_str()); 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); adcmap_all->Fill(i%NC,i/NC,adc);
gainmap_all->Fill(i%NC,i/NC,gain); gainmap_all->Fill(i%NC,i/NC,gain);
} }
#ifdef JF11 #ifdef NONSERVE //in reality it is shift in the right direction 0x5b=80000000 and 0x5a=00000000
if (((i/NC <= 255) && (((i%64)) == 63-(j)%64)) || if (((i/NC <= 255) && (((i%64)) == 63-(j-1)%64)) ||
((i/NC >= 256) &&( ((-1*(i-524287))%64) == 63-(j)%64))) { //scanning on "+-i") ((i/NC >= 256) &&( ((-1*(i-524287))%64) == 63-(j-1)%64))) { //scanning on "+-i")
#else #else
if (((i/NC <= 255) && (i%64 == (j-1)%64)) || if (((i/NC <= 255) && (i%64 == (j-1)%64)) ||
((i/NC >= 256) &&((-1*(i-524287))%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 #ifdef JF11
g1overg2map->GetZaxis()->SetRangeUser(11,12.5); g1overg2map->GetZaxis()->SetRangeUser(11,12.5);
#else #else
g1overg2map->GetZaxis()->SetRangeUser(12,13.2); g1overg2map->GetZaxis()->SetRangeUser(12,13.2);
#endif #endif
g1overg2map->Draw("colz"); g1overg2map->Draw("colz");

Binary file not shown.

View File

@ -11,7 +11,8 @@ if [ "$1" == "" ] || [ $# -gt 1 ]; then
exit 0 exit 0
fi fi
KILLRCV="killall ju_udp_receiver_3threads_2_0"
$KILLRCV
sls_detector_put powerchip 0 sls_detector_put powerchip 0
sleep 1 sleep 1
@ -20,34 +21,14 @@ sls_detector_put stop;
sls_detector_put setbit 0x5d 7 sls_detector_put setbit 0x5d 7
sls_detector_put powerchip 1 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 frames 640
sls_detector_put period 0.005 sls_detector_put period 0.005
sls_detector_put exptime 0.000010 sls_detector_put exptime 0.000010
sls_detector_put vhighvoltage 200 sls_detector_put vhighvoltage 90
# configure for receiver on mpc2012 # configure for receiver on mpc2012
sls_detector_put rx_udpport 32410 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 detectorip 10.1.4.9
sls_detector_put detectormac 00:ab:be:cc:dd:e2 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 [ "$1" == 'HG0' ]; then
if [[ $input = "q" ]]; then sls_detector_put setbit 0x5d 0
echo "Exiting script" sls_detector_put reg 0x58 0x00800f ; sls_detector_put setbit 0x58 31 ; sls_detector_put clearbit 0x58 31;
exit 1 echo "HG0G1G2 mode"
fi 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" 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 # bit 16 high bit 17 high = cal col selected with bits 26-20
sls_detector_put reg 0x5b 0x80000000
sls_detector_put reg 0x5b 0x00000001 sls_detector_put reg 0x5a 0x00000000
sls_detector_put reg 0x5a 0x00000001 #sls_detector_put reg 0x5a 0x00000001
sls_detector_put setbit 0x58 30 ; sls_detector_put clearbit 0x58 30; 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 frames 1000000
sls_detector_put clearbit 0x5d 16 sls_detector_put clearbit 0x5d 16
echo "Script finished" echo "Script finished"
$KILLRCV

148
CuFluo_exposure_JF11.sh Normal file
View File

@ -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"

View File

@ -1,4 +1,12 @@
#!/bin/bash #!/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 "printing filenames for module " $1
echo "copy paste to execute " echo "copy paste to execute "
datafolder="/mnt/pcmoench_jungfrau_calib/data/Module_"$1"_Calib/" datafolder="/mnt/pcmoench_jungfrau_calib/data/Module_"$1"_Calib/"
@ -6,11 +14,15 @@ datestring=$(date +%F)
echo "mkdir "$datafolder 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"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 "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"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"
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 " 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" export TKPHG0="ju_udp_receiver_3threads_2_0 S "$datafolder"pedeHG0_M"$1"_"$datestring"_ 10.1.4.105"
echo "printing the analysis commands " echo "printing the analysis commands "
for file in $(find $datafolder -type f -exec basename {} \; | grep 000000 ); do for file in $(find $datafolder -type f -exec basename {} \; | grep 000000 ); do
prefix=${file%_000000.dat} prefix=${file%_000000.dat}
@ -62,7 +77,7 @@ echo "---------------------START OF ANALYSIS CLI commands --------------------"
echo "----------------------------------------------------------------------" echo "----------------------------------------------------------------------"
echo "./CuFluo_analysis "$1" G0 "$datafolder $pgofile $cgofile echo "./CuFluo_analysis "$1" G0 "$datafolder $pgofile $cgofile
echo "./CuFluo_analysis "$1" HG0 "$datafolder $phgofile $chgofile 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 "./CS_analysis "$1" "$datafolder $csfile
echo "./JFMC_CalibWriter_wBP" "$1" echo "./JFMC_CalibWriter_wBP" "$1"
echo "----------------------------------------------------------------------" echo "----------------------------------------------------------------------"

Binary file not shown.

Binary file not shown.