clear

fid=fopen('ecco_oasim_edp_below.bin','r','b');
edp=fread(fid,'float32'); fclose(fid);
edp=reshape(edp,360,160,13,12);

fid=fopen('ecco_oasim_esp_below.bin','r','b');
eds=fread(fid,'float32'); fclose(fid);
eds=reshape(eds,360,160,13,12);

figure
for il=1:13,
subplot(5,3,il), pcolor(squeeze(edp(:,:,il,1))'); 
caxis([0 8]);
shading flat, colorbar
end

figure
for il=1:13,
subplot(5,3,il), pcolor(squeeze(eds(:,:,il,1))'); 
caxis([0 8]);
shading flat, colorbar
end

figure
for il=1:13,
subplot(5,3,il), pcolor(squeeze(edp(:,:,il,1))'+squeeze(eds(:,:,il,1))'); 
caxis([0 16]);
shading flat, colorbar
end


newedp=edp;
neweds=eds;

newedp(:,:,1,:)=2*newedp(:,:,1,:);
newedp(:,:,13,:)=2*newedp(:,:,13,:);
neweds(:,:,1,:)=2*neweds(:,:,1,:);
neweds(:,:,13,:)=2*neweds(:,:,13,:); 

fid=fopen('ecco_oasim_edp_387_712_below.bin','w','b');
for it=1:12,
 for il=1:13,
  clear tmp, tmp=squeeze(newedp(:,:,il,it));
  fwrite(fid,tmp,'float32');
 end
end
fclose(fid);

fid=fopen('ecco_oasim_esp_387_712_below.bin','w','b');
for it=1:12,
 for il=1:13,
  clear tmp, tmp=squeeze(neweds(:,:,il,it));
  fwrite(fid,tmp,'float32');
 end
end
fclose(fid);

