Files
JFCalibration/CS_scan_JF11.sh
hinger_v ed18504809 modified: BP_analysis.cpp
modified:   BP_scan.sh
	modified:   BP_scan_JF11.sh
	modified:   CS_analysis.cpp
	modified:   CS_analysis_JF11
	modified:   CS_scan.sh
	modified:   CS_scan_JF11.sh
	modified:   CuFluo_exposure.sh
	modified:   filename_creator.sh
	modified:   makefile
	modified:   pccalib.sh
	modified:   run_JFCalibration.txt
	modified:   slsDetector_bin
	modified:   CS_analysis.cpp
	BP_analysis_M431.cpp
	BP_analysis_thin.cpp
	BP_fit.cpp
	BP_fit_M431.cpp
	BP_fit_thin.cpp
	BP_scan_both_speeds.sh
	BP_scan_thinSensor.sh
	CS_analysis_M431.cpp
	CS_analysis_M439.cpp
	CS_fit.cpp
	CS_fit_M431.cpp
	CS_scan_both_speeds.sh
	CuFluo_exposure_both_speeds.sh
	CuFluo_fit.cpp
	Default_pixels_arrays.cpp
2025-06-27 10:34:14 +02:00

227 lines
4.8 KiB
Bash

#!/bin/bash
# to run do: bash CS_scan.sh
# prerequisites:
# - setup_env.sh souced
# - the hostname is set
# - detector is on
# fileneame script has been sourced
if [ "$1" == "" ] || [ $# -gt 1 ]; then
echo "Parameter 1 is empty specify G0 for normal, HG0 for HG0G1G2"
exit 0
fi
KILLRCV="killall ju_udp_receiver_3threads_2_0"
$KILLRCV
sls_detector_put powerchip 0
sleep 1
sls_detector_put stop
sls_detector_put powerchip 1
sleep 3
sls_detector_put frames 640
sls_detector_put period 0.005
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
sls_detector_put start # this puts the chip in a known state.
sls_detector_put stop
if [ "$1" == 'HG0' ]; then
sls_detector_put settings highgain0
#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 settings gain0
#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 gainmode dynamic
if [ "$1" == 'HG0' ]; then
$TKCSHG0 &
else
$TKCSG0 &
fi
sleep 2
echo "recording G0 pede"
sls_detector_put start
sleep 4
echo "recording G1 pede"
sls_detector_put gainmode forceswitchg1
sls_detector_put start
sleep 4
echo "recording G2 pede"
sls_detector_put gainmode forceswitchg2
sls_detector_put start
sleep 4
sls_detector_put gainmode dynamic
# turn on current source
# bit 16 high bit 17 low = automatic cal col sweep
# bit 16 high bit 17 high = cal col selected with bits 26-20
#sls_detector_put currentsource 1 nofix 0x8000000000000000 normal # this pattern was inverted, inject signals in cols 0, 63 ... 1 or 63, 0 ... 62
sls_detector_put currentsource 1 nofix 0x0000000000000001 normal #normal #low #correct pattern for JF11 and JF12
#sls_detector_put currentsource 1 nofix 0x800000ffff000003 normal # workaround, seems like too much current fir single column in JF12, also inject current to left/right columns
#sls_detector_put currentsource 1 nofix 0xffffffffffffffff normal
sleep 1
#sls_detector_get reg 0x1D
# loop 1
for tint in {50..450..50} # 25 is too small here, 50 min
do
tint_sec=$(printf %.9f $(echo "$tint/1000000000" | bc -l))
echo "setting integration time to (s) " $tint_sec
sls_detector_put exptime $tint_sec
sls_detector_put start
sleep 4
done
# loop 2a
for tint in {50..100..5}
do
tint_sec=$(printf %.8f $(echo "$tint/100000000" | bc -l))
echo "setting integration time to (s) " $tint_sec
sls_detector_put exptime $tint_sec
sls_detector_put start
sleep 4
done
# loop 2b
for tint in {110..200..10}
do
tint_sec=$(printf %.8f $(echo "$tint/100000000" | bc -l))
echo "setting integration time to (s) " $tint_sec
sls_detector_put exptime $tint_sec
sls_detector_put start
sleep 4
done
# loop 2c
for tint in {225..450..25}
do
tint_sec=$(printf %.8f $(echo "$tint/100000000" | bc -l))
echo "setting integration time to (s) " $tint_sec
sls_detector_put exptime $tint_sec
sls_detector_put start
sleep 4
done
# loop 3a
for tint in {50..100..5}
do
tint_sec=$(printf %.7f $(echo "$tint/10000000" | bc -l))
echo "setting integration time to (s) " $tint_sec
sls_detector_put exptime $tint_sec
sls_detector_put start
sleep 4
done
# loop 3b
for tint in {110..200..10}
do
tint_sec=$(printf %.7f $(echo "$tint/10000000" | bc -l))
echo "setting integration time to (s) " $tint_sec
sls_detector_put exptime $tint_sec
sls_detector_put start
sleep 4
done
# loop 3c
for tint in {225..450..25}
do
tint_sec=$(printf %.7f $(echo "$tint/10000000" | bc -l))
echo "setting integration time to (s) " $tint_sec
sls_detector_put exptime $tint_sec
sls_detector_put start
sleep 4
done
# loop 4a
for tint in {50..100..5}
do
tint_sec=$(printf %.7f $(echo "$tint/1000000" | bc -l))
echo "setting integration time to (s) " $tint_sec
sls_detector_put exptime $tint_sec
sls_detector_put start
sleep 4
done
# loop 4b
for tint in {110..250..10}
do
tint_sec=$(printf %.7f $(echo "$tint/1000000" | bc -l))
echo "setting integration time to (s) " $tint_sec
sls_detector_put exptime $tint_sec
sls_detector_put start
sleep 4
done
echo "Finished scan"
sls_detector_put exptime 0.000010
sls_detector_put period 0.002
sls_detector_put frames 1000000
sls_detector_put currentsource 0
sls_detector_put highvoltage 0
echo "Script finished"
sleep 4
$KILLRCV