Changeset 17078 for trunk


Ignore:
Timestamp:
09/05/13 14:14:26 (11 years ago)
Author:
Daniela Dorner
Message:
implemented usage of new function getdates
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/QuickLook/Step2a.sh

    r16987 r17078  
    44printprocesslog "INFO starting $0"
    55
    6 if [ "$1" = "" ]
    7 then
    8    hour=`date +%k`
    9    # get date (before 18h there is no new data to be processed)
    10    if [ $hour -le 7 ] || [ $hour -ge 19 ]
    11    then
    12       datepaths=( `date --date="-19HOUR" +%Y/%m/%d` )
     6# get dates
     7if [ "$certaindate" != "" ]
     8then
     9   getdates $certaindate
     10else
     11   if [ "$1" = "" ]
     12   then
     13      # get all night
     14      #getdates "all"
     15      # get last 6 nights
     16      getdates 6
    1317   else
    14       datepaths=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` \
    15               `date +%Y/%m/%d --date="-84hour"` `date +%Y/%m/%d --date="-108hour"` `date +%Y/%m/%d --date="-132hour"` \
    16 #              `date +%Y/%m/%d --date="-156hour"` `date +%Y/%m/%d --date="-180hour"` `date +%Y/%m/%d --date="-204hour"` \
    17               )
     18      getdates $1
    1819   fi
    19    #datepaths=( `find -L $datapath/star -mindepth 3 -type d | sort -r | sed "s/\${datapath_for_sed}\/star//g" | sed -e 's/^\///'` ) #all available dates in star-directory
    20 else
    21    datepaths=( $1 )
    2220fi
    2321
    24 for datepath in ${datepaths[@]}
     22
     23
     24for date in ${dates[@]}
    2525do
    26    printprocesslog "INFO processing "$datepath
    27    #echo "INFO processing "$datepath
    28    night=`echo $datepath | sed -e 's/\///g'`
     26   printprocesslog "INFO processing "$date
     27   #echo "INFO processing "$date
     28   night=`echo $date | sed -e 's/\///g'`
    2929   
    3030   numganymeds=0
    3131   
    3232   # getting all image files for this night
    33    printprocesslog "INFO get file list for night "$datepath
    34    files=( `find $anapath/star/$datepath -type f -name '*_I.root' 2>/dev/null | sort` )
     33   printprocesslog "INFO get file list for night "$date
     34   files=( `find $anapath/star/$date -type f -name '*_I.root' 2>/dev/null | sort` )
    3535   if [ ${#files[@]} -eq 0 ]
    3636   then
    37       printprocesslog "INFO no image files available for night "$datepath
     37      printprocesslog "INFO no image files available for night "$date
    3838      continue
    3939   fi
    4040   # write data set file
    41    #dspath=$anapath/$source/datasets`printf %03d $min`min/$datepath
    42    #dspath=$anapath/$source/datasets_run/$datepath
    43    dspath=$anapath/datasets_run/$datepath
     41   #dspath=$anapath/$source/datasets`printf %03d $min`min/$date
     42   #dspath=$anapath/$source/datasets_run/$date
     43   dspath=$anapath/datasets_run/$date
    4444   makedir $dspath
    4545
     
    7676         night=`basename ${files[$i-1]} | cut -d_ -f1`
    7777         runid=`basename ${files[$i-1]} | cut -d_ -f2 | cut -d. -f1`
    78          drivefile=$auxdata"/"$datepath"/"`basename ${files[$i-1]} | cut -d_ -f1`".DRIVE_CONTROL_SOURCE_POSITION.fits"
    79          rawfilepath=$rawdata"/"$datepath"/"
     78         drivefile=$auxdata"/"$date"/"`basename ${files[$i-1]} | cut -d_ -f1`".DRIVE_CONTROL_SOURCE_POSITION.fits"
     79         rawfilepath=$rawdata"/"$date"/"
    8080         rawfilename=`basename ${files[$i-1]} | sed -e 's/_I.root/.fits/'`
    8181         rawfile=`find $rawfilepath -name $rawfilename* 2>/dev/null`
Note: See TracChangeset for help on using the changeset viewer.