#! /bin/bash
CMD=../smo

# extract data from table
cat atd_CNF.txt | awk -v k=2 '$1>500 {printf("%s\t%s\t0.03\n",$1,$k)}' > CNF.xy
cat CNF.xy | $CMD -f 2 -r "760 1400" -x "800 1320" -b > _CNF.xy

cat atd_CNF.txt | awk -v k=3 '$1>500 {printf("%s\t%s\t0.03\n",$1,$k)}' > CNFK.xy
cat CNFK.xy | $CMD -f 2 -r "760 1400" -x "800 1320" -b > _CNFK.xy

cat atd_CNF.txt | awk -v k=4 '$1>500 {printf("%s\t%s\t0.03\n",$1,$k)}' > CNFKM1.xy
cat CNFKM1.xy | $CMD -f 2 -r "760 1400" -x "800 1220" -b > _CNFKM1.xy

cat atd_CNF.txt | awk -v k=5 '$1>500 {printf("%s\t%s\t0.03\n",$1,$k)}' > CNFKM2.xy
cat CNFKM2.xy | $CMD -f 2 -r "760 1400" -x "800 1320" -b > _CNFKM2.xy

# this one is rather strange the high temperature part is noisy
cat atd_CNF.txt | awk -v k=6 '$1>500 {printf("%s\t%s\t0.03\n",$1,$k)}' > CNFKM5.xy
cat CNFKM5.xy | $CMD -f 2 -r "760 1400" -x "820 1365" -b > _CNFKM5.xy

# check bkg corr. atd
COLY="3 4" gx _CNF*.xy &
