Changeset 17094 for trunk/DataCheck
- Timestamp:
- 09/06/13 15:56:36 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/Processing/FillMoonInfo.sh
r15220 r17094 1 1 #!/bin/bash 2 2 3 # option 4 doupdate="yes" # update all entries (needed when new fields have been added) 5 doupdate="no" # fill only entries which are not yet existing (default) 3 # script to fill moon information to DB 4 # doesn't need raw files 5 # probably doesn't run at ISDC (FACT++/moon missing) 6 7 # option whether to fill all row or only those where information is missing 8 # $doupdate might be given as environment variable 9 if [ "$doupdate" = "" ] 10 then 11 doupdate="yes" # update all entries (needed when new fields have been added) 12 doupdate="no" # fill only entries which are not yet existing (default) 13 fi 6 14 7 15 source `dirname $0`/../Sourcefile.sh 8 16 printprocesslog "INFO starting $0 with option doupdate="$doupdate 9 17 10 #logfile=$runlogpath"/FillMoonInfo-"$datetime".log" 11 #date >> $logfile 12 13 # get last 3, 6 or 9 nights 14 dates=( `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 19 #dates=( `date +%Y/%m/%d --date="-228hour"` `date +%Y/%m/%d --date="-252hour"` `date +%Y/%m/%d --date="-276hour"` ) 20 21 #dates=( `find $auxdata -mindepth 3 -type d | sort -r | sed "s/\${auxdata_for_sed}//g" | sed -e 's/^\///'` ) 18 # get dates 19 if [ "$certaindate" != "" ] 20 then 21 getdates $certaindate 22 else 23 # get all night 24 #getdates "all" 25 # get last 6 nights 26 getdates 6 27 fi 22 28 23 29 printprocesslog "INFO processing the following night(s): "${dates[@]} 24 #echo `date`": processing the following night(s): "${dates[@]} #>> $logfile 2>&125 30 26 31 # do filling of aux data … … 37 42 # get file numbers from DB 38 43 # but only for not-corrupted files 39 #query="SELECT fRunID from RunInfo WHERE fNight="$runnumber" AND NOT ISNULL(fRightAscension) AND NOT ISNULL(fDeclination) "40 44 query="SELECT fRunID from RunInfo WHERE fNight="$runnumber" AND NOT ISNULL(fRunStart) " 41 #query=$query" AND fRunTypeKEY=6 "42 45 if [ "$doupdate" = "no" ] 43 46 then … … 56 59 do 57 60 printprocesslog "INFO processing file number "$runnumber"_"`printf %03d $filenum` 58 #echo `date`": processing file number "$runnumber"_"`printf %03d $filenum` # >> $logfile 2>&159 61 60 62 # get input info from DB … … 65 67 query=$query" WHERE fNight="$runnumber" AND fRunID="$filenum 66 68 info=( `sendquery` ) 67 #echo ${info[@]}68 #echo "/home/fact/FACT++.db/moon "${info[2]} ${info[3]}" --ra=${info[0]} --dec=${info[1]} 2>/dev/null"69 69 if [ "${info[0]}" == "999" ] && [ "${info[1]}" == "999" ] 70 70 then … … 75 75 # return values of the programm 76 76 # timestamp sunzd moon-visible moondisk moonzd angletomoon angletosun 77 #echo ${lightinfo[@]}78 77 79 78 # build query to update runinfo in DB … … 87 86 # add where condition 88 87 query=$query" WHERE fNight="$runnumber" AND fRunID="$filenum 88 89 89 #echo $query 90 90 # send query to DB
Note:
See TracChangeset
for help on using the changeset viewer.