function [fcompact,faces]=aste_zetatracer2compact(aste,nfx,nfy);
%------------
%function [fcompact,faces]=aste_zetatracer2compact(aste,nfx,nfy);
% In:
% nfx: [270 0 270 180 450]
% nfy: [450 0 270 270 270]
% aste: aste domain size [nx*2+1 nfy(1)+nfy(3)+nfx(4)+nfx(5)+1,nz]
%
% Out:
% compact format [270 1350 nz]
% ATN 19-Feb-2013 ------------
% ATN 25-Apr-2013 ------------

nx=nfx(3);
[tempx tempy nz]=size(aste);
if((nfy(1)+nfy(3)+nfx(4)+1)~=tempy);
  error('inconsistent nfx or nfy versus size aste');
  return
else;

%initialize:
  f{1}=nan(nfx(1),nfy(1),nz);f{2}=[];f{3}=nan(nx,nx,nz);
  f{4}=nan(nfx(4),nfy(4),nz);f{5}=nan(nfx(5),nfy(5),nz);

%filling
  f{1}=aste(nx+1:2*nx,1:nfy(1),:);
  f{3}=sym_g_mod(aste(nx+2:2*nx+1,nfy(1)+1       :nfy(1)+nfx(3)       ,:),7,0);
  f{4}=sym_g_mod(aste(nx+2:2*nx+1,nfy(1)+nfx(3)+1:nfy(1)+nfx(3)+nfx(4),:),7,0);
  f{5}=sym_g_mod(aste(1   :nx    ,2              :nfx(5)+1            ,:),5,0);

  fcompact=[f{1},f{3},reshape(f{4},nfy(4),nfx(4),nz),reshape(f{5},nfy(5),nfx(5),nz)];
  faces=f;
  
end;

return

