function OK = arcgrid_test
%arcgrid_test
%
% http://en.wikipedia.org/wiki/Esri_grid
%
%See also: arcgrid

D0.x=[ 25    75   125   175];
D0.y=fliplr([ 25    75   125   175   225   275]);
D0.z=flipud([ 13     5     1   NaN
      88    75    27     9
      32    42    50     6
       3     8    35    10
     NaN    20   100    36
     NaN   NaN     5     2]);

D   = arcgrid('open','arcgrid.asc');
D   = arcgrid('read','arcgrid.asc');
D.z = D.Data';

OK(1) = isequalwithequalnans(D.x,D0.x);
OK(2) = isequalwithequalnans(D.y,D0.y);
OK(3) = isequalwithequalnans(D.z,D0.z);

pcolorcorcen(center2corner1(D.x),center2corner1(D.y),D.z);
axis equal;
axis tight
text(D.x(1),D.y(1),'o (1,1)')
title(['z(',num2str(size(D.Data,1)),'x',num2str(size(D.Data,2)),')   ',mktex(mfilename)])
print2screensizeoverwrite(mfilename)
close

OK = all(OK);