- Timestamp:
- 04/19/13 20:52:39 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/QuickLook/Step2a.sh
r15310 r15383 26 26 for source in ${sources[@]} 27 27 do 28 # doing first 5min datasets, i.e. one image file per dataset29 min=528 ## doing first 5min datasets, i.e. one image file per dataset 29 #min=5 30 30 # getting all image files for this source and night 31 31 printprocesslog "INFO get file list for source "$source … … 37 37 fi 38 38 # write data set file 39 dspath=$anapath/$source/datasets`printf %03d $min`min/$datepath 39 #dspath=$anapath/$source/datasets`printf %03d $min`min/$datepath 40 dspath=$anapath/$source/datasets_run/$datepath 40 41 makedir $dspath 41 42 for (( i=1 ; i<=${#files[@]} ; i++ )) 42 43 do 43 dsfile=$dspath/dataset$i.txt 44 night=`basename ${files[$i-1]} | cut -d_ -f1` 45 echo "night: "$night 46 run=`basename ${files[$i-1]} | cut -d_ -f2` 47 echo "run: "$run 48 dsfile=$dspath"/dataset"$night"_"$run".txt" 49 echo $dsfile 44 50 printprocesslog "INFO writing dataset file "$dsfile 45 51 # write dataset only if merpp-log is available to make sure that star-file is complete … … 58 64 then 59 65 echo $logfile" "${files[$i-1]} 66 echo "`dirname $0`/RunGanymed.sh $source $dsfile" 60 67 `dirname $0`/RunGanymed.sh $source $dsfile 61 68 numganymeds=`echo " $numganymeds + 1 " | bc -l` … … 63 70 done 64 71 65 # get list of 5min-dataset-files as starting point 66 printprocesslog "INFO get list of dataset files for "$min"min" 67 files=( `find $dspath -type f -name 'dataset*.txt' | sort` ) 68 minold=5 69 # loop over data set files 70 # copy always 2 in one new file for double observation time 71 while [ ${#files[@]} -gt 1 ] 72 do 73 # get double observation time and path for datasets 74 min=`echo " $minold + $minold " | bc -l ` 75 dspathold=$dspath 76 dspath=$anapath"/"$source"/datasets"`printf %03d $min`"min/"$datepath 77 makedir $dspath 78 # loop over already existing data set files 79 for (( i=0 ; i<=${#files[@]} ; i++ )) 80 do 81 # number of 1st and 2nd old dataset file 82 num1=`echo " $i + $i + 1" | bc -l ` 83 num2=`echo " $i + $i + 2 " | bc -l ` 84 # number of new dataset file 85 dsnum=`echo " $i + 1 " | bc -l ` 86 # continue only if 2 dataset files are left 87 if ! [ ${files[$num1]} ] 88 then 89 break 90 fi 91 ds1=$dspathold"/dataset"$num1".txt" 92 ds2=$dspathold"/dataset"$num2".txt" 93 dsfile=$dspath"/dataset"$dsnum".txt" 94 if ! [ -e $ds1 ] || ! [ -e $ds2 ] 95 then 96 echo $ds1" or "$ds2" is still missing -> continue." 97 continue 98 fi 99 # copy two old into one new dataset file 100 printprocesslog "INFO writing dataset "$dsfile 101 cat $ds1 > $dsfile 102 cat $ds2 >> $dsfile 103 # process only if ganymedlogfiles is not yet there 104 logfile=`echo $dsfile | sed -e 's/datasets/ganymed/' -e 's/dataset//' -e 's/[.]txt/-ganymed[.]log/'` 105 if ! ls $logfile >/dev/null 2>&1 106 then 107 echo $logfile 108 `dirname $0`/RunGanymed.sh $source $dsfile 109 numganymeds=`echo " $numganymeds + 1 " | bc -l` 110 fi 111 done 112 # get list of new dataset files 113 printprocesslog "INFO get list of dataset files for "$min"min" 114 files=( `find $dspath -type f -name 'dataset*.txt' | sort` ) 115 minold=$min 116 done 117 if [ $numganymeds -gt 0 ] 118 then 119 if ! ps aux | grep Step2b | grep -v grep >/dev/null 2>&1 120 then 121 `dirname $0`/Step2b.sh & 122 fi 123 if ! ps aux | grep Step3 | grep -v grep >/dev/null 2>&1 124 then 125 `dirname $0`/Step3.sh min & 126 fi 127 numganymeds=0 128 fi 72 # # get list of 5min-dataset-files as starting point 73 # printprocesslog "INFO get list of dataset files for "$min"min" 74 # files=( `find $dspath -type f -name 'dataset*.txt' | sort` ) 75 # minold=5 76 # # loop over data set files 77 # # copy always 2 in one new file for double observation time 78 # while [ ${#files[@]} -gt 1 ] 79 # do 80 # # get double observation time and path for datasets 81 # min=`echo " $minold + $minold " | bc -l ` 82 # dspathold=$dspath 83 # dspath=$anapath"/"$source"/datasets"`printf %03d $min`"min/"$datepath 84 # makedir $dspath 85 # # loop over already existing data set files 86 # for (( i=0 ; i<=${#files[@]} ; i++ )) 87 # do 88 # # number of 1st and 2nd old dataset file 89 # num1=`echo " $i + $i + 1" | bc -l ` 90 # num2=`echo " $i + $i + 2 " | bc -l ` 91 # # number of new dataset file 92 # dsnum=`echo " $i + 1 " | bc -l ` 93 # # continue only if 2 dataset files are left 94 # if ! [ ${files[$num1]} ] 95 # then 96 # break 97 # fi 98 # ds1=$dspathold"/dataset"$num1".txt" 99 # ds2=$dspathold"/dataset"$num2".txt" 100 # dsfile=$dspath"/dataset"$dsnum".txt" 101 # if ! [ -e $ds1 ] || ! [ -e $ds2 ] 102 # then 103 # echo $ds1" or "$ds2" is still missing -> continue." 104 # continue 105 # fi 106 # # copy two old into one new dataset file 107 # printprocesslog "INFO writing dataset "$dsfile 108 # cat $ds1 > $dsfile 109 # cat $ds2 >> $dsfile 110 # # process only if ganymedlogfiles is not yet there 111 # logfile=`echo $dsfile | sed -e 's/datasets/ganymed/' -e 's/dataset//' -e 's/[.]txt/-ganymed[.]log/'` 112 # if ! ls $logfile >/dev/null 2>&1 113 # then 114 # echo $logfile 115 # `dirname $0`/RunGanymed.sh $source $dsfile 116 # numganymeds=`echo " $numganymeds + 1 " | bc -l` 117 # fi 118 # done 119 # # get list of new dataset files 120 # printprocesslog "INFO get list of dataset files for "$min"min" 121 # files=( `find $dspath -type f -name 'dataset*.txt' | sort` ) 122 # minold=$min 123 # done 124 125 echo "found "$numganymeds" ganymeds." 126 # if [ $numganymeds -gt 0 ] 127 # then 128 # if ! ps aux | grep Step2b | grep -v grep >/dev/null 2>&1 129 # then 130 # `dirname $0`/Step2b.sh & 131 # fi 132 # if ! ps aux | grep Step3 | grep -v grep >/dev/null 2>&1 133 # then 134 # `dirname $0`/Step3.sh min & 135 # fi 136 # numganymeds=0 137 # fi 129 138 done 130 139
Note:
See TracChangeset
for help on using the changeset viewer.