Changeset 15388 for trunk/DataCheck/QuickLook
- Timestamp:
- 04/20/13 19:30:04 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/QuickLook/Step1.sh
r15381 r15388 5 5 6 6 # get date (before 18h there is no new data to be processed) 7 datepath=`date --date="-1 8HOUR" +%Y/%m/%d`8 date=`date --date="-1 8HOUR" +%Y%m%d`7 datepath=`date --date="-19HOUR" +%Y/%m/%d` 8 date=`date --date="-19HOUR" +%Y%m%d` 9 9 #datepath="2013/04/17" 10 10 #date="20130417" … … 67 67 fi 68 68 fileslocal=( `find $rawpath -type f | sort` ) 69 callistofiles=( `find $anapath -type f -name $date*-calibration.log | sort` )69 callistofiles=( `find $anapath/callisto -type f -name $date*-calibration.log | sort` ) 70 70 numdataruns=0 71 71 … … 73 73 makedir $rawpath 74 74 75 echo ${#fileslocal[@]}" "${#files[@]}" "${#callistofiles[@]} 75 echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns 76 printprocesslog "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns 76 77 77 78 while [ ${#fileslocal[@]} -ne ${#files[@]} ] || [ $numdataruns -ne ${#callistofiles[@]} ] 78 79 do 79 80 numdataruns=0 81 echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns 82 printprocesslog "INFO status beginning of while-loop #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns 83 80 84 rsync_aux_file $drivefilenewdaq $drivefile 81 85 … … 135 139 if [ "$runtype" == "data" ] 136 140 then 137 numdataruns=`echo " $numdataruns + 1 " | bc -l`138 141 if [ "$fileerror" = "yes" ] 139 142 then … … 160 163 echo "" >> $seqfile 161 164 162 tstopi=`$factpath/fitsdump -h $localfile 2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'` 163 tstopf=`$factpath/fitsdump -h $localfile 2>/dev/null | grep TSTOPF | grep -E -o '[.][0-9]+'` 164 tstop=${tstopi}${tstopf} 165 coordinates=( `${factpath}/fitsdump ${drivefile} -c Ra_src Dec_src -r --filter='Time<'${tstop} 2>/dev/null | tail -1 2>&1` ) 166 if [ "${coordinates[0]}" == "" ] || [ "${coordinates[1]}" == "" ] 167 then 168 printprocesslog "WARN couldn't get coordinates ("${coordinates[@]}") from "$drivefile 169 continue 170 fi 171 if [ "${coordinates[0]}" == "0" ] || [ "${coordinates[1]}" == "0" ] 172 then 173 printprocesslog "WARN coordinates "${coordinates[@]} 174 continue 175 fi 176 printprocesslog "DEBUG coordinates "${coordinates[@]} 177 query="SELECT fSourceKEY FROM scheduling.source WHERE " 178 query=$query" fRightAscension BETWEEN "${coordinates[0]}"-0.01 AND "${coordinates[0]}"+0.01 " 179 query=$query" AND fDeclination BETWEEN "${coordinates[1]}"-0.01 AND "${coordinates[1]}"+0.01 " 180 sourcekey=`sendquery` 181 if [ "$sourcekey" == "" ] 182 then 183 printprocesslog "WARN sourcekey empty - coordinates"${coordinates[@]} 184 fi 165 # tstopi=`$factpath/fitsdump -h $localfile 2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'` 166 # tstopf=`$factpath/fitsdump -h $localfile 2>/dev/null | grep TSTOPF | grep -E -o '[.][0-9]+'` 167 # tstop=${tstopi}${tstopf} 168 # coordinates=( `${factpath}/fitsdump ${drivefile} -c Ra_src Dec_src -r --filter='Time<'${tstop} 2>/dev/null | tail -1 2>&1` ) 169 # if [ "${coordinates[0]}" == "" ] || [ "${coordinates[1]}" == "" ] 170 # then 171 # printprocesslog "WARN couldn't get coordinates ("${coordinates[@]}") from "$drivefile 172 # #echo "WARN couldn't get coordinates ("${coordinates[@]}") from "$drivefile 173 # continue 174 # fi 175 # if [ "${coordinates[0]}" == "0" ] || [ "${coordinates[1]}" == "0" ] 176 # then 177 # printprocesslog "WARN coordinates "${coordinates[@]} 178 # #echo "WARN coordinates "${coordinates[@]} 179 # continue 180 # fi 181 # printprocesslog "DEBUG coordinates "${coordinates[@]} 182 # query="SELECT fSourceKEY FROM scheduling.source WHERE " 183 # query=$query" fRightAscension BETWEEN "${coordinates[0]}"-0.01 AND "${coordinates[0]}"+0.01 " 184 # query=$query" AND fDeclination BETWEEN "${coordinates[1]}"-0.01 AND "${coordinates[1]}"+0.01 " 185 # sourcekey=`sendquery` 186 # if [ "$sourcekey" == "" ] 187 # then 188 # printprocesslog "WARN sourcekey empty - coordinates"${coordinates[@]} 189 # fi 190 191 printprocesslog "INFO counting callisto logs and data files +1." 192 # get number of callisto logs 185 193 callistocount=`ps aux | grep RunCallisto | grep -E -o '20[12][0-9][01][0-9][0-3][0-9]_[0-9][0-9][0-9]' | sort | uniq | wc -l` 194 # count data runs 195 numdataruns=`echo " $numdataruns + 1 " | bc -l` 196 #echo "numdata +1" 186 197 187 198 echo "cal: "$callistocount" numdat: "$numdataruns" numcallog: "${#callistofiles[@]} 199 printprocesslog "INFO running callistos: "$callistocount" #data-runs: "$numdataruns" #callisto-logs: "${#callistofiles[@]} 188 200 # do not overload system in case of a lot of files to be processed 189 201 # callistocount is set in setup.fact.lp.data … … 194 206 continue 195 207 fi 196 callistolog=`dirname $seqfile | sed -e "s/sequences/ ${sourcekey}\/callisto/"`"/"$night"_"$runnum"-calibration.log"208 callistolog=`dirname $seqfile | sed -e "s/sequences/callisto/"`"/"$night"_"$runnum"-calibration.log" 197 209 if ! [ -e $callistolog ] 198 210 then … … 202 214 rsync_aux_file $tempfilenewdaq $tempfile 203 215 rsync_aux_file $humfilenewdaq $humfile 204 printprocesslog "INFO starting RunCallisto.sh for "$sourcekey" "$seqfile 205 echo "INFO starting RunCallisto.sh for "$sourcekey" "$seqfile 206 `dirname $0`/RunCallisto.sh $sourcekey $seqfile & 216 #printprocesslog "INFO starting RunCallisto.sh for "$sourcekey" "$seqfile 217 #echo "INFO starting RunCallisto.sh for "$sourcekey" "$seqfile 218 #`dirname $0`/RunCallisto.sh $sourcekey $seqfile & 219 printprocesslog "INFO starting RunCallisto.sh for "$seqfile 220 echo "INFO starting RunCallisto.sh for "$seqfile 221 `dirname $0`/RunCallisto.sh $seqfile & 207 222 fi 208 223 continue … … 262 277 files=( `find $rawpathnewdaq -type f | sort` ) 263 278 fileslocal=( `find $rawpath -type f | sort` ) 264 callistofiles=( `find $anapath -type f -name $date*-calibration.log | sort` ) 265 279 callistofiles=( `find $anapath/callisto -type f -name $date*-calibration.log | sort` ) 280 echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns 281 printprocesslog "INFO status after for-loop #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns 282 283 # wait and get new file lists 266 284 update= 267 285 if [ ${#fileslocal[@]} -eq ${#files[@]} ] 268 286 then 287 printprocesslog "INFO wait 60 seconds." 269 288 sleep 60 270 289 echo "sleep 60..." 290 printprocesslog "INFO get new file lists for "$datepath 271 291 files=( `find $rawpathnewdaq -type f | sort` ) 272 292 fileslocal=( `find $rawpath -type f | sort` ) 273 callistofiles=( `find $anapath -type f -name $date*-calibration.log | sort` )293 callistofiles=( `find $anapath/callisto -type f -name $date*-calibration.log | sort` ) 274 294 fi 295 echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns 296 printprocesslog "INFO status after wait end of while-loop #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #data-runs:"$numdataruns 275 297 done 276 298
Note:
See TracChangeset
for help on using the changeset viewer.