TemplPath=/golem/GW/Experiments/EdgePlasmaPhysics/ParticleFlux/RakeProbe/1114ShotToShotMeasurement/Sessions/Template
shotnobase=182
shotseq="`seq 44 59`"
shotseq_pos="`seq 53 59`"
shotseq_neg="`seq 44 52`"
ADDRESS="http://golem.fjfi.cvut.cz/wiki`echo $PWD|sed 's/\/home\/svoboda\/GW//g'|sed 's/\/home\/svoboda\/mnt\/buon\/GW//g'`"
GWcommit="automated VA char report develeop"
R=16.7
timewindow=10
initframe=16000
finalframe=26000
shotstart=17500
shotend=20000

#Test data
#timewindow=10
#initframe=18000
#finalframe=20000
#shotstart=18100
#shotend=19000
#shotseq="`seq 44 59`"
#shotseq_neg="`seq 44 52`"
#shotseq_pos="`seq 53 59`"

referenceshot=18244



analysis:
	mkdir -p Analysis
	cp -r $(TemplPath)/Analysis/* Analysis/
	cd Analysis; bash ScriptV1.page $(shotnobase) $(shotseq) $(shotseq_pos) $(shotseq_neg) $(R) [-45:45] [-1.5*1000/$R:22.5*1000/$R] $(referenceshot) $(initframe) $(timewindow) $(finalframe) $(shotstart) $(shotend)



all:
	echo -ne "---\nformat: markdown\n...\n\n" >index.page
	echo -ne "# Experiment report on ..\n" >>index.page
	echo -ne "## Raw data presentation \n" >>index.page; 
	make rawfigures	
	make commit

rawfigures:
	mkdir -p Figures
	echo -ne "### \$$V_{bias}\$$ scan} \n " >>index.page;
	make -i figure dir=StandardPlasmaV_bias_scan xrange=[16:25] yrange=[-10:1]
	echo -ne "### \$$I_{p}\$$ scan - discharge reproducibility\n " >>index.page;
	make -i figure dir=StandardPlasmaI_p_scan xrange=[16:27] yrange=[0:*]
	echo -ne "### \$$V_{bias}\$$  scan - ion side\n " >>index.page;
	make -i figure dir=StandardPlasmaV_bias_scan_I_is xrange=[16:25] yrange=[0:0.5]
	echo -ne "### \$$V_{bias}\$$ scan - elektron side\n " >>index.page;
	make -i figure dir=StandardPlasmaV_bias_scan_I_es xrange=[16:25] yrange=[-10:0]


figure:
	#Generate figure
	cp -r $(TemplPath)/Figures/$(dir) Figures/
	cd Figures/$(dir); sh script.page $(shotnobase) $(shotseq) $(xrange) $(yrange)
	#Generate wiki code for GW
	echo -ne "<a href=Figures/$(dir)/graph.html><img src=Figures/$(dir)/graph.jpg width=50%></a>\n\n(\n[jpg](Figures/$(dir)/graph.jpg), \n[svg](Figures/$(dir)/graph.svg),\n[canvas](Figures/$(dir)/graph.html),\n[script](Figures/$(dir)/script.page))\n\n">>index.page



      
commit:      
	ssh -X buon "cd /GW;git add .;git commit -m '$(GWcommit)'"
	
