Changeset 19496 for trunk/DataCheck/Tools
- Timestamp:
- 04/16/19 21:25:08 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/Tools/fill_r750.sh
r19495 r19496 4 4 sqlpw=/home/$USER/.mysql.pw.op 5 5 dbname=factdata 6 # fill only corrected R750 7 #short="yes" # comment line to fill also reference values 6 7 query="SELECT Max(fPeriod) FROM RunInfo WHERE NOT ISNULL(fR750Cor)" 8 pmaxcor=`mysql --defaults-file=$sqlpw -s -e "$query" ` 9 echo "fR750Cor is already filled up to P"$pmaxcor 10 11 query="SELECT Max(fPeriod) FROM RunInfo WHERE NOT ISNULL(fR750Ref)" 12 pmaxref=`mysql --defaults-file=$sqlpw -s -e "$query" ` 13 echo "fR750Ref is already filled up to P"$pmaxref 14 15 8 16 9 17 # setup for zd- and th-correction: … … 17 25 query="UPDATE RunInfo SET " 18 26 query=$query" fR750Cor=round(fNumThreshold750/("$min")/("$cor"),2) " 19 query=$query" WHERE fRunTypeKey=1 AND NOT (("$min")/("$cor"))=0" 27 query=$query" WHERE fRunTypeKey=1 AND NOT (("$min")/("$cor"))=0 " 28 query=$query" AND fPeriod>="$pmaxcor 20 29 echo $query 21 30 mysql --defaults-file=$sqlpw -s -e "$query" 22 23 # todo: replace this by trigger in DB (finalize correction formula for this)24 25 if [ "$short" == "yes" ]26 then27 echo ""28 echo "Exit (short=yes)"29 exit30 fi31 32 31 33 32 # reference values for corrected R750 … … 126 125 240.0 #92 (current period) 127 126 ) 127 if [ ${#rates[@]} -lt $pmaxref ] 128 then 129 ${#rates[@]}" "$pmaxref 130 exit 131 fi 132 133 if [ "$doupdate" == "yes" ] 134 then 135 numstart=0 136 else 137 numstart=$pmaxref 138 fi 128 139 129 140 # fill reference values 130 141 echo "" 131 142 echo "Filling the reference values for the corrected R750 for "${#rates[@]}" periods to the DB..." 132 for (( i= 0; i < ${#rates[@]} ; i++))143 for (( i=$numstart; i < ${#rates[@]} ; i++)) 133 144 do 134 145 echo "Filling P"$i … … 143 154 mysql --defaults-file=$sqlpw -s -e "$query" 144 155 done 156 157 if [ $numstart -gt 0 ] 158 then 159 exit 160 fi 145 161 146 162 echo "Filling split periods..."
Note:
See TracChangeset
for help on using the changeset viewer.