Changeset 15298 for trunk


Ignore:
Timestamp:
04/12/13 11:06:53 (12 years ago)
Author:
Daniela Dorner
Message:
added filling of source key
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/Processing/FillAuxData.sh

    r14837 r15298  
    9090#        `date +%Y/%m/%d --date="-156hour"` `date +%Y/%m/%d --date="-180hour"` `date +%Y/%m/%d --date="-204hour"` \
    9191        )
    92 dates=( "2012/03/25" "2012/03/26" "2012/03/27" "2012/03/28" "2012/03/29" "2012/03/30" "2012/04/10" "2012/04/09" "2012/04/08" "2012/04/06" "2012/04/05" "2012/04/03"  )
    9392#dates=( `find $ziprawdata -mindepth 3 -type d | sort | sed "s/\${ziprawdata_for_sed}//g" | sed -e 's/^\///'` ) #all available dates in /loc_data/zipraw
    9493printprocesslog "INFO processing the following night(s): "${dates[@]}
     
    131130      then
    132131         printprocesslog "WARN for $trackingfile fverify returned "$tracknumerrors" error(s)."
     132      fi
     133   fi
     134   
     135   sourceposfile=$auxdir/$runnumber.DRIVE_CONTROL_SOURCE_POSITION.fits
     136   if ! [ -e $sourceposfile ]
     137   then
     138      printprocesslog "WARN "$sourceposfile" not found."
     139   else
     140      sourceposnumerrors=`fverify $sourceposfile 2>/dev/null | grep -o '[0-9][ ]error(s)'  | grep -E -o '[0-9]'`
     141      if [ $sourceposnumerrors -gt 0 ]
     142      then
     143         printprocesslog "WARN for $sourceposfile fverify returned "$sourceposnumerrors" error(s)."
    133144      fi
    134145   fi
     
    228239      #fi
    229240
     241      # get information from source_pos file
     242      if [ -e $sourceposfile ] && [ $sourceposnumerrors -eq 0 ]
     243      then
     244         #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"`
     245         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"`
     246         #echo "/home/fact/FACT++.dbg/fitsdump ${sourceposfile} -c Time -c Name --filter='[1]<'${tstop}  2>/dev/null | tail -1 2>&1 "
     247         #echo $sourcename
     248         if [ "$sourcename" == "" ]
     249         then
     250            printprocesslog "INFO couldn't get sourcename ("$sourcename") from "$sourceposfile" for "$runnumber"_"$filenum
     251         else
     252            query="SELECT fSourceKey FROM Source WHERE fSourceName='"$sourcename"'"
     253            sourcekey=`sendquery`
     254            if [ "$sourcename" == "" ]
     255            then
     256               printprocesslog "WARN couldn't get sourcekey for source "$sourcename" from DB for "$runnumber"_"$filenum
     257            fi
     258            #echo $sourcekey
     259         fi
     260      fi
     261     
    230262      # build query to update runinfo in DB
    231263      query="UPDATE RunInfo SET "
     264      # fill source key only if available
     265      if ! [ "$sourcekey" = "" ]
     266      then
     267         query=$query" fSourceKey="$sourcekey", "
     268      fi
    232269     
    233270      # get information from tracking
     
    364401      # add where condition
    365402      query=$query" WHERE fNight="$runnumber" AND fRunID="$filenum
     403      #echo $query
    366404
    367405      # send query to DB
Note: See TracChangeset for help on using the changeset viewer.