
%--- Take the old 'earth' color map and decimate it by nc....  
% 	Assumes old map names 'F' and names new map 'FN'          
% 	J. G. Bellingham, October 15, 1996 

nc = 32;     	% number of colors...
ns = 256/nc;	% number of shades...

for i = 1:nc, Fdec(i,:)=F(i*ns,:); end
Fdec(nc,:)=F(255,:);

%--- Fix the intensity... 
  %--- ...ocean first.... 
for i = 1:(nc*3/4-1), 
	Fdec(i,:)=floor(Fdec(i,:)*(90+i*ns)/sum(Fdec(i,:).^2)^0.5); 
end;
  %--- ...land is okay... 

%--- Make expanded color map with light-dark shading... 
for i = 1:nc,
  for j = 1:ns,
    FN((i-1)*ns+j,:) = Fdec(i,:) * j/ns;
  end;
end;

%--- Write new color table to file... 
fid=fopen('test2', 'w'); fwrite(fid,FN,'integer*1'); fclose(fid);

tmp(1,1:256) = 1:256
