global img intmat intmat1 choice flag

init

out50=avsread('/nfs/ir6/w/fyz/2dd/huber/hc/out10q.fld');
pps=avsread2('/nfs/ir6/w/fyz/2dd/huber/hc/prompt1e6.50.fld');
img2=avsread('huber/phtm.fld')';
c1=zeros(500,2,50,7);c2=zeros(500,2,50,7);
c3=zeros(500,2,50,7);c4=zeros(500,2,50,7);
l1=zeros(50,7); l2=zeros(50,7); l3=zeros(50,7); l4=zeros(50,7); 
myout1=zeros(128,128,50); myout2=zeros(128,128,50); myout3=zeros(128,128,50);
myout4=zeros(128,128,50); myout5=zeros(128,128,50); myout6=zeros(128,128,50);

for ii=1:50,
	ii
	!rm -f pp.fld
	avswrite('pp.fld',pps(:,:,ii));
	fuserf=1;
	choice=1; img=out50(:,:,ii)'*1e5; go; fuserf=1; fuserf=0;
	!rm -f out.fld
	!reconstruct 11.5 25 
	choice=2; img=avsread('out.fld')'*1e5; myout2(:,:,ii)=img'; go;
        !rm -f out.fld
        !reconstruct 11.5 25
        choice=3; img=avsread('out.fld')'*1e5; myout3(:,:,ii)=img'; go;
        !rm -f out.fld
        !reconstruct 11.5 25
        choice=4; img=avsread('out.fld')'*1e5; myout4(:,:,ii)=img'; go;
        !rm -f out.fld
        !reconstruct 11.8 25
        choice=5; img=avsread('out.fld')'*1e5; myout5(:,:,ii)=img'; go;
        !rm -f out.fld
        !reconstruct 11.8 25
        choice=6; img=avsread('out.fld')'*1e5; myout6(:,:,ii)=img'; go;
	if mod(ii,5)==0 | ii==1,
		save /afs/engin.umich.edu/u/f/y/fyz/c1 c1 c2 c3 c4 l1 l2 l3 l4
	end
end
