Skip to content
Snippets Groups Projects
Commit aaf1b24f authored by Mario's avatar Mario
Browse files

Modified the structure of the data folder

parent 4ba08a5c
No related branches found
No related tags found
1 merge request!23Devel
......@@ -156,12 +156,14 @@ echo "$(($(<$SOBASE/.counters/runNumber)+1))" > $SOBASE/.counters/runNumber
export SO_RUNNUMBER="$(<$SOBASE/.counters/today)_$(printf "%03d" $(<$SOBASE/.counters/runNumber))"
# data folder
mkdir -p $SOBASE/data/$SO_RUNNUMBER
# data folders
mkdir -p $SOBASE/data/by_runnumber/$SO_RUNNUMBER
mkdir -p $SOBASE/data/by_moduleid/$module_id/
ln -s $SOBASE/data/by_runnumber/$SO_RUNNUMBER $SOBASE/data/by_moduleid/$module_id/
# time data
touch $SOBASE/data/$SO_RUNNUMBER/time.dat
export TIMEFILE="$SOBASE/data/$SO_RUNNUMBER/time.dat"
touch $SOBASE/data/by_runnumber/$SO_RUNNUMBER/time.dat
export TIMEFILE="$SOBASE/data/by_runnumber/$SO_RUNNUMBER/time.dat"
echo -ne "# what Elapsed (s)\n" >> $TIMEFILE
# start measuring time
......@@ -212,7 +214,7 @@ fi
if [[ "$syncOption" == "" ]] && [[ "$localdbOpt" != "" ]]
then
syncScript=$SOBASE/data/$SO_RUNNUMBER/moveDCStoLocalDB.sh
syncScript=$SOBASE/data/by_runnumber/$SO_RUNNUMBER/moveDCStoLocalDB.sh
touch $syncScript
echo "# Usage: " >> $syncScript
echo "# bash moveDCStoLocalDB.sh idb_to_ldb.json" >> $syncScript
......@@ -515,8 +517,13 @@ fi
echo -e "\n[ info ][so] Running the sequence of scans"
scan_list=$(jq -j '.common_config.scan_list' $SCANCFG)
nScans="$(jq -j --arg b $scan_list '."\($b)" | length' $SCANCFG)"
if [ $nScans == 0 ]; then
echo "[ error ][so] specified scan_list is empty! make sure that the spelling is correct"
echo " in the cfg file $SCANCFG"
fi
nScans="$(jq -j '.scan_list | length' $SCANCFG)"
for i in $(seq 1 $nScans); do
if [[ "$dcsMonitor" == "1" ]]; then
......@@ -534,7 +541,7 @@ for i in $(seq 1 $nScans); do
fi
fi
obj="$(jq -j --argjson a ${i} '.scan_list[$a-1]' $SCANCFG)"
obj="$(jq -j --argjson a ${i} --arg b $scan_list '."\($b)"[$a-1]' $SCANCFG)"
obj="$(echo -e "${obj}" | tr -d '[:space:]')"
comm="$SOBASE/scanLauncher.sh -m ${module_id} -s $obj ${dcsOpt} ${localdbOpt} ${qcOpt} ${syncOption}"
......
......@@ -147,7 +147,7 @@ ctrlFile="$SOBASE/configs/rd53a/$module_id/controller.json"
cnctFile="$SOBASE/configs/rd53a/$module_id/connectivity.json"
#ctrlFile="/home/mario/work/yr/configs/controller/emuCfg.json"
comm="$YARRBASE/bin/scanConsole -r $ctrlFile -c $cnctFile -p -t ${targetAmpOrCharge} ${targetToT} -s ${scanPath} -m $reset_masks -o $SOBASE/data/$SO_RUNNUMBER $localdbOpt $qcOpt" #> /dev/null 2>1
comm="$YARRBASE/bin/scanConsole -r $ctrlFile -c $cnctFile -p -t ${targetAmpOrCharge} ${targetToT} -s ${scanPath} -m $reset_masks -o $SOBASE/data/by_runnumber/$SO_RUNNUMBER $localdbOpt $qcOpt" #> /dev/null 2>1
echo "[ info ][sl] Calling Yarr's scanConsole"
echo "[ info ][sl] $comm"
......@@ -193,7 +193,7 @@ if [[ "$localdbOpt" != "" ]]; then
if [ $dcsMonitor == 1 ] && [ $syncDatabases == 1 ] ;then
cmd="$YARRBASE/bin/dbAccessor -F $DBCOMCFG -n $module_id -s $SOBASE/data/$SO_RUNNUMBER/${RunNumber}_$scanName/scanLog.json"
cmd="$YARRBASE/bin/dbAccessor -F $DBCOMCFG -n $module_id -s $SOBASE/data/by_runnumber/$SO_RUNNUMBER/${RunNumber}_$scanName/scanLog.json"
echo "[ info ][sl] Pushing the DCS data to localDB"
echo "[ info ][sl] $cmd"
$cmd
......@@ -201,8 +201,8 @@ if [[ "$localdbOpt" != "" ]]; then
elif ! [ $syncDatabases == 1 ] ;then
cmd="$YARRBASE/bin/dbAccessor -F \$1 -n $module_id -s $SOBASE/data/$SO_RUNNUMBER/${RunNumber}_$scanName/scanLog.json"
echo "$cmd" >> $SOBASE/data/$SO_RUNNUMBER/moveDCStoLocalDB.sh
cmd="$YARRBASE/bin/dbAccessor -F \$1 -n $module_id -s $SOBASE/data/by_runnumber/$SO_RUNNUMBER/${RunNumber}_$scanName/scanLog.json"
echo "$cmd" >> $SOBASE/data/by_runnumber/$SO_RUNNUMBER/moveDCStoLocalDB.sh
fi
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment