Changeset 14848 for trunk/DataCheck/Processing
- Timestamp:
- 02/04/13 06:10:54 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/Processing/FillMoonInfo.sh
r14195 r14848 3 3 # option 4 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)5 doupdate="no" # fill only entries which are not yet existing (default) 6 6 7 7 source `dirname $0`/../Sourcefile.sh … … 13 13 # get last 3, 6 or 9 nights 14 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"` \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 17 ) 18 18 dates=( `find $auxdata -mindepth 3 -type d | sort -r | sed "s/\${auxdata_for_sed}//g" | sed -e 's/^\///'` ) … … 33 33 # get file numbers from DB 34 34 # but only for not-corrupted files 35 query="SELECT fRunID from RunInfo WHERE fNight="$runnumber" AND NOT ISNULL(fRightAscension) AND NOT ISNULL(fDeclination) " 35 #query="SELECT fRunID from RunInfo WHERE fNight="$runnumber" AND NOT ISNULL(fRightAscension) AND NOT ISNULL(fDeclination) " 36 query="SELECT fRunID from RunInfo WHERE fNight="$runnumber" AND NOT ISNULL(fRunStart) " 36 37 #query=$query" AND fRunTypeKEY=6 " 37 38 if [ "$doupdate" = "no" ] … … 54 55 55 56 # get input info from DB 56 query="SELECT fRightAscension, fDeclination, fRunStart from RunInfo " 57 query="SELECT if (isnull(fRightAscension), 999, fRightAscension), " 58 query=$query" if (isnull(fDeclination), 999, fDeclination), " 59 query=$query" fRunStart from RunInfo " 57 60 query=$query" WHERE fNight="$runnumber" AND fRunID="$filenum 58 61 info=( `sendquery` ) 59 62 echo ${info[@]} 60 63 #echo "/home/fact/FACT++.db/moon "${info[2]} ${info[3]}" --ra=${info[0]} --dec=${info[1]} 2>/dev/null" 61 lightinfo=( `/home/fact/FACT++.db/moon "${info[2]} ${info[3]}" --ra=${info[0]} --dec=${info[1]} 2>/dev/null` ) 64 if [ "${info[0]}" == "999" ] && [ "${info[1]}" == "999" ] 65 then 66 lightinfo=( `/home/fact/FACT++.upgrade/moon "${info[2]} ${info[3]}" 2>/dev/null` ) 67 else 68 lightinfo=( `/home/fact/FACT++.upgrade/moon "${info[2]} ${info[3]}" --ra=${info[0]} --dec=${info[1]} 2>/dev/null` ) 69 fi 70 # return values of the programm 71 # timestamp sunzd moon-visible moondisk moonzd angletomoon angletosun 62 72 echo ${lightinfo[@]} 63 73 64 74 # build query to update runinfo in DB 65 query="UPDATE RunInfo SET fSunZenithDistance="${lightinfo[2]}", fMoonDisk="${lightinfo[4]}", fMoonZenithDistance="${lightinfo[5]}", fAngleToMoon="${lightinfo[6]} 75 query="UPDATE RunInfo SET fSunZenithDistance="${lightinfo[2]}", fMoonDisk="${lightinfo[4]} 76 query=$query", fMoonZenithDistance="${lightinfo[5]} 77 echo $query 78 if [ "${info[0]}" != "999" ] && [ "${info[1]}" != "999" ] 79 then 80 query=$query", fAngleToMoon="${lightinfo[6]} 81 query=$query", fAngleToSun="${lightinfo[7]} 82 fi 66 83 # add where condition 67 84 query=$query" WHERE fNight="$runnumber" AND fRunID="$filenum 68 85 echo $query 69 70 86 # send query to DB 71 87 sendquery >/dev/null
Note:
See TracChangeset
for help on using the changeset viewer.