Ignore:
Timestamp:
12/01/11 17:39:04 (13 years ago)
Author:
Daniela Dorner
Message:
added getting mjd and information from some slow control files
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/FillAuxData.sh

    r12662 r12679  
    3434# get last 2 nights
    3535dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` )
    36 dates=( "2011/11/15" )
     36dates=( "2011/11/23" )
    3737
    3838# do rsync for rawfiles of these dates
     
    6868      echo $thresholdfile" not found"
    6969   fi
    70    biascontrolfile=$auxdir/$runnumber.BIAS_CONTROL_VOLTAGE.fits
    71    if ! [ -e $biascontrolfile ]
     70   biasvoltagefile=$auxdir/$runnumber.BIAS_CONTROL_VOLTAGE.fits
     71   if ! [ -e $biasvoltagefile ]
    7272   then
    73       echo $biascontrolfile" not found"
     73      echo $biasvoltagefile" not found"
     74   fi
     75   biascurrentsfile=$auxdir/$runnumber.BIAS_CONTROL_CURRENTS.fits
     76   if ! [ -e $biascurrentsfile ]
     77   then
     78      echo $biascurrentsfile" not found"
    7479   fi
    7580
     
    7984   for filenum in ${filenumbers[@]}
    8085   do
     86      filenum=42
    8187      echo $filenum
    82       query2="SELECT fRunStart from RunInfo WHERE fRunNumber="$runnumber" AND fFileNumber="$filenum
    83       starttime=`/usr/bin/mysql -u operator --host=fact01.fact.local --password=$password FactData -s -e "$query2" 2>> $logfile`
    84       query3="SELECT fRunStop from RunInfo WHERE fRunNumber="$runnumber" AND fFileNumber="$filenum
    85       stoptime=`/usr/bin/mysql -u operator --host=fact01.fact.local --password=$password FactData -s -e "$query3" 2>> $logfile`
    86       echo "start: "$starttime
    87       echo "stop: "$stoptime
     88      #query2="SELECT fRunStart from RunInfo WHERE fRunNumber="$runnumber" AND fFileNumber="$filenum
     89      #starttime=`/usr/bin/mysql -u operator --host=fact01.fact.local --password=$password FactData -s -e "$query2" 2>> $logfile`
     90      #query3="SELECT fRunStop from RunInfo WHERE fRunNumber="$runnumber" AND fFileNumber="$filenum
     91      #stoptime=`/usr/bin/mysql -u operator --host=fact01.fact.local --password=$password FactData -s -e "$query3" 2>> $logfile`
     92      #echo "start: "$starttime
     93      #echo "stop: "$stoptime
     94      rawfile=/loc_data/raw/$date/$runnumber"_"`printf %03d $filenum`.fits
     95      #/home/fact/FACT++/fitsdump -h -t Events $rawfile
     96      mjdref=`/home/fact/FACT++/fitsdump -h -t Events $rawfile  2>/dev/null | grep 'MJDREF' | grep -E -o '[0-9]{5}'`
     97      tstarti=`/home/fact/FACT++/fitsdump -h -t Events $rawfile  2>/dev/null | grep 'TSTARTI' | grep -E -o '[0-9]{5}'`
     98      tstartf=`/home/fact/FACT++/fitsdump -h -t Events $rawfile  2>/dev/null | grep 'TSTARTF' | grep -E -o '0[.][0-9]+'`
     99      tstart=`echo " $tstarti + $mjdref + $tstartf " | bc -l`
     100      tstopi=`/home/fact/FACT++/fitsdump -h -t Events $rawfile  2>/dev/null | grep 'TSTOPI' | grep -E -o '[0-9]{5}'`
     101      tstopf=`/home/fact/FACT++/fitsdump -h -t Events $rawfile  2>/dev/null | grep 'TSTOPF' | grep -E -o '0[.][0-9]+'`
     102      tstop=`echo " $tstopi + $mjdref + $tstopf " | bc -l`
     103      echo "tstart in mjd: "$tstart
     104      echo "tstop in mjd: "$tstop
     105     
     106      # get information from tracking
    88107      echo $trackingfile
    89       ftcopy $trackingfile'[Time>55889.1][col Ra]' - | ftstat -
     108      ramin=`ftcopy $trackingfile'[Time> '${tstart}' && Time< '${tstop}'][col Ra;Time]' - | ftcopy -'[col Ra]' - | ftstat - | grep 'min' | grep -E -o '[0-9][.][0-9]+'`
     109      ramax=`ftcopy $trackingfile'[Time> '${tstart}' && Time< '${tstop}'][col Ra;Time]' - | ftcopy -'[col Ra]' - | ftstat - | grep 'max' | grep -E -o '[0-9][.][0-9]+'`
     110      ramean=`ftcopy $trackingfile'[Time> '${tstart}' && Time< '${tstop}'][col Ra;Time]' - | ftcopy -'[col Ra]' - | ftstat - | grep 'mean' | grep -E -o '[0-9][.][0-9]+'`
     111      decmin=`ftcopy $trackingfile'[Time> '${tstart}' && Time< '${tstop}'][col Dec;Time]' - | ftcopy -'[col Dec]' - | ftstat - | grep 'min' | grep -E -o '[0-9][.][0-9]+'`
     112      decmax=`ftcopy $trackingfile'[Time> '${tstart}' && Time< '${tstop}'][col Dec;Time]' - | ftcopy -'[col Dec]' - | ftstat - | grep 'max' | grep -E -o '[0-9][.][0-9]+'`
     113      decmean=`ftcopy $trackingfile'[Time> '${tstart}' && Time< '${tstop}'][col Dec;Time]' - | ftcopy -'[col Dec]' - | ftstat - | grep 'mean' | grep -E -o '[0-9][.][0-9]+'`
     114      echo "ra: "$ramin" - "$ramean" - "$ramax
     115      echo "dec: "$decmin" - "$decmean" - "$decmax
     116
     117      # get information from trigger
     118      echo $triggerratefile
     119      #ftcopy $triggerratefile'[Time> '${tstart}' && Time< '${tstop}' && TriggerRate!=-1][col TriggerRate;Time]' - | ftcopy -'[col TriggerRate]' - | ftstat -
     120      ratemin=`ftcopy $triggerratefile'[Time> '${tstart}' && Time< '${tstop}' && TriggerRate!=-1][col TriggerRate;Time]' - | ftcopy -'[col TriggerRate]' - | ftstat - | grep 'min' | grep -E -o '[0-9]+[.]?[0-9]+'`
     121      ratemax=`ftcopy $triggerratefile'[Time> '${tstart}' && Time< '${tstop}' && TriggerRate!=-1][col TriggerRate;Time]' - | ftcopy -'[col TriggerRate]' - | ftstat - | grep 'max' | grep -E -o '[0-9]+[.]?[0-9]+'`
     122      ratemean=`ftcopy $triggerratefile'[Time> '${tstart}' && Time< '${tstop}' && TriggerRate!=-1][col TriggerRate;Time]' - | ftcopy -'[col TriggerRate]' - | ftstat - | grep 'mean' | grep -E -o '[0-9]+[.]?[0-9]+'`
     123      echo "rate: "$ratemin" - "$ratemean" - "$ratemax
     124
     125      # get information from trigger
     126      echo $thresholdfile
     127      echo "ftcopy $thresholdfile'[Time> '${tstart}' && Time< '${tstop}'][col PatchThresh;Time]' - | ftcopy -'[col PatchThresh]' - | ftstat -"
     128      threshmin=`ftcopy $thresholdfile'[Time> '${tstart}' && Time< '${tstop}'][col PatchThresh;Time]' - | ftcopy -'[col PatchThresh]' - | ftstat - | grep 'min' | grep -E -o '[0-9]+[.]?[0-9]+'`
     129      threshmax=`ftcopy $thresholdfile'[Time> '${tstart}' && Time< '${tstop}'][col PatchThresh;Time]' - | ftcopy -'[col PatchThresh]' - | ftstat - | grep 'max' | grep -E -o '[0-9]+[.]?[0-9]+'`
     130      threshmean=`ftcopy $thresholdfile'[Time> '${tstart}' && Time< '${tstop}'][col PatchThresh;Time]' - | ftcopy -'[col PatchThresh]' - | ftstat - | grep 'mean' | grep -E -o '[0-9]+[.]?[0-9]+'`
     131      echo "rate: "$threshmin" - "$threshmean" - "$threshmax
     132
    90133
    91134      exit
    92 # notes:
    93 # ftcopy /loc_data/aux/2011/11/23/20111123.BIAS_CONTROL_NOMINAL.fits'[Time>55889.1][col Time]' - | ftstat -
    94 # ftcopy /loc_data/aux/2011/11/15/20111115.DRIVE_CONTROL_TRACKING_POSITION.fits'[Time>55880.8 && Time< 55880.9][col Ra;Time]' - | ftcopy -'[col Ra]' - | ftstat -
    95135   done
    96136   
Note: See TracChangeset for help on using the changeset viewer.