Files
JFCalibration/filename_creator.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

139 lines
4.8 KiB
Bash

#!/bin/bash
if [[ "$0" == *"filename_creator.sh"* ]]; then
echo "script changes env. variables: should be invoked with source, not sh "
exit
fi
echo "Run pccalib.sh [pc_name] to set the DST ip address before running the filename creator"
echo $0
echo "printing filenames for module " $1
#define folder structure
parentdir="/mnt/sls_det_storage/jungfrau_calib/"
calib_relativedir="data/Module_"$1"_Calib/"
ana_relativedir="ana/M"$1"_CalibAna/"
calibdatafolder=$parentdir$calib_relativedir
anadatafolder=$parentdir$ana_relativedir
#datafolder="/mnt/sls_det_storage/jungfrau_calib/data/Module_"$1"_Calib/"
datestring=$(date +%F)
echo "Relative calib directory is "$calib_relativedir
echo "Relative analysis results directory is "$ana_relativedir
echo "mkdir "$calibdatafolder "if not already existing."
mkdir -p $calibdatafolder
#Rcv="./slsDetector_bin_8_0_2_RHEL7/ju_udp_receiver_3threads_2_0 S " #mpc2012 RHEL7
Rcv="./slsDetector_bin/ju_udp_receiver_3threads_2_0 S " #pc-jungfrau-02 RHEL8
export TKBPG0=$Rcv$calibdatafolder"BP_M"$1"_"$datestring"_ "$DSTIP
#export TKBPG0="./slsDetector_bin/ju_udp_receiver_3threads_2_0 S "$calibdatafolder"BP_M"$1"_"$datestring"_ 10.1.1.106"
export TKBPHG0=$Rcv$calibdatafolder"BP_M"$1"_"$datestring"_HGOG1G2_ "$DSTIP
#export TKBPHG0="./slsDetector_bin/ju_udp_receiver_3threads_2_0 S "$calibdatafolder"BP_M"$1"_"$datestring"_HGOG1G2_ 10.1.1.106"
export TKCSHG0=$Rcv$calibdatafolder"CS_M"$1"_"$datestring"_HGOG1G2_ "$DSTIP
#export TKCSHG0="./slsDetector_bin/ju_udp_receiver_3threads_2_0 S "$calibdatafolder"CS_M"$1"_"$datestring"_HGOG1G2_ 10.1.1.106"
export TKCSG0=$Rcv$calibdatafolder"CS_M"$1"_"$datestring"_ $DSTIP"
#export TKCSG0="./slsDetector_bin/ju_udp_receiver_3threads_2_0 S "$calibdatafolder"CS_M"$1"_"$datestring"_ 10.1.1.106"
echo "exporting the fluorescence receiver commands "
export TKFG0=$Rcv$calibdatafolder"CuFluoG0_M"$1"_"$datestring"_ "$DSTIP
#export TKFG0="./slsDetector_bin/ju_udp_receiver_3threads_2_0 S "$calibdatafolder"CuFluoG0_M"$1"_"$datestring"_ 10.1.1.106"
export TKFHG0=$Rcv$calibdatafolder"CuFluoHG0_M"$1"_"$datestring"_ "$DSTIP
#export TKFHG0="./slsDetector_bin/ju_udp_receiver_3threads_2_0 S "$calibdatafolder"CuFluoHG0_M"$1"_"$datestring"_ 10.1.1.106"
export TKPG0=$Rcv$calibdatafolder"pedeG0_M"$1"_"$datestring"_ "$DSTIP
#export TKPG0="./slsDetector_bin/ju_udp_receiver_3threads_2_0 S "$calibdatafolder"pedeG0_M"$1"_"$datestring"_ 10.1.1.106"
export TKPHG0=$Rcv$calibdatafolder"pedeHG0_M"$1"_"$datestring"_ "$DSTIP
#export TKPHG0="./slsDetector_bin/ju_udp_receiver_3threads_2_0 S "$calibdatafolder"pedeHG0_M"$1"_"$datestring"_ 10.1.1.106"
echo "printing the analysis commands "
for file in $(find $calibdatafolder -type f -exec basename {} \; | grep 000000 ); do
prefix=${file%_000000.dat}
echo $prefix ;
if [[ $prefix == *"BP"* ]]; then
bpfile=$prefix
fi
if [[ $prefix == *"CS"* ]]; then
csfile=$prefix
fi
if [[ $prefix == *"oG0"* ]]; then
cgofile=$prefix
fi
if [[ $prefix == *"eG0"* ]]; then
pgofile=$prefix
fi
if [[ $prefix == *"oHG0"* ]]; then
chgofile=$prefix
fi
if [[ $prefix == *"eHG0"* ]]; then
phgofile=$prefix
fi
# echo "ss"
done
echo "----------------------------------------------------------------------"
echo "---------------------START OF ANALYSIS CLI commands --------------------"
echo "----------------------------------------------------------------------"
echo "M"$1
echo "./BP_analysis "$1" "$calibdatafolder$bpfile" "$anadatafolder
echo "./CS_analysis "$1" "$calibdatafolder" "$csfile" "$anadatafolder
echo "./CuFluo_analysis "$1" G0 "$calibdatafolder $pgofile $cgofile $anadatafolder
echo "./CuFluo_analysis "$1" HG0 "$calibdatafolder $phgofile $chgofile $anadatafolder
echo "./JFMC_CalibWriter_wBP" "$1"
echo " "
echo "----------------------------------------------------------------------"
echo "---------------------END OF ANALYSIS CLI commands --------------------"
echo "----------------------------------------------------------------------"
echo "creating the output folders? Y for yes "
if [ ! -v $2 ]; then
input=$2
echo $input
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
mkdir -v $plotbasefolder
mkdir -v $plotbasefolder"/BackplanePulsing"
# mkdir -v $plotbasefolder"/Calib_"$datestring #done by/JFMC_CalibWrite
mkdir -v $plotbasefolder"/CuFluo"
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
mkdir -v $outdatabasefolder
echo "Output folders created"
else
echo "Exiting script"
fi