#!/bin/bash

rm -f *.pdf

while read line
do
    fband=$line
done < "./first_band"

while read line
do
    lband=$line
done < "./last_band"

#echo 'first band:'$fband
#echo 'last band:'$lband

chmod u+x ./plot_NER_band*
echo 'Generating pdf images...'
band=$fband
while [ $band -le $lband ]
do
#    echo 'band:'$band
    if [ $band -lt 10 ]
    then
	band_str='00'$band
    elif [ $band -lt 100 ]
    then
	band_str='0'$band
    elif [ $band -lt 1000 ]
    then
	band_str=$band
    fi
    ./plot_NER_band$band_str
    
    band=$[$band+1]
done

echo 'Production of NER_animation.gif'
gm convert -delay 20 NER_band*.pdf NER_animation.gif

exit 0
