
LA = 49;
LO = 15;

LA_OD = 49;
LA_DO = 50;                
LO_OD = 14;
LO_DO = 15;
figure;
set(gca,'xlim',[LO_OD LO_DO+1]);
set(gca,'ylim',[LA_OD LA_DO+1]);
hold on
for LA = LA_OD:LA_DO
    for LO = LO_OD:LO_DO


fn = ['N' sprintf('%02d',LA) 'E' sprintf('%03d',LO) '.hgt']
s=fopen(fn);%a(1).name)
dt=fread(s,inf,'uint8');
pp = sqrt(numel(dt)/2);
dh = zeros(pp,pp);
extr = 0;
for j = 1 : pp
    for i = 1 : pp
        %(i-1)*pp+j
        pi = (i-1)*pp+j; %pomocný index
       dh(i,j) = dt(2*pi)+mod(dt(2*pi-1),128)*256;%nejvyssi bit je znamenko, kod neni doplnkovy
       %(dt(2*pi-1)*256/128)
       if dh(i,j) == 32768 %chybìjící data
           %dh(i,j)
           %disp([num2str(dh(i,j)) ' '  num2str(extr)]);
           dh(i,j) = 0;%nahradim nulou
           %lepší by bylo použít interpolaci
           extr = extr + 1;
       end
    end
end
clear dt
fclose(s);
%figure;
%h=surfl(0:1/(pp-1):1,0:1/(pp-1):1,dh,'linestyle','none');
RAD = LO_DO-LO_OD+1;
SLP = LA_DO-LA_OD+1;
%hs = subplot(SLP,RAD,(LA_DO-LA)*2+(LO-LO_OD+1));
h=contour(gca,LO + (0:1/(pp-1):1),(LA+1)- (0:1/(pp-1):1),dh,[0:100:900],'ShowText','on');
%hold on
%set(h,'');
%colormap hsv
hs=gca;
set(hs,'clim',[-500 900])
    end
end
colorbar
