#!/bin/bash # # gnuplot movie creation script (this one specifically for diffusion) # # Eric Thern # # July 14, 2003 - initial # # creates a set of png files from gnuplot, # converts them to .jpg files and encodes them with mplayer. # # REQUIREMENTS: # mplayer, possibly libmp3lame if it bitches about encoding # convert (jpg, gd and png libraries as well, should come with standard dists though) # gnuplot # run this program from the bash shell # # # developed on redhat linux 9, should have no problems working anywhere though. # # # run GNUPlot # echo "running gnuplot" python graph-diffusion-timevsdist.py > graphdiffusionoutput # for 0 to 1500 time #split -l 18 graphdiffusionoutput # for 0 to 2000 time split -a 8 -l 51 graphdiffusionoutput sed -i "s/0.0 0/\?0.0 \?0/" graphdiffusionoutput for i in `ls -1 | egrep '(x[a-z]......)'`; do mv $i `cat $i | grep "#"| awk '{print $2}'`; done amount=$( egrep '(#.[0-9])' graphdiffusionoutput | wc -l) index=$( egrep '(#.[0-9])' graphdiffusionoutput | awk -F"# " '{ORS=","; for (n=2; n <= NF; n++) print $n}' ) buffer=1000000 for ((count = 1; count <= amount; count = count + 1)); do buffer=`expr $buffer + 1`; title=$( echo $index | awk -F',' -v COUNT=$count '{print $COUNT}' ) echo "creating graphs $buffer-diffusion.png for time of $title million years" echo "set terminal png small color; set output '$buffer-DIFFUSION.png'; set multiplot; set xlabel \"Diffusion Distance \(um\)\"; set ylabel \"Temperature \(Celcius\)\"; set origin 0.0,0.0; set size 1.0,1.0; set yrange [0:1250]; set xrange [10e-100:10e+20]; set log x; set xzeroaxis; set data style linespoints; plot \"