#! /bin/sh

WIDTH=300
HEIGHT=420
WIDTHOFF1=0
WIDTHOFF2=305
HEIGHTOFF1=2
HEIGHTOFF2=450

p2=6
p1=6
size=64
infile=xy.grid

unisam verbose=1 nout=$size xin=0,12,51,63 yin=0,0,0,0 \
        nsint=1 amp=-0.3 isint=1 nwidth=4> x.grid

farith verbose=1 in=x.grid n=$size op=cartprod in2=x.grid \
	> $infile

reconfile=recon.dat
mrafile=mra.dat
dfile=d.dat

mrafxzwt verbose=1 order=4 p2=$p2 p1=$p1 \
	n1=$size n2=$size mralevel2=3 mralevel1=3 \
	< $infile >$mrafile reconfile=$reconfile \
	dfile=$dfile recon=0 
  
xmovie n1=$size n2=$size title="Original Model" \
	style=normal < $infile \
	-geometry ${WIDTH}x${HEIGHT}+${WIDTHOFF1}+${HEIGHTOFF1} & 

xmovie n1=$size n2=$size title="MRA of the Model" \
	< $mrafile \
	-geometry ${WIDTH}x${HEIGHT}+${WIDTHOFF1}+${HEIGHTOFF2} & 

xmovie n1=$size n2=$size title="Reconstructed Model" style=normal \
	< $reconfile \
	-geometry ${WIDTH}x${HEIGHT}+${WIDTHOFF2}+${HEIGHTOFF1} &

xmovie n1=$size n2=$size title="Difference" style=normal \
	< $dfile \
	-geometry ${WIDTH}x${HEIGHT}+${WIDTHOFF2}+${HEIGHTOFF2} &

exit 0



  
