analysis:
	echo "nic" &>/dev/null

plots:
	python2 main.py plots
arming:
	echo "nic" &>/dev/null


acquisition:
	rm -f data
	for i in 01 02 03 04 05 06 08 09 10 11 12; do echo $$i; make get CH=$$i;done
	make -iB gp
# 	make -iB html
	make -iB data

data:
	string=`cat ../../../wwwcomment`;pozice=`echo $${string##*position=}`;awk '{print '$$pozice'+(NR-1)*2.5 "\t" $$1}' data > pozicedata
	
		

get:
	wget http://golem.fjfi.cvut.cz/shots/0/DAS/1011Papouch_St.ON/PapouchZa_$(CH) -O RakeProbe$(CH)
	perl Mean.pl $(CH)
	cat Mean$(CH) >> data; echo "" >>data


GPBASE=set xrange [$$pozice-5:$$pozice+32.5];plot 'data' u (\$$0*2.5+$$pozice):(\$$1) title ''
gp:
	string=`cat ../../../wwwcomment`;pozice=`echo $${string##*position=}`; echo $$pozice;\
	echo "set terminal png;$(GPBASE)" |gnuplot > graph1.png;\
	echo "$(GPBASE)" |gnuplot -persist
	convert -resize 150 graph1.png icon.png

# html:
# 	echo '<html><head><title>Diagnostics on Tokamak GOLEM </title><h1>Rake probe on tokamak GOLEM</h1>' > index.html;\
# 	echo '<img src="graph1.png" width="70%" /><br/>' >> index.html;\
# 	echo '<a href="pozicedata">data</a>' >> index.html;\
# 	echo '</body></html>' >> index.html;\
# 	echo '<img src="rakeprobe.png" /><br/>' > Rake\ Probe.html;\
# 	echo '<a href="pozicedata">data</a>' >> Rake\ Probe.html;\
# 	
