No BSD License  

Highlights from
Climentine topo data

image thumbnail

Climentine topo data

by

 

ploting Climentine topo data topogrd2.dat

cc()
function cc()
% clc
% close all
% clear all
% longitude   0.125--->359.875
% latitude  -89.875--->89.875
fid=fopen('driv','r');
fgets(fid);
fgets(fid);
%fseek(fid,0,0);
res=fscanf(fid,'%f',1);
fgets(fid);
lon_begin=fscanf(fid,'%f',1);
fgets(fid);
lon_end=fscanf(fid,'%f',1);
fgets(fid);
lat_begin=fscanf(fid,'%f',1);
fgets(fid);
lat_end=fscanf(fid,'%f',1);
fgets(fid);
orig_file_name=fscanf(fid,'%s',1);
fgets(fid);
cutt_file_name=fscanf(fid,'%s',1);
fclose(fid);
 for i=0:1440
     if abs(lon_begin-(0.125+i*0.25))<0.25
         lon_begin=0.125+i*0.25;
     end
     if abs(lon_end-(0.125+i*0.25))<0.25
         lon_end=0.125+i*0.25;
     end     
     if abs(lat_begin-(89.875-i*0.25))<0.25
         lat_begin=89.875-i*0.25;
     end
     if abs(lat_end-(89.875-i*0.25))<0.25
         lat_end=89.875-i*0.25;
     end          
 end
 
 lon_num=(lon_end-lon_begin)/0.25+1;
 lat_num=(lat_end-lat_begin)/0.25+1; 
disp('waiting...');
% load topogrd2.dat;
% M=transpose(reshape(transpose(topogrd2),1440,720));
fid=fopen(orig_file_name,'r');
fid1=fopen(cutt_file_name,'w');
M=fscanf(fid,'%f %f %f %f %f %f %f %f %f %f',[10 inf]);
M=transpose(reshape(M,1440,720));
M=M(1:lat_num,1:lon_num);
clear topogrd2;
%  lon=0.125:0.25:359.875;
%  lat=-89.875:0.25:89.875;
lon=lon_begin:0.25:lon_end;
lat=lat_begin:0.25:lat_end;

figure(1);
v=-8000:res:5000;
% surf(lon,lat,M,v,'FaceColor','interp','FaceLighting','phong');
% surf(Z,C,'FaceColor','interp','FaceLighting','phong')
 [C,h]=contourf(lon,lat,M,v);
 colorbar;
%[C,h]=contourf(M);
%contour3(M)
%colormap(cool);

%saveas(gcf,'lunar_contour.png','png');

figure(2)
surf(lon,lat,M,'EdgeColor','none');
%surf(lon,lat,M);
camlight left; 
lighting phong;
view(0,90);
%colormap(hsv);
colorbar;

fprintf(fid1,'%8.1f %8.1f %8.1f %8.1f %8.1f %8.1f %8.1f %8.1f %8.1f %8.1f\n',M);
%saveas(gcf,'lunar_3d.png','png');
fclose(fid);
fclose(fid1);

Contact us