X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=cluster_tools%2Fgate_power_merge.sh;h=3a9bba6b23b01002bb32dd303a9d3259dd787475;hb=5753311ba2368f89edfd7ba3d43a0186de1b16b5;hp=f82a11931d69cbd3df28c289a620ccd461bdf4bc;hpb=855cbced296ae0197f6725e2e6bf255c5cce16a2;p=clitk.git diff --git a/cluster_tools/gate_power_merge.sh b/cluster_tools/gate_power_merge.sh index f82a119..3a9bba6 100755 --- a/cluster_tools/gate_power_merge.sh +++ b/cluster_tools/gate_power_merge.sh @@ -299,7 +299,7 @@ function merge_mhd_image { update_bar ${count} "adding ${partial}" ${mhdImageMerger} -t 0 -i "${partial}" -j "${merged}" -o "${merged}" 2> /dev/null > /dev/null || warning "error while calling ${mhdImageMerger}" - if test "$last_character" = "d" + if test "$last_character" = "d" && test "${merged_bin}" != "${merged_bin%.*}.${partial_bin##*.}" then mv "${merged_bin}" "${merged_bin%.*}.${partial_bin##*.}" sed -i "s/$(basename "${merged_bin}")/$(basename "${merged_bin%.*}.${partial_bin##*.}")/" "${merged}" @@ -444,7 +444,7 @@ function merge_dispatcher_uncertainty { if [[ "${firstpartialoutputfile}" == *Uncertainty* ]] then - if test "${firstpartialoutputextension}" == "mhd" + if test "${firstpartialoutputextension}" == "mhd" || test "${firstpartialoutputextension}" == "mha" then echo "${indent}Uncertainty file found: ${firstpartialoutputfile}" ## search for sum @@ -466,7 +466,7 @@ function merge_dispatcher_uncertainty { echo "${indent}${squared_merged_file} found" ## search for NumberOfEvent totalEvents=0; - for outputfile in $(find "${rundir}" -regextype 'posix-extended' -type f -regex "${rundir}/output.*\.(hdr|mhd|root|txt)" | awk -F '/' '{ print $NF; }' | sort | uniq) + for outputfile in $(find "${rundir}" -regextype 'posix-extended' -type f -regex "${rundir}/output.*\.(hdr|mhd|mha|root|txt)" | awk -F '/' '{ print $NF; }' | sort | uniq) do #echo $outputfile if grep -q 'NumberOfEvent' "${outputdir}/${outputfile}" @@ -485,6 +485,8 @@ function merge_dispatcher_uncertainty { warning "${totalEvents} not positive. A at least one stat file (SimulationStatisticActor) must be provided. Error, no uncertainty computed" return; fi + else + error "merge_dispatcher_uncertainty does not handle ${firstpartialoutputfile} files" fi fi @@ -517,7 +519,7 @@ done echo "" echo "Merging done. Special case for statistical uncertainty" -for outputfile in $(find "${outputdir}" -regextype 'posix-extended' -type f -regex "${outputdir}/.*\.(hdr|mhd|root|txt)" | awk -F '/' '{ print $NF; }' | sort | uniq) +for outputfile in $(find "${outputdir}" -regextype 'posix-extended' -type f -regex "${outputdir}/.*\.(hdr|mhd|mha|root|txt)" | awk -F '/' '{ print $NF; }' | sort | uniq) do merge_dispatcher_uncertainty "${outputfile}" done