Fixed a bug in msr2data which affected the msr-file generation if the fit template was equal to one of the target files
This commit is contained in:
38
src/external/scripts/msr2data
vendored
38
src/external/scripts/msr2data
vendored
@ -80,7 +80,8 @@ EOFHELP
|
|||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
export PATH=./:$PATH
|
PATH=./:$PATH
|
||||||
|
LC_NUMERIC=en_US.UTF-8
|
||||||
|
|
||||||
SUMMDIR="/mnt/data/nemu/summ"
|
SUMMDIR="/mnt/data/nemu/summ"
|
||||||
|
|
||||||
@ -260,7 +261,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# if it's the first run to be fitted, take the template and substitute the runnumber to match the first run
|
# if it's the first run to be fitted, take the template and substitute the runnumber to match the first run
|
||||||
if [ "$q" -eq 0 ]; then
|
if [ "$q" -eq 0 ] && [ "$TEMPLATE" != "$FIRSTINPUT" ]; then
|
||||||
awk -v count=$TEMP -v nextcount=${RUNARRAY[0]} -v nextinput=$FIRSTINPUT '{
|
awk -v count=$TEMP -v nextcount=${RUNARRAY[0]} -v nextinput=$FIRSTINPUT '{
|
||||||
if(NR==1) print nextcount > nextinput
|
if(NR==1) print nextcount > nextinput
|
||||||
else if($1 == "RUN") {
|
else if($1 == "RUN") {
|
||||||
@ -300,21 +301,23 @@ else
|
|||||||
COUNTX=$COUNT
|
COUNTX=$COUNT
|
||||||
TEMPLATEX=$COUNT$EXTENSION.$OUTPUTEXT
|
TEMPLATEX=$COUNT$EXTENSION.$OUTPUTEXT
|
||||||
fi
|
fi
|
||||||
awk -v count=$COUNTX -v nextcount=$NEXTCOUNT -v nextinput=$NEXTINPUT '{
|
if [ "$TEMPLATEX" != "$NEXTINPUT" ]; then
|
||||||
if(NR==1) print nextcount > nextinput
|
awk -v count=$COUNTX -v nextcount=$NEXTCOUNT -v nextinput=$NEXTINPUT '{
|
||||||
else if($1 == "RUN") {
|
if(NR==1) print nextcount > nextinput
|
||||||
if (substr(count,1,1) != "_"){ count = sprintf("_%04u", count); nextcount = sprintf("_%04u", nextcount);}
|
else if($1 == "RUN") {
|
||||||
if ($2 !~ count){
|
if (substr(count,1,1) != "_"){ count = sprintf("_%04u", count); nextcount = sprintf("_%04u", nextcount);}
|
||||||
print " "
|
if ($2 !~ count){
|
||||||
print ">> msr2data: ATTENTION The run-numbers in the filename and the RUN-block of the file do not match!"
|
print " "
|
||||||
print ">> msr2data: The run-number substitution is most likely going wrong!"
|
print ">> msr2data: ATTENTION The run-numbers in the filename and the RUN-block of the file do not match!"
|
||||||
print " "
|
print ">> msr2data: The run-number substitution is most likely going wrong!"
|
||||||
|
print " "
|
||||||
|
}
|
||||||
|
sub(count, nextcount, $0);
|
||||||
|
print $0 >> nextinput
|
||||||
}
|
}
|
||||||
sub(count, nextcount, $0);
|
else print $0 >> nextinput
|
||||||
print $0 >> nextinput
|
}' $TEMPLATEX
|
||||||
}
|
fi
|
||||||
else print $0 >> nextinput
|
|
||||||
}' $TEMPLATEX
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -420,6 +423,9 @@ else
|
|||||||
# put together all data to db- or column-format and write it to the file
|
# put together all data to db- or column-format and write it to the file
|
||||||
awk -v outfile=$OUTFILE -v noheader=$NOHEADER -v runList=$RUNLIST_USED -v numIndVar=$NUM_OF_IND_VAR -v format=$FORMAT '{
|
awk -v outfile=$OUTFILE -v noheader=$NOHEADER -v runList=$RUNLIST_USED -v numIndVar=$NUM_OF_IND_VAR -v format=$FORMAT '{
|
||||||
|
|
||||||
|
if(tolower(outfile) == "none")
|
||||||
|
exit 0
|
||||||
|
|
||||||
FS = " "
|
FS = " "
|
||||||
OFS = " "
|
OFS = " "
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user