Changeset 16987 for trunk/DataCheck/QuickLook
- Timestamp:
- 07/30/13 13:14:35 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/QuickLook/Step2a.sh
r16677 r16987 6 6 if [ "$1" = "" ] 7 7 then 8 hour=`date +%k` 8 9 # get date (before 18h there is no new data to be processed) 9 datepaths=( `date --date="-18HOUR" +%Y/%m/%d` ) 10 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 10 if [ $hour -le 7 ] || [ $hour -ge 19 ] 11 then 12 datepaths=( `date --date="-19HOUR" +%Y/%m/%d` ) 13 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 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 11 20 else 12 21 datepaths=( $1 ) 13 22 fi 14 23 15 echo ${datepaths[@]}16 17 24 for datepath in ${datepaths[@]} 18 25 do 19 26 printprocesslog "INFO processing "$datepath 20 echo "INFO processing "$datepath27 #echo "INFO processing "$datepath 21 28 night=`echo $datepath | sed -e 's/\///g'` 22 29 … … 69 76 night=`basename ${files[$i-1]} | cut -d_ -f1` 70 77 runid=`basename ${files[$i-1]} | cut -d_ -f2 | cut -d. -f1` 71 #echo "night: "$night 72 #echo "runid: "$runid 78 drivefile=$auxdata"/"$datepath"/"`basename ${files[$i-1]} | cut -d_ -f1`".DRIVE_CONTROL_SOURCE_POSITION.fits" 73 79 rawfilepath=$rawdata"/"$datepath"/" 74 80 rawfilename=`basename ${files[$i-1]} | sed -e 's/_I.root/.fits/'` 75 #echo $rawfilepath 76 #echo $rawfilename 77 rawfile=`find $rawfilepath -name $rawfilename*` 78 printprocesslog "INFO processing "$rawfile 79 drivefile=$auxdata"/"$datepath"/"`basename ${files[$i-1]} | cut -d_ -f1`".DRIVE_CONTROL_SOURCE_POSITION.fits" 80 printprocesslog "INFO getting coordinates from "$drivefile 81 tstopi=`$factpath/fitsdump -h $rawfile 2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'` 82 tstopf=`$factpath/fitsdump -h $rawfile 2>/dev/null | grep TSTOPF | grep -E -o '[.][0-9]+'` 83 tstop=${tstopi}${tstopf} 81 rawfile=`find $rawfilepath -name $rawfilename* 2>/dev/null` 82 if ! [ "$rawfile" == "" ] 83 then 84 printprocesslog "INFO processing "$rawfile 85 tstopi=`$factpath/fitsdump -h $rawfile 2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'` 86 tstopf=`$factpath/fitsdump -h $rawfile 2>/dev/null | grep TSTOPF | grep -E -o '[.][0-9]+'` 87 tstop=${tstopi}${tstopf} 88 fi 84 89 #echo "tstop: "$tstop 85 if ls $drivefile >/dev/null 2>&1 86 then 90 if [ ls $drivefile >/dev/null 2>&1 ] && ! [ "$tstop" == "" ] 91 then 92 printprocesslog "INFO getting coordinates from "$drivefile 87 93 coordinates=( `${factpath}/fitsdump ${drivefile} -c Ra_src Dec_src -r --filter='Time<'${tstop} 2>/dev/null | tail -1 2>&1` ) 88 94 if [ "${coordinates[0]}" == "" ] || [ "${coordinates[1]}" == "" ] … … 99 105 fi 100 106 else 101 printprocesslog "DEBUG coordinates "${coordinates[@]} 102 #echo "DEBUG coordinates "${coordinates[@]} 107 printprocesslog "INFO getting coordinates from DB." 103 108 query="SELECT fSourceKEY FROM RunInfo WHERE fNight="$night" AND fRunID="$runid 104 109 sourcekey=`sendquery` … … 113 118 if [ "${coordinates[0]}" == "" ] || [ "${coordinates[1]}" == "" ] 114 119 then 115 printprocesslog "WARN couldn't get coordinates ("${coordinates[@]}") from "$drivefile120 printprocesslog "WARN couldn't get coordinates ("${coordinates[@]}") from DB." 116 121 #echo "WARN couldn't get coordinates ("${coordinates[@]}") from "$drivefile 117 122 continue … … 133 138 else 134 139 `dirname $0`/RunGanymed.sh $dsfile ${coordinates[0]} ${coordinates[1]} 140 #echo "ganymed for "$dsfile" "${coordinates[0]}" "${coordinates[1]} 135 141 fi 136 142 numganymeds=`echo " $numganymeds + 1 " | bc -l`
Note:
See TracChangeset
for help on using the changeset viewer.