MAIN= heatmap.plt
MAIN0= heatmap0.plt
SRC= bucketize.py gen.py log_floor.py test_log_floor_nose.py heatplot.bash
AUX= inp.txt makefile README
ALL= $(MAIN) $(MAIN0) $(AUX) $(SRC)
BARE= bucketize.py log_floor.py heatplot.bash $(MAIN0) $(AUX)


# top: buck2
# top: universe

top: demo_buck

demo_all: demo_buck_many demo_old buck2 buck3

universe: logtests demo_all

logtests: log_floor.py test_log_floor_nose.py
	nosetests test_log_floor_nose.py

demo_old: heatmap.plt
	gnuplot  $(MAIN) 
	@echo "result is on out_heatmap.eps"
	open out_heatmap.eps

demo_buck: heatplot.bash bucketize.py log_floor.py
	bash heatplot.bash -b 1.414 inp.txt

demo_buck_many: heatplot.bash bucketize.py log_floor.py
	bash heatplot.bash -b 1.01 inp.txt
	bash heatplot.bash -b 1.02 inp.txt
	bash heatplot.bash -b 1.05 inp.txt
	bash heatplot.bash -b 1.1892 inp.txt
	bash heatplot.bash -b 1.23114 inp.txt
	bash heatplot.bash -b 1.4142 inp.txt
	bash heatplot.bash inp.txt

buck: points.csv bucketize.py
	python bucketize.py points.csv

buck2: inp.txt  bucketize.py
	python bucketize.py -b 1.05 inp.txt > bi.txt
	gnuplot -e "filename='bi.txt'; outfile='out_heatmap_bi.pdf'"  $(MAIN0) 
	open out_heatmap_bi.pdf

unif.csv: gen.py
	python gen.py > unif.csv

buck3: unif.csv  bucketize.py
	python bucketize.py -b 1.4 unif.csv > unif_b.csv
	gnuplot -e "filename='unif_b.csv'; \
	    outfile='out_heatmap_unif_b.pdf'"  $(MAIN0) 
	open out_heatmap_unif_b.pdf


clean:
	\rm -f *heatmap*.eps
	\rm -f *heatmap*.pdf
	\rm -f bi.txt
	\rm -f unif*.csv
	\rm -f *.tmp

spotless: clean
	\rm -f all.tar heatplot.tar
	\rm -rf TST
	\rm -f *.pyc

all.tar: $(ALL)
	tar cvf all.tar $(ALL)

heatplot.tar: $(BARE)
	tar cvf heatplot.tar $(BARE)
