- Timestamp:
- 02/08/12 12:33:48 (13 years ago)
- Location:
- trunk/DataCheck/Archive
- Files:
-
- 10 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/Archive/auxIngest.sh
r12750 r12871 3 3 sourceFolder=$1 4 4 destFolder=$2 5 suffix=$3 5 6 6 if [ "$#" != " 2" ]7 if [ "$#" != "3" ] 7 8 then 8 echo "Please specify source and dest folders . Aborting"9 echo "Please specify source and dest folders and suffix. Aborting" 9 10 exit 10 11 fi … … 85 86 if [ -a $targetFile ] 86 87 then 87 echo "File $targetFile already exist. Skipping it" >> report .txt88 echo "File $targetFile already exist. Skipping it" >> report_$suffix.txt 88 89 continue 89 90 fi … … 98 99 # then 99 100 100 repairAuxFile.sh $targetFile ENDerrors .txt MJDerror.txt report.txt processErrors.txt101 repairAuxFile.sh $targetFile ENDerrors_$suffix.txt MJDerror_$suffix.txt report_$suffix.txt processErrors_$suffix.txt 101 102 102 103 if [ -a $targetFile ] 103 104 then 104 fixAuxKeyWords.sh $targetFile reportTwo .txt processErrors.txt105 fixAuxKeyWords.sh $targetFile reportTwo_$suffix.txt processErrors_$suffix.txt 105 106 result=`fverify $targetFile 2>/dev/null | grep '0 error(s)'` 106 107 if [ "$result" == "" ] 107 108 then 108 echo "$targetFile" >> stillHasProblems .txt109 echo "$targetFile" >> stillHasProblems_$suffix.txt 109 110 rm $targetFile 110 111 fi -
trunk/DataCheck/Archive/fixRawKeyWords.sh
r12750 r12871 8 8 9 9 file=$1 10 tempFile=" tempRaw.txt"10 tempFile="/scratch/tempRaw.txt" 11 11 reportFile=$2 12 12 processErrors=$3 … … 18 18 19 19 #get current keywords value 20 result=`/home /isdc/lyard/FACT++/fitsdump $file -h -o $tempFile 2>/dev/null`20 result=`/home_nfs/isdc/lyard/FACT++/fitsdump $file -h -o $tempFile 2>/dev/null` 21 21 22 22 if [ -a $tempFile ] … … 42 42 43 43 #retrieve the start and stop time from the data itself 44 result=`/home /isdc/lyard/FACT++/fitsdump $file -c UnixTimeUTC --minmax --nozero -o $tempFile 2>/dev/null`44 result=`/home_nfs/isdc/lyard/FACT++/fitsdump $file -c UnixTimeUTC --minmax --nozero -o $tempFile 2>/dev/null` 45 45 46 46 if [ -a $tempFile ] … … 56 56 else 57 57 #let's give it a shot with PCTime 58 result=`/home /isdc/lyard/FACT++/fitsdump $file -c PCTime --minmax --nozero -o $tempFile 2>/dev/null`58 result=`/home_nfs/isdc/lyard/FACT++/fitsdump $file -c PCTime --minmax --nozero -o $tempFile 2>/dev/null` 59 59 if [ -a $tempFile ] 60 60 then … … 124 124 fi 125 125 #adapt the start and stop to the mjdref (it is raw unix time in the data) 126 tstarti2=`echo "$tstarti2 - $mjdref" | bc -l` 127 tstopi2=`echo "$tstopi2 - $mjdref" | bc -l` 128 if [ "$tstarti2" != "$tstarti" ] || [ "$tstartf2" != "$tstartf" ] 126 if [ "$tstarti2" != "0" ] && [ "$tstarti2" != "" ] 127 then 128 tstarti2=`echo "$tstarti2 - $mjdref" | bc -l` 129 tstopi2=`echo "$tstopi2 - $mjdref" | bc -l` 130 else 131 tstarti2=0 132 tstopi2=0 133 fi 134 135 #give latitude for 10-6 precision in tstart and tstop 136 tfcompare=`echo $tstartf | grep -E -o '0\.[0-9]{6}'` 137 tfcompare2=`echo $tstartf2 | grep -E -o '0\.[0-9]{6}'` 138 139 if [ "$tstarti2" != "$tstarti" ] || [ "$tfcompare" != "$tfcompare2" ] 129 140 then 130 141 echo "TSTARTI "$tstarti2" / Time when first event received (integral part)" >> $tempFile 131 142 echo "TSTARTF "$tstartf2" / Time when first event received (fractional part)" >> $tempFile 132 143 date_obs2=`echo "$tstarti2 + $tstartf2 + $mjdref" | bc -l` 133 date_obs2=`/home /isdc/lyard/FACT++/MjDtoISO $date_obs2`144 date_obs2=`/home_nfs/isdc/lyard/FACT++/MjDtoISO $date_obs2` 134 145 echo "DATE-OBS "$date_obs2" / Time when first event was received" >> $tempFile 135 146 modified="true" … … 137 148 fi 138 149 139 if [ "$tstopi2" != "$tstopi" ] || [ "$tstopf2" != "$tstopf" ] 150 tfcompare=`echo $tstopf | grep -E -o '0\.[0-9]{6}'` 151 tfcompare2=`echo $tstopf2 | grep -E -o '0\.[0-9]{6}'` 152 153 if [ "$tstopi2" != "$tstopi" ] || [ "$tfcompare" != "$tfcompare2" ] 140 154 then 155 156 echo "first: $tfcompare ||| second: $tfcompare2||" 141 157 echo "TSTOPI "$tstopi2" / Time when last event received (integral part)" >> $tempFile 142 158 echo "TSTOPF "$tstopf2" / Time when last event received (fractional part)" >> $tempFile 143 159 date_end2=`echo "$tstopi2 + $tstopf2 + $mjdref" | bc -l` 144 date_end2=`/home /isdc/lyard/FACT++/MjDtoISO $date_end2`160 date_end2=`/home_nfs/isdc/lyard/FACT++/MjDtoISO $date_end2` 145 161 echo "DATE-END "$date_end2" / Time when last event was received" >> $tempFile 146 162 modified="true" … … 150 166 if [ "$modified" == "true" ] 151 167 then 152 echo "INGEST v0.1 Version of Etienne ingest script" >> $tempFile 168 echo "INGEST v0.2 Version of Etienne ingest script" >> $tempFile 169 echo $file" header has been modified" >> $reportFile 170 else 171 echo $file" header has NOT been modified" >> $reportFile 153 172 fi 154 173 -
trunk/DataCheck/Archive/rawIngest.sh
r12750 r12871 4 4 destFolder=$2 5 5 6 if [ "$#" != " 2" ]6 if [ "$#" != "3" ] 7 7 then 8 echo "Please specify source and dest folders. Aborting"8 echo "Please specify source and dest folders. and an identifier for the log files Aborting" 9 9 exit 10 10 fi … … 19 19 then 20 20 echo "Dest folder is empty. Aborting" 21 exit 22 fi 23 24 if [ $3 == "" ] 25 then 26 echo "Identifier for log files empty. Aborting" 21 27 exit 22 28 fi … … 61 67 destFolder=${destFolder%/} 62 68 echo "Will start ingesting files from "$sourceFolder" to "$destFolder 69 echo "Will start ingesting files from "$sourceFolder" to "$destFolder >> Rawreport$3.txt 63 70 64 71 #list all the files in sourceFolder, and copy then with the same structure to destfolder … … 87 94 if [ -a $targetFile".gz" ] 88 95 then 89 echo "File $targetFile already exist. Skipping it" >> Rawreport .txt96 echo "File $targetFile already exist. Skipping it" >> Rawreport$3.txt 90 97 continue 91 98 fi … … 100 107 # then 101 108 102 repairRawFile.sh $interFile RawENDerrors .txt RawMJDerror.txt Rawreport.txt RawprocessErrors.txt109 repairRawFile.sh $interFile RawENDerrors$3.txt RawMJDerror$3.txt Rawreport$3.txt RawprocessErrors$3.txt 103 110 104 111 if [ -a $interFile ] 105 112 then 106 fixRawKeyWords.sh $interFile RawreportTwo .txt RawprocessErrors.txt113 fixRawKeyWords.sh $interFile RawreportTwo$3.txt RawprocessErrors$3.txt 107 114 result=`fverify $interFile 2>/dev/null | grep '0 error(s)'` 108 115 if [ "$result" == "" ] 109 116 then 110 echo "$interFile" >> RawstillHasProblems .txt117 echo "$interFile" >> RawstillHasProblems$3.txt 111 118 rm $interFile 112 119 else 113 gzip $interFile120 gzip -1 $interFile 114 121 cp $interFile".gz" $targetFile".gz" 115 122 rm $interFile".gz" -
trunk/DataCheck/Archive/repairRawFile.sh
r12750 r12871 30 30 if [ "$result" != "" ] 31 31 then 32 mjdref=`/home /isdc/lyard/FACT++/fitsdump $entry -h 2>/dev/null | grep 'MJDREF' | grep -E -o '[0-9]+'`32 mjdref=`/home_nfs/isdc/lyard/FACT++/fitsdump $entry -h 2>/dev/null | grep 'MJDREF' | grep -E -o '[0-9]+'` 33 33 if [ "$mjdref" != 40587 ] 34 34 then … … 53 53 filesize=`stat -c%s $entry` 54 54 # echo $headerSize" "$filesize 55 numrows=`/home /isdc/lyard/FACT++/fitsdump $entry -h 2>/dev/null | grep 'NAXIS2' | awk '{ print $4 }' | grep -E -o '[0-9]+'`55 numrows=`/home_nfs/isdc/lyard/FACT++/fitsdump $entry -h 2>/dev/null | grep 'NAXIS2' | awk '{ print $4 }' | grep -E -o '[0-9]+'` 56 56 if [ "$numrows" == "" ] 57 57 then … … 60 60 exit 61 61 fi 62 rowWidth=`/home /isdc/lyard/FACT++/fitsdump $entry -h 2>/dev/null | grep 'NAXIS1' | awk '{ print $4 }' | grep -E -o '[0-9]+'`62 rowWidth=`/home_nfs/isdc/lyard/FACT++/fitsdump $entry -h 2>/dev/null | grep 'NAXIS1' | awk '{ print $4 }' | grep -E -o '[0-9]+'` 63 63 64 64 totSize=`echo " $headerSize + $numrows * $rowWidth " | bc -l` … … 67 67 # echo $headerSize" "$numrows" "$rowWidth" "$totSize" "$fitsSize 68 68 # echo " FileSize: "$filesize" should be "$fitsSize 69 truncate -s $totSize $entry 2>/dev/null 70 truncate -s $fitsSize $entry 2>/dev/null 71 echo "Resized $entry" >> $reportFile 69 if [ $filesize > $fitsSize ] 70 then 71 truncate -s $totSize $entry 2>/dev/null 72 truncate -s $fitsSize $entry 2>/dev/null 73 echo "Resized $entry" >> $reportFile 74 fi 75 72 76 fi 73 77 fi
Note:
See TracChangeset
for help on using the changeset viewer.