Changeset 14155 for trunk/DataCheck
- Timestamp:
- 06/11/12 18:28:21 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/Processing/CheckRawData.sh
r13601 r14155 6 6 # this causes a delay until files are in the database 7 7 # because they have to be rsynced and zipped first (see RsyncRawData.sh, ZipRawData.sh) 8 9 # missing 10 # entry in status table 8 # 9 # starting from 2012/06/05 the keywords CHECKSUM and DATASUM are 10 # available in the fits header of the rawfile 11 # starting from this time the md5sums are not calculated anymore 12 # 13 14 # todo 15 # tempfile for fitsdump -h output 11 16 12 17 # options: 13 18 skipmd5sum="no" # fill md5 sums in any case 14 19 skipmd5sum="iffilled" # fill md5 sum only if they are not yet in db # default 15 #skipmd5sum="yes" # do not fill md5 sums in any case 20 skipmd5sum="yes" # do not fill md5 sums in any case #new default since 2012/06/05 when the checksum is available in heaser 16 21 17 22 doupdate="yes" # update all entries … … 107 112 for file in $fitsgzfiles 108 113 do 114 filecorrupt="no" 109 115 printprocesslog "INFO checking file "$file 110 #echo "INFO checking file "$file 116 #echo "INFO checking file "$file" at "`date` 111 117 112 118 # raw and original file 119 # file: /loc_data/zipraw 120 # rawfile: /loc_data/raw 121 # origfile: /daq/raw 113 122 rawfile=`echo $file | sed -e 's/zipraw/raw/' -e 's/fits[.]gz/fits/'` 114 123 origfile=`echo $rawfile | sed -e 's/loc_data/daq/'` … … 185 194 then 186 195 printprocesslog "WARN "$rawfile" has "$numfitserrors" fitserror(s). " 196 fitsdumperrors=`$factpath/fitsdump -h -t Events $file 2>&1 | grep corrupted` 197 if [ "$fitsdumperrors" != "" ] 198 then 199 filecorrupt="yes" 200 fi 187 201 #numfitserrors=1 188 202 fi … … 190 204 numdrsfiles= 191 205 step= 192 if [ $numfitserrors -eq 0 ] 206 #if [ $numfitserrors -eq 0 ] 207 if [ "$filecorrupt" == "no" ] 193 208 then 194 209 # get run and file number from file … … 207 222 fi 208 223 224 # get checksums from header 225 checksum=`$factpath/fitsdump -h -t Events $file 2>/dev/null | grep CHECKSUM | grep -E -o '[a-zA-Z0-9]{16}'` 226 if [ "$checksum" == "" ] 227 then 228 printprocesslog "WARN checksum for file "$file" is empty." 229 fi 230 datasum=`$factpath/fitsdump -h -t Events $file 2>/dev/null | grep DATASUM | grep -E -o '[0-9]{1,10}'` 231 if [ "$datasum" == "" ] 232 then 233 printprocesslog "WARN datasum for file "$file" is empty." 234 fi 235 209 236 # check if this run has drs file 210 237 # in case file is available, get STEP from header … … 216 243 if [ "$drscalib" == "T" ] 217 244 then 218 step=`$factpath/fitsdump -h -t Events $drsfile 2>/dev/null | grep STEP | grep -E -o "['][012][']" | sed -e "s/'//g"` 245 step=`$factpath/fitsdump -h -t Events $file 2>/dev/null | grep DRSSTEP | grep -E -o "['][012][']" | sed -e "s/'//g"` 246 stepfromdrs=`$factpath/fitsdump -h -t Events $drsfile 2>/dev/null | grep STEP | grep -E -o "['][012][']" | sed -e "s/'//g"` 247 if [ "$stepfromdrs" != "$step" ] 248 then 249 printprocesslog "ERROR for file "$file" step from drsfile ("$stepfromdrs") and from file ("$step") do not agree." 250 if [ "$stepfromdrsfile" != "" ] && [ "$step" == "" ] 251 then 252 step=$stepfromdrsfile 253 printprocesslog "WARN setting drsstep from drsfile ("$stepfromdrs") although value differs from the one in file "$file"." 254 fi 255 fi 219 256 if ! [ $numdrsfiles -eq 1 ] 220 257 then 221 258 printprocesslog "ERROR for file "$file" number of drsfiles ("$numdrsfiles") and information from header ("$drscalib") don't agree." 259 fi 260 if [ "$step" = "" ] 261 then 262 printprocesslog "ERROR file "$file" has drsfiles ("$numdrsfiles"), but step ("$step") is empty." 222 263 fi 223 264 else … … 362 403 fi 363 404 query=$query" RunInfo SET "$querymid" fRunTypeKey="${result2[0]} 364 if [ $numfitserrors -eq 0 ] 405 #if [ $numfitserrors -eq 0 ] 406 if [ "$filecorrupt" == "no" ] 365 407 then 366 408 query=$query", fRunStart='"$runstart"', fRunStop='"$runstop"'" … … 410 452 fi 411 453 fi 454 if [ "$checksum" != "" ] 455 then 456 query=$query", fCheckSum='"$checksum"'" 457 fi 458 if [ "$datasum" != "" ] 459 then 460 query=$query", fDataSum='"$datasum"'" 461 fi 412 462 if [ "$md5sum" != "" ] 413 463 then … … 433 483 query=$query" "$querystop 434 484 # send query to DB 485 #echo $query 435 486 sendquery >/dev/null 436 487 done
Note:
See TracChangeset
for help on using the changeset viewer.