Changeset 17095 for trunk/DataCheck/Processing/FillAuxData.sh
- Timestamp:
- 09/06/13 15:58:35 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/Processing/FillAuxData.sh
r17001 r17095 20 20 # trigger rate has as first value -1, but with using the median it should be fine 21 21 22 # option 23 doupdate="yes" # update all entries (needed when new fields have been added) 24 doupdate="no" # fill only entries which are not yet existing (default) 22 # option whether to fill all row or only those where information is missing 23 # $doupdate might be given as environment variable 24 if [ "$doupdate" = "" ] 25 then 26 doupdate="yes" # update all entries (needed when new fields have been added) 27 doupdate="no" # fill only entries which are not yet existing (default) 28 fi 25 29 26 30 source `dirname $0`/../Sourcefile.sh 27 31 printprocesslog "INFO starting $0 with option doupdate="$doupdate 28 32 29 logfile=$runlogpath"/FillAux LP-"$datetime".log"33 logfile=$runlogpath"/FillAuxData-"$datetime".log" 30 34 date >> $logfile 31 35 … … 71 75 printprocesslog "WARN couldn't get statistics from file $1 for run $date $file" 72 76 rm $tmpfile 73 finish 77 continue 78 #finish 74 79 fi 75 80 #echo "good: "$good … … 91 96 fi 92 97 93 94 # get current hour 95 hour=`date +%k` 96 if [ $hour -le 7 ] || [ $hour -ge 19 ] 98 # get dates 99 if [ "$certaindate" != "" ] 97 100 then 98 dates=( `date +%Y/%m/%d --date="-12hour"` )101 getdates $certaindate 99 102 else 100 # get last 3, 6 or 9 nights 101 dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` \ 102 `date +%Y/%m/%d --date="-84hour"` `date +%Y/%m/%d --date="-108hour"` `date +%Y/%m/%d --date="-132hour"` \ 103 # `date +%Y/%m/%d --date="-156hour"` `date +%Y/%m/%d --date="-180hour"` `date +%Y/%m/%d --date="-204hour"` \ 104 ) 103 # get all night 104 #getdates "all" 105 # get last 6 nights if time between 7 and 19h 106 getdates 6 7 19 105 107 fi 106 #dates=( `find $ziprawdata -mindepth 3 -type d | sort | sed "s/\${ziprawdata_for_sed}//g" | sed -e 's/^\///'` ) #all available dates in /loc_data/zipraw107 108 #dates=( "2013/06/13")109 108 110 109 printprocesslog "INFO processing the following night(s): "${dates[@]} … … 160 159 printprocesslog "WARN for $sourceposfile fverify returned "$sourceposnumerrors" error(s)." 161 160 fi 161 sourceposfiletstarti=`$factpath/fitsdump -h $sourceposfile 2>/dev/null | grep 'TSTARTI' | grep -E -o '[0-9]{5}'` 162 sourceposfiletstartf=`$factpath/fitsdump -h $sourceposfile 2>/dev/null | grep 'TSTARTF' | grep -E -o '0[.][0-9]+'` 163 if [ $sourceposfiletstarti -gt 30000 ] 164 then 165 sourceposfiletstart=`echo " $sourceposfiletstarti + $sourceposfiletstartf - 40587 " | bc -l` 166 else 167 sourceposfiletstart=`echo " $sourceposfiletstarti + $sourceposfiletstartf " | bc -l` 168 fi 169 #echo "tstart: "$sourceposfiletstart 162 170 fi 163 171 … … 257 265 258 266 # get information from source_pos file 267 #echo $sourceposfile 259 268 if [ -e $sourceposfile ] && [ $sourceposnumerrors -eq 0 ] 260 269 then 261 270 #sourcename=`${factpath}/fitsdump ${sourceposfile} -c Time -c Name --filter='[1]<'${tstop} 2>/dev/null | tail -1 2>&1 | grep -o -E "['][a-zA-Z0-9\ ]+[']" | sed -e "s/'//g"` 262 271 #sourcename=`/home/fact/FACT++.dbg/fitsdump ${sourceposfile} -c Time -c Name --filter='[1]<'${tstop} 2>/dev/null | tail -1 2>&1 | grep -o -E "['][a-zA-Z0-9\+\-\ ]+[']" | sed -e "s/'//g"` 263 sourcename=`/home/fact/FACT++.dbg/fitsdump ${sourceposfile} -c Time -c Name --filter='[1]<'${tstop} 2>/dev/null | tail -1 2>&1 | grep -o -E "['][a-zA-Z0-9\ \.\+\-]+[']" | sed -e "s/'//g"` 272 sourcename=`$factpath/fitsdump ${sourceposfile} -c Time -c Name --filter='[1]<'${tstop}' && [1]>'${sourceposfiletstart} 2>/dev/null | tail -1 2>&1 | grep -o -E "['][a-zA-Z0-9\ \.\+\-]+[']" | sed -e "s/'//g"` 273 #echo "$factpath/fitsdump ${sourceposfile} -c Time -c Name --filter='[1]<'${tstop} --filter='[1]>'${sourceposfiletstart} 2>/dev/null | tail -1 2>&1 | grep -o -E \"['][a-zA-Z0-9\ \.\+\-]+[']\" | sed -e \"s/'//g\"" 264 274 #echo $sourcename 265 275 if [ "$sourcename" == "" ] … … 268 278 else 269 279 query="SELECT fSourceKey FROM Source WHERE fSourceName='"$sourcename"'" 280 #echo $query 270 281 sourcekey=`sendquery` 271 282 if [ "$sourcename" == "" ] … … 283 294 then 284 295 query=$query" fSourceKey="$sourcekey", " 296 else 297 query=$query" fSourceKey=NULL, " 285 298 fi 286 299
Note:
See TracChangeset
for help on using the changeset viewer.