Changeset 12969 for trunk


Ignore:
Timestamp:
02/29/12 12:30:32 (13 years ago)
Author:
Daniela Dorner
Message:
introduced logfile to get trace of fitsfile errors
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/FillAuxData.sh

    r12935 r12969  
    2020# trigger rate has as first value -1, but with using the median it should be fine
    2121
    22 errlog=/home/fact/SW.automatic.processing/DataCheck/log/error.log
     22# option
     23doupdate="yes" # update all entries (needed when new fields have been added)
     24doupdate="no" # fill only entries which are not yet existing (default)
     25
     26source `dirname $0`/Sourcefile.sh
     27printprocesslog "INFO starting $0 with option doupdate="$doupdate
     28
     29logfile=$runlogpath"/FillAuxLP-"$datetime".log"
     30date >> $logfile
    2331
    2432function getfitsstatistics()
     
    3442   max=
    3543   tmpfile=`dirname $0`/`basename $1`.tmp
    36    echo "ftcopy $1'[col Time]' - | ftstat - | grep 'mean' | grep -E -o [0-9]+[.] | sed -e 's/[.]//g'" >> $errlog
    37    timefromfile=`ftcopy $1'[col Time]' - 2>>$errlog | ftstat - 2>>$errlog | grep 'mean' | grep -E -o [0-9]+[.] | sed -e 's/[.]//g'`
     44   echo "ftcopy $1'[col Time]' - | ftstat - | grep 'mean' | grep -E -o [0-9]+[.] | sed -e 's/[.]//g'" >> $logfile
     45   timefromfile=`ftcopy $1'[col Time]' - 2>>$logfile | ftstat - 2>>$logfile | grep 'mean' | grep -E -o [0-9]+[.] | sed -e 's/[.]//g'`
    3846   if [ $timefromfile -gt 30000 ]
    3947   then
    40       echo "ftcopy $1'[Time - 40587> '${3}' && Time - 40587< '${4}' ][col '${2}';Time]' - | ftcopy -'[col '${2}']' - | ftstat -" >> $errlog
     48      echo "ftcopy $1'[Time - 40587> '${3}' && Time - 40587< '${4}' ][col '${2}';Time]' - | ftcopy -'[col '${2}']' - | ftstat -" >> $logfile
    4149      #ftcopy $1'[Time - 40587> '${3}' && Time - 40587< '${4}' ][col '${2}';Time]' - | ftcopy -'[col '${2}']' - | ftstat -
    42       ftcopy $1'[Time - 40587> '${3}' && Time - 40587< '${4}' ][col '${2}';Time]' - 2>>$errlog | ftcopy -'[col '${2}']' - 2>>$errlog | ftstat - 2>>$errlog > $tmpfile
    43    else
    44       echo "ftcopy $1'[Time> '${3}' && Time< '${4}' ][col '${2}';Time]' - | ftcopy -'[col '${2}']' - | ftstat -" >> $errlog
     50      ftcopy $1'[Time - 40587> '${3}' && Time - 40587< '${4}' ][col '${2}';Time]' - 2>>$logfile | ftcopy -'[col '${2}']' - 2>>$logfile | ftstat - 2>>$logfile > $tmpfile
     51   else
     52      echo "ftcopy $1'[Time> '${3}' && Time< '${4}' ][col '${2}';Time]' - | ftcopy -'[col '${2}']' - | ftstat -" >> $logfile
    4553      #ftcopy $1'[Time> '${3}' && Time< '${4}' ][col '${2}';Time]' - | ftcopy -'[col '${2}']' - | ftstat -
    46       ftcopy $1'[Time> '${3}' && Time< '${4}' ][col '${2}';Time]' - 2>>$errlog | ftcopy -'[col '${2}']' - 2>>$errlog | ftstat - 2>>$errlog > $tmpfile
     54      ftcopy $1'[Time> '${3}' && Time< '${4}' ][col '${2}';Time]' - 2>>$logfile | ftcopy -'[col '${2}']' - 2>>$logfile | ftstat - 2>>$logfile > $tmpfile
    4755   fi
    4856   good=`cat $tmpfile | grep 'good' | grep -E -o '[-]?[0-9]+[.]?[0-9]*'`
     
    6573}
    6674
    67 # option
    68 doupdate="yes" # update all entries (needed when new fields have been added)
    69 doupdate="no" # fill only entries which are not yet existing (default)
    70 
    71 source `dirname $0`/Sourcefile.sh
    72 printprocesslog "INFO starting $0 with option doupdate="$doupdate
    73 
    7475# setup to use ftools
    7576source $HEADAS/headas-init.sh
     
    9394
    9495# get last 2 nights
    95 dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` )
     96dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` )
    9697#dates=( `find $ziprawdata -mindepth 3 -type d | sort | sed "s/\${ziprawdata_for_sed}//g" | sed -e 's/^\///'` ) #all available dates in /loc_data/zipraw
    9798#echo ${dates[@]}
    98 dates=( "2012/02/21" "2012/02/20" "2012/02/19" "2012/02/18" )
     99#dates=( "2012/02/21" "2012/02/20" "2012/02/19" "2012/02/18" )
    99100printprocesslog "INFO processing the following night(s): "${dates[@]}
     101echo  `date`": processing the following night(s): "${dates[@]}
    100102
    101103# do filling of aux data
     
    178180   do
    179181      printprocesslog "INFO processing file number "$runnumber"_"`printf %03d $filenum`
     182      echo  `date`": processing file number "$runnumber"_"`printf %03d $filenum`
    180183      # get information from rawfile
    181184      rawfile=$ziprawdata/$date/$runnumber"_"`printf %03d $filenum`.fits.gz
Note: See TracChangeset for help on using the changeset viewer.