# -*- sh -*- make -s parents gnuplot=/Users/timm/Desktop/gnuplot-4.0.0/src/gnuplot Here=`pwd` All=`./File` cd $HOME/work/mine/trunk/doc/06/markland/ Files="data.eo2 data.xf3 data.rand data.go4 data.gs1" data() { cat dataNoBlanks3.csv \ | gawk -F, 'BEGIN {FS=OFS=","} {print $1,$5,$6,$7,$10,$11,$13,$14,$15,$16,$17,$18,$19,$20,$22,$23,$24}' > data.all cat dataNoBlanks3.csv \ | gawk -F, 'BEGIN {FS=OFS=","} {print $1,$5,$6,$7,$10,$11,$13,$14,$15,$16,$17,$18,$19,$20,$22,$23,$24}' \ | gawk -F, ' NR==1 { print $0 >"data.eo2"; print $0 >"data.xf3"; print $0 >"Data.go4"; print $0 >"data.gs1"; next } $1 == "X1" || $1 == "X4" || $1=="X5" || $1 == "X7" || $1 == "X10" || $1=="X12" {print $0 >> "data.eo2"; next} $1 == "X2" || $1 == "X3" || $1 == "X8" {print $0 >> "data.xf3"; next} $1 == "X6" || $1 == "X11" {print $0 >> "data.go4"; next} $1 == "X9" {print $0 >> "data.gs1"; next} {print "?? " $0 } ' cat dataNoBlanks3.csv \ | gawk -F, 'function one() {return int(rand()*5) + 1 } BEGIN {FS=OFS=","; srand()} NR==1 {print $1,$5,$6,$7,$10,$11,$13,$14,$15,$16,$17,$18,$19,$20,$22,$23,$24} END {N=500; for(i=1;i<=500;i++) print "all",one(), one(),one(),one(),one(),one(),one(),one(),one(),one(),one(),one(),one(),one(),one(),one(),one()} ' > data.rand } cdfs() { for f in data.all $Files do gawk -F, 'NF > 15 {print}' $f | cut -d, -f 2- > $f.tmp mv $f.tmp $f blabln $f silap -w cdfs.$f $f done } logs() { silap -n 500 -V a $All | gawk '{print "a,"$0}' | tee $All.log silap -n 500 -V r data.rand | gawk '{print "r,"$0}' | tee data.rand.log silap -n 500 -V 1 data.gs1 | gawk '{print "1,"$0}' | tee data.gs1.log silap -n 500 -V 2 data.eo2 | gawk '{print "2,"$0}' | tee data.eo2.log silap -n 500 -V 3 data.xf3 | gawk '{print "3,"$0}' | tee data.xf3.log silap -n 500 -V 4 data.go4 | gawk '{print "4,"$0}' | tee data.go4.log silap -e $All | gawk '{print "o,"$0}' | tee data.zorig.log #silap -V c -r $Here/cdf.km1FlightSw | gawk 'NR < 90{print "c,"$0}' | tee data.km1FlightSW.log } dists() { rm *.dist for i in $All $All data.gs1 data.eo2 data.xf3 data.go4 data.zorig do gawk -F, 'function trim(s) { sub(/^ */,"",s); sub(/ *$/,"",s); return s } {$2= trim($2)} BEGIN {com="sort -t, -n +0 "; OFS=","} $NF ~ /\*/ && Pass==1 { Order[++Order[0]]=$2 ; Name[Order[0]]=trim($3); Redro[$2]=Order[0]} $NF ~ /\*/ && Pass==2 { Thing[$2]=$4 } END {system("rm names"); for(i=1;i<=Order[0];i++) { print "\"" Name[i] "\" " i ",\\">> "names" print (Order[i] in Thing ? Thing[Order[i]] : 0 )}} #,(Order[i] in Thing ? Thing[Order[i]] : 0 ) } ' Pass=1 $All.log Pass=2 $i.log \ | sed 's/\%//' > $i.log.dist done paste *.dist | cat -n > dist.plot $gnuplot < $i.er done } ceplot() { $gnuplot <