Changeset 15382 for trunk/DataCheck/QuickLook
- Timestamp:
- 04/19/13 20:52:05 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/QuickLook/Step2b.sh
r15310 r15382 17 17 # getting all nights 18 18 printprocesslog "INFO get all nights for source "$source 19 dirs=( `find $anapath/$source/datasets 005min -maxdepth 3 -mindepth 3 -type d 2>/dev/null | sort` )20 nights=119 dirs=( `find $anapath/$source/datasets_run -maxdepth 3 -mindepth 3 -type d 2>/dev/null | sort` ) 20 #nights=1 21 21 # write data set file 22 dspath=$anapath/$source/datasets `printf %04d $nights`nights22 dspath=$anapath/$source/datasets_night 23 23 makedir $dspath 24 24 for (( i=1 ; i<=${#dirs[@]} ; i++ )) 25 25 do 26 26 numdsfiles=`find ${dirs[$i-1]} -type f | wc -l` 27 imgpath=`echo ${dirs[$i-1]} | sed -e 's/datasets 005min/star/'`27 imgpath=`echo ${dirs[$i-1]} | sed -e 's/datasets_run/star/'` 28 28 numimgfiles=`find $imgpath -type f -name '*_I.root' | wc -l` 29 29 echo ${dirs[$i-1]}" "$numdsfiles" "$numimgfiles 30 dsfile=$dspath/dataset$i.txt 30 night=`echo ${dirs[$i-1]} | cut -d/ -f6-8 | sed -e 's/\///g'` 31 echo $night 32 dsfile=$dspath"/dataset"$night".txt" 33 numold=`cat $dsfile | wc -l` 34 echo ${dirs[$i-1]}" "$numdsfiles" "$numimgfiles" "$numold 35 echo $dsfile 31 36 printprocesslog "INFO writing dataset file "$dsfile 32 37 echo "INFO writing dataset file "$dsfile … … 35 40 # process only if ganymedlogfiles is not yet there 36 41 logfile=`echo $dsfile | sed -e 's/datasets/ganymed/' -e 's/dataset//' -e 's/[.]txt/-ganymed[.]log/'` 37 if [ $numdsfiles -ne $numimgfiles ] 42 echo $logfile 43 # this does not work as there might be dataset files already pr 44 #if [ $numdsfiles -ne $numimgfiles ] 45 if [ $numold -lt $numimgfiles ] 38 46 then 39 47 printprocesslog "INFO remove $logfiles (new files added to dataset) " … … 42 50 if ! ls $logfile >/dev/null 2>&1 43 51 then 52 echo "`dirname $0`/RunGanymed.sh $source $dsfile" 44 53 `dirname $0`/RunGanymed.sh $source $dsfile 45 54 numganymeds=`echo " $numganymeds + 1 " | bc -l` … … 47 56 done 48 57 49 # get list of dataset files for 1 night as starting point 50 printprocesslog "INFO get list of dataset files for "$nights" nights" 51 files=( `find $dspath -type f -name 'dataset*.txt' | sort` ) 52 nightsold=1 53 # loop over data set files 54 # copy always 2 in one new file for double observation time 55 while [ ${#files[@]} -gt 1 ] 56 do 57 # get double observation time and path for datasets 58 nights=`echo " $nightsold + $nightsold " | bc -l ` 59 dspathold=$dspath 60 dspath=$anapath"/"$source"/datasets"`printf %04d $nights`"nights" 61 makedir $dspath 62 # loop over already existing data set files 63 for (( i=0 ; i<=${#files[@]} ; i++ )) 64 do 65 # number of 1st and 2nd old dataset file 66 num1=`echo " $i + $i + 1" | bc -l ` 67 num2=`echo " $i + $i + 2 " | bc -l ` 68 # number of new dataset file 69 dsnum=`echo " $i + 1 " | bc -l ` 70 # continue only if 2 dataset files are left 71 if ! [ ${files[$num1]} ] 72 then 73 break 74 fi 75 ds1=$dspathold"/dataset"$num1".txt" 76 ds2=$dspathold"/dataset"$num2".txt" 77 dsfile=$dspath"/dataset"$dsnum".txt" 78 # copy two old into one new dataset file 79 printprocesslog "INFO writing dataset "$dsfile 80 echo "INFO writing dataset "$dsfile 81 cat $ds1 > $dsfile 82 cat $ds2 >> $dsfile 83 # process only if ganymedlogfiles is not yet there 84 logfile=`echo $dsfile | sed -e 's/datasets/ganymed/' -e 's/dataset//' -e 's/[.]txt/-ganymed[.]log/'` 85 if ! ls $logfile >/dev/null 2>&1 86 then 87 `dirname $0`/RunGanymed.sh $source $dsfile 88 numganymeds=`echo " $numganymeds + 1 " | bc -l` 89 fi 90 done 91 # get list of new dataset files 92 printprocesslog "INFO get list of dataset files for "$nights" nights" 93 files=( `find $dspath -type f -name 'dataset*.txt' | sort` ) 94 nightsold=$nights 95 done 96 if [ $numganymeds -gt 0 ] 97 then 98 if ! ps aux | grep Step3 | grep -v grep >/dev/null 2>&1 99 then 100 `dirname $0`/Step3.sh nights & 101 fi 102 numganymeds=0 103 fi 58 # # get list of dataset files for 1 night as starting point 59 # printprocesslog "INFO get list of dataset files for "$nights" nights" 60 # files=( `find $dspath -type f -name 'dataset*.txt' | sort` ) 61 # nightsold=1 62 # # loop over data set files 63 # # copy always 2 in one new file for double observation time 64 # while [ ${#files[@]} -gt 1 ] 65 # do 66 # # get double observation time and path for datasets 67 # nights=`echo " $nightsold + $nightsold " | bc -l ` 68 # dspathold=$dspath 69 # dspath=$anapath"/"$source"/datasets"`printf %04d $nights`"nights" 70 # makedir $dspath 71 # # loop over already existing data set files 72 # for (( i=0 ; i<=${#files[@]} ; i++ )) 73 # do 74 # # number of 1st and 2nd old dataset file 75 # num1=`echo " $i + $i + 1" | bc -l ` 76 # num2=`echo " $i + $i + 2 " | bc -l ` 77 # # number of new dataset file 78 # dsnum=`echo " $i + 1 " | bc -l ` 79 # # continue only if 2 dataset files are left 80 # if ! [ ${files[$num1]} ] 81 # then 82 # break 83 # fi 84 # ds1=$dspathold"/dataset"$num1".txt" 85 # ds2=$dspathold"/dataset"$num2".txt" 86 # dsfile=$dspath"/dataset"$dsnum".txt" 87 # # copy two old into one new dataset file 88 # printprocesslog "INFO writing dataset "$dsfile 89 # echo "INFO writing dataset "$dsfile 90 # cat $ds1 > $dsfile 91 # cat $ds2 >> $dsfile 92 # # process only if ganymedlogfiles is not yet there 93 # logfile=`echo $dsfile | sed -e 's/datasets/ganymed/' -e 's/dataset//' -e 's/[.]txt/-ganymed[.]log/'` 94 # if ! ls $logfile >/dev/null 2>&1 95 # then 96 # `dirname $0`/RunGanymed.sh $source $dsfile 97 # numganymeds=`echo " $numganymeds + 1 " | bc -l` 98 # fi 99 # done 100 # # get list of new dataset files 101 # printprocesslog "INFO get list of dataset files for "$nights" nights" 102 # files=( `find $dspath -type f -name 'dataset*.txt' | sort` ) 103 # nightsold=$nights 104 # done 105 106 echo "found "$numganymeds" ganymeds." 107 #if [ $numganymeds -gt 0 ] 108 #then 109 # if ! ps aux | grep Step3 | grep -v grep >/dev/null 2>&1 110 # then 111 # `dirname $0`/Step3.sh nights & 112 # fi 113 # numganymeds=0 114 #fi 104 115 105 116 done
Note:
See TracChangeset
for help on using the changeset viewer.