Diagnostics/ParticleFlux/RakeProbe/Sessions/131112_VIcharacteristicsIntro/script.sh

#/bin/bash

method=bezier
file=10316ch1xch4
wfile="wget -q -O - http://golem.fjfi.cvut.cz:5001/Diagnostics/ParticleFlux/RakeProbe/sessions/131112_VIcharacteristicsIntro/$file"
colors=("" "#EEEEEE" "#888888" "#EE0000" "#880000" "#FFFF00" "#FFFF88" "#FF00FF" "#FFCCFF" "#33CCFF" "#99FFFF" "#3399FF" "#99CCFF" "#666600" "#999966" "#660000" "#990000" "#008800" "#00FF00" "#000088" "#0000FF" )
R=4.7
wgraph()
{
echo -ne "set yrange [-0.1:0.8];set xlabel 'Bias voltage U_{bias} [V]';set ylabel 'Probe current I_{pr} [A]';set terminal $terminal;plot `for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
echo -ne "'<$wfile' every ::$i*500::($i+1)*500 u 1:("'$'"2/$R) smooth $method lc rgb '${colors[$i]}' title '$i'," \ 
done`0\n"
}
terminal=
wgraph|gnuplot --persist
echo -ne "echo\"" >grafbezier.gp;wgraph >> grafbezier.gp;echo -ne "\"|gnuplot --persist" >>grafbezier.gp;
terminal="postscript port enhanced color; set size 1.8,1"
wgraph|gnuplot > grafbezier.eps;convert grafbezier.eps grafbezier.png
terminal="png"
wgraph|gnuplot > grafbezier_.png


#smooth method test
smtest()
{
echo "plot\
'10316ch1xch4' every ::500::1000 lc rgb 'red',\
'10316ch1xch4' every ::500::1000 smooth $method lc rgb 'black',\
'10316ch1xch4' every ::1000::1500 lc rgb 'green',\
'10316ch1xch4' every ::1000::1500 smooth $method lc rgb 'blue'\
"|gnuplot --persist
}

#data generation from oscilloscope
datageneration()
{
for i in `seq 1 4`; do mv 10322ch$i 10322ch$i.isf; wine cnvrtwfm.exe -l -8- 10322ch$i.isf;echo $i;done
for i in `seq 1 4`; do mv 10316ch$i 10316ch$i.isf; wine cnvrtwfm.exe -l -8- 10316ch$i.isf;echo $i;done
awk -F ',' '{print $2}' 10316ch1.csv > 10316ch1pure.csv
awk -F ',' '{print $2}' 10316ch4.csv > 10316ch4pure.csv
paste 10316ch4pure.csv 10316ch1pure.csv > 10316ch1xch4
}