main #3

Merged
carulla_m merged 13 commits from main into master 2026-02-25 11:55:47 +01:00
12 changed files with 1389 additions and 22 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -30,7 +30,7 @@ sleep 3
#sls_detector_put setbit 0x5d 7
sls_detector_put powerchip 1
CLI=/afs/psi.ch/project/sls_det_software/serial_control_software/minidelay/minidelay
CLI=/psi.ch/group/detector/software/serial_control_software/minidelay/minidelay
#sls_detector_put setbit 0x5d 0

View File

@@ -30,7 +30,7 @@ sleep 3
#sls_detector_put setbit 0x5d 7
sls_detector_put powerchip 1
CLI=/afs/psi.ch/project/sls_det_software/serial_control_software/minidelay/minidelay
CLI=/psi.ch/group/detector/software/serial_control_software/minidelay/minidelay
#sls_detector_put setbit 0x5d 0

247
BP_scan_new_board.sh Normal file
View File

@@ -0,0 +1,247 @@
#!/bin/bash
# to run do: bash BP_scan_new_board.sh
# prerequisites:
# - setup_env.sh souced
# - the hostname is set
# - detector is on
# - Filename_creator has been run (with correct module #)
# - source pccalib.sh with pc (pc-jungfrau-01/pc-jungfrau-test/pc-jungfrau-02)
# - waveform generator is on
# - amplifier board is powered and unconnected.
# - last file should be 2097184000 bytes big.
# connect to pc10773 (RH7 machine connected to the pulser and, after klog, run the command
# nc -k -n -v -l -p 5555 -e /bin/bash
# last data file (000002.dat) should be 2097184000 bytes
PulseWidth=0.0003 #300us
PulseDelay=0.000005 #5us
KILLRCV="killall ju_udp_receiver_3threads_2_0"
$KILLRCV
if [[ "$0" == *"BP_scan_new_board.sh"* ]]; then
echo "script changes env. variables: should be invoked with source, not sh "
exit
fi
if [ ! -v $1 & ! -v $2 ]; then
echo $0
echo "Readout speed is" $2
echo "printing filenames for module " $1
ROBspeed=$2
if [[ "$2" == "full_speed" ]]; then
source filename_creator.sh $1"_fullspeed" Y
elif [[ "$2" == "half_speed" ]]; then
source filename_creator.sh $1 Y
else
echo "Readout speed has to be specified as half_speed or full_speed"
exit
fi
source filename_creator.sh $1 Y
sls_detector_put stop #just in case
sls_detector_put powerchip 1
sls_detector_put delay 0
#sls_detector_put triggers 1
#sls_detector_put frames 100
sls_detector_put period 0.005
sls_detector_put exptime $PulseWidth #300us wave 200us
sls_detector_put highvoltage 0
# configure for receiver on pc-jungfrau-01/pc-jungfrau-test/pc-jungfrau-02
# source pccalib.sh with pc (pc-jungfrau-01/pc-jungfrau-test/pc-jungfrau-02)
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 configuremac 0
sls_detector_put readoutspeed $ROBspeed
#sls_detector_put readoutspeed full_speed
sls_detector_put gainmode dynamic
#CLI=/afs/psi.ch/project/sls_det_software/serial_control_software/minidelay/minidelay
HOST=EX-6111-02
# prepare the AGILENT 33250A
#echo $CLI" OUTP OFF " | nc pc10773 5555
(echo OUTP OFF ) | nc -t $HOST 5000
sleep 0.2
#remember to put High-Z load!
#Change load to Infinity
#echo $CLI" OUTP:LOAD INF " | nc pc10773 5555
(echo OUTP:LOAD INF ) | nc -t $HOST 5000
sleep 0.2
# Polarity normal
#echo $CLI" OUTP:POL NORM" | nc pc10773 5555
(echo OUTP:POL NORM) | nc -t $HOST 5000
sleep 0.2
# pulse
#echo $CLI" FUNC PULS" | nc pc10773 5555
(echo FUNC PULS) | nc -t $HOST 5000
sleep 0.2
# frequency 1kHz
#echo $CLI" FREQ 1000" | nc pc10773 5555
(echo FREQ 1000) | nc -t $HOST 5000
sleep 0.2
# width 200 us
#echo $CLI" PULS:WIDT 0.00030" | nc pc10773 5555
(echo PULS:WIDT $PulseWidth) | nc -t $HOST 5000
sleep 0.2
# VLOW 0 JUST IN CASE
(echo VOLT:LOW 0 ) | nc -t $HOST 5000
sleep 0.2
# pulse amplitude 0.002 V*25=50mV
(echo VOLT:HIGH 0.002 ) | nc -t $HOST 5000
sleep 0.2
# edge 50 ns
#echo $CLI" PULS:TRAN 0.000000050" | nc pc10773 5555
(echo PULS:TRAN 0.000000050) | nc -t $HOST 5000
sleep 0.2
# triggered burst
#echo $CLI" BURS:MODE TRIG" | nc pc10773 5555
(echo BURS:MODE TRIG) | nc -t $HOST 5000
sleep 0.2
# cycles 1
#echo $CLI" BURS:NCYC 1" | nc pc10773 5555
(echo BURS:NCYC 1) | nc -t $HOST 5000
sleep 0.2
# external trigger source
#echo $CLI" TRIG:SOUR EXT" | nc pc10773 5555
(echo TRIG:SOUR EXT) | nc -t $HOST 5000
sleep 0.2
# delay 5 us
#echo $CLI" TRIG:DEL 0.000001" | nc pc10773 5555
(echo TRIG:DEL $PulseDelay) | nc -t $HOST 5000
sleep 0.2
# slope positive
#echo $CLI" TRIG:SLOP POS" | nc pc10773 5555
(echo TRIG:SLOP POS) | nc -t $HOST 5000
sleep 0.2
# turn on burst mode
#echo $CLI" BURS:STAT ON" | nc pc10773 5555
(echo BURS:STAT ON) | nc -t $HOST 5000
sleep 0.2
if [ "$1" == 'Y' ]; then
echo "started with Y argument, skipping manual checks"
else
echo "It is now safe to connect the cable between the amplifier board and the readout board"
echo "Please do so 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
fi
# high voltage
# sls_detector_put highvoltage 200 #because it seemed more stable, we are using external HV 230V
# pulse amplitude 0.002 V*25=50mV
#echo $CLI" VOLT:HIGH 7.51" | nc pc10773 5555 #Gain 20; Bias 150V pulse +50V
#echo $CLI" VOLT:HIGH 7.608" | nc pc10773 5555 #Gain 25; Bias 190V pulse +40V
(echo VOLT:HIGH 8.802 ) | nc -t $HOST 5000 #Gain 25, maximum voltage 250, 30V pulse, bias 220V closer to current setup
#(echo VOLT:HIGH 8.602 ) | nc -t $HOST 5000 #Gain 25, maximum voltage 250, 35V pulse, bias 215V closer to previous setup
sleep 0.2
# VLOW 8.6V*25=215V
#echo $CLI" VOLT:LOW 7.5" | nc pc10773 5555 # 7.5V*20 150V
#echo $CLI" VOLT:LOW 7.600" | nc pc10773 5555 # Gain 25; HV 190V , pulse +40V
(echo VOLT:LOW 8.800 ) | nc -t $HOST 5000
#(echo VOLT:LOW 8.600 ) | nc -t $HOST 5000
sleep 0.2
# output on
#echo $CLI" OUTP ON" | nc pc10773 5555
(echo OUTP ON) | nc -t $HOST 5000
sleep 0.2
sls_detector_put frames 20000
sls_detector_put start
sleep 110
sls_detector_put stop
sls_detector_put triggers 1
sls_detector_put frames 100
$TKBPG0 &
sleep 1
# the scan
for ivpulse in {8802..9000..2} #{8602..8800..2} P_35V #{7608..9200..4} Gain 25 too many points #{7602..7860..2} Gain 25 #{7510..7840..3} Gain 20
do
vpulse=$(printf %.3f $(echo "$ivpulse/1000" | bc -l))
#echo $CLI" VOLT:HIGH "$vpulse | nc pc10773 5555
(echo VOLT:HIGH $vpulse) | nc -t $HOST 5000
sleep 1
sls_detector_put start
sleep 1
done
for ivpulse in {9010..10000..10} #{8810..10000..10} P_30V #{7900..9200..10} Gain 25 #{7860..10000..20} Gain 20
do
vpulse=$(printf %.3f $(echo "$ivpulse/1000" | bc -l))
#echo $CLI" VOLT:HIGH "$vpulse | nc pc10773 5555
(echo VOLT:HIGH $vpulse) | nc -t $HOST 5000
sleep 1
sls_detector_put start
sleep 1
done
# Kill receiver
sls_detector_put stop
#echo $CLI" VOLT:HIGH 7.510" | nc pc10773 5555
#echo $CLI" VOLT:HIGH 7.602" | nc pc10773 5555
(echo VOLT:HIGH 8.802) | nc -t $HOST 5000
#(echo VOLT:HIGH 8.602) | nc -t $HOST 5000
#echo $CLI" OUTP OFF " | nc pc10773 5555
(echo OUTP OFF) | nc -t $HOST 5000
sleep 20
$KILLRCV
sls_detector_put readoutspeed half_speed
echo "Finished scan, please wait for capacitor to discharge"
sleep 20
echo "It is now safe to disconnect the cable between the amplifier board and the readout board"
echo "Script finished"
else
echo "Specify module number as a first argument"
echo "Script finished"
fi

View File

@@ -50,7 +50,7 @@ sls_detector_put readoutspeed full_speed
sls_detector_put gainmode dynamic
CLI=/afs/psi.ch/project/sls_det_software/serial_control_software/minidelay/minidelay
CLI=/psi.ch/group/detector/software/serial_control_software/minidelay/minidelay
# prepare the AGILENT 33250A
echo $CLI" OUTP OFF " | nc pc10773 5555

View File

@@ -68,7 +68,7 @@ if [ ! -v $1 & ! -v $2 ]; then
#sls_detector_put reg 0x59 0x0100 #0000 0001 0000 0000
#CLI=/afs/psi.ch/project/sls_det_software/bin/sl7_binaries_to_be_removed_soon/xrayClient_sl7
CLI=/afs/psi.ch/project/sls_det_software/bin/xrayClient_sl8 #/vacuumClient_sl7
CLI=/psi.ch/group/detector/software/bin/xrayClient_sl8 #/vacuumClient_sl7
# CLI=/afs/psi.ch/project/sls_det_software/bin/vacuumClient_sl8 # for small X-ray box
$CLI setv 60

View File

@@ -54,7 +54,7 @@ sls_detector_put reg 0x7f 0xff1f
CLI=/afs/psi.ch/project/sls_det_software/bin/xrayClient_sl8
CLI=/psi.ch/group/detector/software/bin/xrayClient_sl8
$CLI setv 60
$CLI setc 40
$CLI HV on

View File

@@ -54,7 +54,7 @@ if [ ! -v $1 ]; then
$KILLRCV
#CLI=/afs/psi.ch/project/sls_det_software/bin/sl7_binaries_to_be_removed_soon/xrayClient_sl7 #/vacuumClient_sl7
CLI=/afs/psi.ch/project/sls_det_software/bin/xrayClient_sl8 #/vacuumClient_sl7
CLI=/psi.ch/group/detector/software/bin/xrayClient_sl8 #/vacuumClient_sl7
$CLI setv 60
$CLI setc 40
$CLI HV on

View File

@@ -59,7 +59,7 @@ sls_detector_put readoutspeed half_speed
#sls_detector_put reg 0x59 0x0100 #0000 0001 0000 0000
CLI=/afs/psi.ch/project/sls_det_software/bin/xrayClient_sl8 #/vacuumClient_sl7
CLI=/psi.ch/group/detector/software/bin/xrayClient_sl8 #/vacuumClient_sl7
$CLI setv 60
$CLI setc 40
$CLI HV on

View File

@@ -48,11 +48,11 @@ sls_detector_put readoutspeed half_speed
#CLI=/afs/psi.ch/project/sls_det_software/bin/sl7_binaries_to_be_removed_soon/xrayClient_sl7
CLI=/afs/psi.ch/project/sls_det_software/bin/xrayClient_sl8 #/vacuumClient_sl7
CLI=/psi.ch/group/detector/software/bin/xrayClient_sl8 #/vacuumClient_sl7
# CLI=/afs/psi.ch/project/sls_det_software/bin/vacuumClient_sl8 # for small X-ray box
$CLI setv 40
$CLI setc 60 # for big X-ray box
$CLI setv 60
$CLI setc 40 # for big X-ray box
# $CLI setc 55 # for small X-ray box
$CLI HV on

View File

@@ -6,23 +6,29 @@ This project details the JUNGFRAU calibration procedure.
Provides an absolute calibration of high gain. Copper fluorescence is used to illuminate the sensor. The resulting noise and Kalpha peaks are fit with a gaussian and charge sharing model. The gain for 8 keV is the distance between the two peaks.
Scripts are:
- `CuFluo_exposure.sh` to perform the exposure in the X-ray box
- `CuFluo_exposure.sh <#> <readoutspeed>` to perform the exposure in the X-ray box. It requires the module number as a first argument and the readout speed: full_speed or half_speed, as a second argument.
- `CuFluo_exposure_both_speeds.sh <#>` to perform the exposure in the X-ray box at half and full readout speed. It requires the module number as a first argument.
- `CuFluo_analysis.cpp` to measure the peak-to-peak distance
- Legacy: `CuFluo_Ka_KaKb_Comp.cpp` to quantify the difference between different fit models
For calibration of storage cells:
- `CuFluo_exposure_sc.sh` to perform the exposure in the X-ray box
- `CuFluo_exposure_sc.sh <#> <readoutspeed>` to perform the exposure in the X-ray box. It requires the module number as a first argument and the readout speed: full_speed or half_speed, as a second argument.
- `CuFluo_analysis_sc_singlethread_data.cpp` to read pixel spectra from a single storage cell into .root
- `CuFluo_analysis_sc_singlethread_fits.cpp` to measure the peak-to-peak distance for a single storage cell
Not written multithreaded, but can be launched for multiple storage cells on multiple cores in parallel.
## Backplane pulsing
Provides a relative calibration between high and medium gains. A seperate circuit board is used to pulse the voltage on the backplane of the sensor. By varying the size of the pulse, the response of high and medium gains can be measured and fit with linear functions. The ratio of the two gains is the ratio of fitted gradients.
Provides a relative calibration between high and medium gains. A separate circuit board is used to pulse the voltage on the backplane of the sensor. By varying the size of the pulse, the response of high and medium gains can be measured and fit with linear functions. The ratio of the two gains is the ratio of fitted gradients.
Scripts are:
- `BP_scan.sh` to perform the scan
- `BP_analysis.cpp` to calculate the response, fit the gradients and measure the ratio
- `BP_scan.sh <#> <readoutspeed>` to perform the scan with old amplifier board. The module number and readout: half_speed or full_speed, have to be specified as a first and second argument.
- `BP_scan_both_speeds.sh <#>` to perform the scan with old amplifier board. The module number has to be specified as a first argument.
- `BP_scan_thinSensor.sh` to perform the scan with old amplifier board at 150um sensors. The filename_creator.sh has to be sorced before.
- `BP_scan_new_board.sh <#> <readoutspeed>` to perform the scan with new amplifier board. The module number and readout: half_speed or full_speed, have to be specified as a first and second argument.
- `BP_analysis.cpp` to calculate the response of the old amplifier board, fit the gradients and measure the ratio
- `BP_analysis_thinSensors.cpp` to calculate the response of the old amplifier board of 150um sensors, fit the gradients and measure the ratio.
- `BP_analysis_new_board_30V.cpp` to calculate the response of the new amplifier board, fit the gradients and measure the ratio.
- Legacy: `BP_DB_Comp.cpp` to quantify the difference between the two methods
For calibration of storage cells, we assume that the relative gains behave the same for all storage cells and no extra data are taken or analysis performed.
@@ -31,7 +37,10 @@ For calibration of storage cells, we assume that the relative gains behave the s
Provides a relative calibration between medium and low gains. An internal current source is used to inject charge into the ASIC one column at a time. By varying the integration time, the amound of collected charge is varied and the response of medium and low gain can be measured. The ratio of the two gains is the ratio of fitted gradients.
Scripts are:
- `CS_scan.sh` to perform the scan
- `CS_scan.sh <#> <readoutspeed>` to perform the current source scan. It requires the module number as a first argument and the readout speed: full_speed or half_speed, as a second argument.
- `CS_scan_both_speeds.sh <#>` to perform the current source scan at half and full speed. It requires the module number as a first argument.
- `CS_scan_multi_ROB.sh <#jfcalib-0> <#jfcalib-1> <#jfcalib-2> <#jfcalib-3> <#jfcalib-4> <#jfcalib-5>` to perform the current source scan for all the calibration ROB simultaneously. It requires to pass the module numbers in the correct order.
- `CS_scan_multi_ROB_bothspeeds.sh <#jfcalib-0> <#jfcalib-1> <#jfcalib-2> <#jfcalib-3> <#jfcalib-4> <#jfcalib-5>` to perform the current source scan for all the calibration ROB simultaneously, first at half_speed and finally at full_speed. It requires to pass the module numbers in the correct order.
- `CS_analysis.cpp` to calculate the response, fit the gradients and measure the ratio
- Legacy: `CS_BaselineTest.cpp` to check that increasing the integratio time doesn't change the baseline
@@ -53,8 +62,8 @@ For calibration of storage cells:
## Workflow to perform the calibration
Data taking:
- Set up environment variables: `source setup_env.sh`
- Set receiver PC: `source pccalib.sh <pc_name>` (either mpc2012 or pc-jungfrau-test)
- Create receiver commands: `source filename_creator.sh <module_number>` (without preceeding M)
- Set receiver PC: `source pccalib.sh <pc_name>` (pc-jungfrau-02, pc-jungfrau-01(mpc2012 is also valid) or pc-jungfrau-test)
- Create receiver commands: `source filename_creator.sh <module_number>` (without preceeding M. It is not necessary anymore to source filename_creator.sh)
- Make sure the client version `slsDetector_bin` points to is in line with the jungfrauDetectorServer on the readout board.
- `sls_detector_put hostname jfcalib_x` (x=0..5)
- If required: Set up pulse generator serial connection on pc8830 (BP_scan)
@@ -84,4 +93,4 @@ Scripts are:
## References
- Calibration status and plans for the charge integrating JUNGFRAU pixel detector for SwissFEL, S. Redford et al 2016 JINST 11 C11013
- First full dynamic range calibration of the JUNGFRAU photon detector, S. Redford et al 2018 JINST 13 C01027
- First full dynamic range calibration of the JUNGFRAU photon detector, S. Redford et al 2018 JINST 13 C01027

View File

@@ -116,10 +116,9 @@ else
read -n 1 -s input
echo $input
fi
if [[ $input = "Y" ]]; then
echo "creating the output folders."
plotbasefolder="/afs/psi.ch/project/mythen/sophie/JFCalibration/plots/M"$1
plotbasefolder="/psi.ch/group/detector/jungfrau/Calibration/JFCalibration/plots/M"$1
mkdir -v $plotbasefolder
mkdir -v $plotbasefolder"/BackplanePulsing"
# mkdir -v $plotbasefolder"/Calib_"$datestring #done by/JFMC_CalibWrite
@@ -127,7 +126,7 @@ if [[ $input = "Y" ]]; then
mkdir -v $plotbasefolder"/CuFluo/G0"
mkdir -v $plotbasefolder"/CuFluo/HG0"
mkdir -v $plotbasefolder"/CurrentSource"
outdatabasefolder="/afs/psi.ch/project/mythen/sophie/JFCalibration/data/M"$1
outdatabasefolder="/psi.ch/group/detector/jungfrau/Calibration/JFCalibration/data/M"$1
mkdir -v $outdatabasefolder
echo "Output folders created"