- 积分
- 24
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-11-7
- 最后登录
- 1970-1-1
|

楼主 |
发表于 2018-3-24 14:41:55
|
显示全部楼层
%画区域亮温值
clear
color = [
% 0 0 0
0 0.0863 0.4824
0 0.2235 1.0000
0 0.6353 1.0000
0 0.9843 1.0000
0 0.7294 0
0 0.8471 0
0.6157 0.9137 0
1.0000 0.9804 0
1.0000 0.7137 0
0.9961 0.5137 0
0.9961 0 0
0.8431 0 0
% 0.9294 0.0275 0.8314
]; %设置12个基本颜色的RGB值
mincol=[0 0 0];
maxcol=[0.9294 0.0275 0.8314];
figure
latlim=[-30 30];lonlim=[-150 -100]; %设置所画区域的经纬度
position1=5;
position2=13;
xint=10; %纬度标注间隔
yint=10; %经度标注间隔
ax=axesm('mercator','grid','off','MapLatLimit',latlim,'MapLonlimit',lonlim,'MLabelParallel','south', ... ,%将经度刻度标签放在南方,即下部
'FlatLimit',latlim,'Frame','on','MeridianLabel','on','MLabelLocation',xint,'MLineLocation',xint, ... ,
'ParallelLabel','on','PLabelLocation',yint,'PLineLocation',yint,'ScaleFactor',1,'LabelUnits','de',...
'FontName','Times New Roman','FontSize',14,'FEdgecolor',[0 0 0],'PLabelRound',0,'FLineWidth',2); %坐标轴设置
% setm(gca,'MLabelLocation',60);%标上经度刻度标签,每隔60度。MLineLocation经度间隔
% setm(gca,'ParallelLabel','on');%设置经度刻度标签可见
% setm(gca,'Origin',[0,180,0]) %设置地图的中心位置和绕中心点和地心点的轴旋转角度
set(ax,'Visible','off');%---设置坐标轴可视
data1=load('E:\MWTS\FY3C_MWTSX_GBAL_L1_20140701_0543_033KM_MS-TB—t.txt'); %输入亮温数据文件名
outpng=['E:\MWTS\ch8-20140701-PCA1-destripped.png'] %输出图形文件名
scanline=300;
nfov=90;
lat=data1(500*nfov+1:800*nfov,1);
lon=data1(500*nfov+1:800*nfov,2);
ori=data1(500*nfov+1:800*nfov,8); %指定某个通道亮温
% sim=data2(500*nfov+1:800*nfov,10);
lat=reshape(lat,nfov,scanline);
lon=reshape(lon,nfov,scanline);
ori=reshape(ori,nfov,scanline);%reshape函数重新调整矩阵的行列、数列、维数
% sim=reshape(sim,nfov,scanline);
caxis([1 13]); % caxis([1,13])%将颜色的最小值对应的z取为1(小于1的无法分辩开),同样大于13的也没有办法分辨开
colormap(color)
levels=[200.3:0.7:208.7];%数据范围0
value=ori; %画哪个变量
% % % 用点画法画
for i=1:12
index=find(value>=levels(i) &value<=levels(i+1));
hold on
if length(index)<=0
continue
end
h=plotm(lat(index),lon(index),'o');
set(h,'MarkerSize',1); % 标记的尺寸
set(h,'markerfacecolor',color(i,:),'markeredgecolor',color(i,:));
% MarkerFaceColor:标记点内部的填充颜色;MarkerEdgeColor:标记点边缘的颜色
clear color;
clear index;
end
hold on
% index=find(value>=208.7);
% if length(index)<=0
% continue
% end
% h=plotm(lat(index),lon(index),'o');
% set(h,'MarkerSize',1);
% set(h,'markerfacecolor',maxcol,'markeredgecolor',color(12,:));
% clear c;
% clear idx;
% index=find(value<=200.3);
% hold on
% if length(index)<=0
% continue
% end
% h=plotm(lat(index),lon(index),'o');
% set(h,'MarkerSize',1);
% set(h,'markerfacecolor',mincol,'markeredgecolor',color(1,:));
% clear c;
% clear idx;
% hold on;
%画色标
colorbar( 'location','eastoutside','xtick',[1,2,3,4,5,6,7,8,9,10,11,12],'yticklabel',...,
{'201.0','202.4','203.8','205.2','206.6','208.0'},...,
'lineWidth',1,'FontName','times new roman','FontSize',12,...,
'TickLength',[0.02 0.025],'MinorGridLineStyle','-') %字体大小12号
set(gcf,'color','white')
%画地图界限
SH_Shp2=shaperead('E:\GMI\world map china line\world map china line.shp');%(World map)
plotm(extractfield(SH_Shp2,'Y'),extractfield(SH_Shp2,'X'),'k');
%设置图片大小
set(gcf,'PaperUnits','centimeters')
papersize = get(gcf, 'PaperSize');
width =12;
height= 16;
left=(papersize(1)-width)/2;
bottom=(papersize(2)-height);
myfiguresize = [left, bottom, width, height];
set(gcf, 'PaperPosition', myfiguresize);
%*************************新版边框复原 by Hong Chen************************
edgelongitude=getm(gca,'MapLonLimit');
edgelatitude=getm(gca,'MapLatLimit');
longitudestart=edgelongitude(1);longitudeend=edgelongitude(2);
latitudestart=edgelatitude(1);latitudeend=edgelatitude(2);
axis off; mlabel on; plabel on;
setm(gca,'MLabelParallel',latitudestart,'PLabelMeridian',longitudestart);
% 'MLabelParallel' latitude to label longtitudes
% 'PLabelMeridian' longtitude to label latitudes
latitude1(1)=latitudestart;longitude1(1)=longitudestart;
latitude2(1)=latitudestart;longitude2(1)=longitudeend;
latitude3(1)=latitudeend;longitude3(1)=longitudeend;
latitude4(1)=latitudeend;longitude4(1)=longitudestart;
longitudeinterval=(longitudeend-longitudestart)/10000.0;
latitudeinterval=(latitudeend-latitudestart)/10000.0;
for i=1:10000
latitude1(i+1)=latitudestart;
longitude1(i+1)=longitudestart+longitudeinterval*i;
latitude2(i+1)=latitudestart+latitudeinterval*i;
longitude2(i+1)=longitudeend;
latitude3(i+1)=latitudeend;
longitude3(i+1)=longitudeend-longitudeinterval*i;
latitude4(i+1)=latitudeend-latitudeinterval*i;
longitude4(i+1)=longitudestart;
end
borderlatitude=[latitude1,latitude2,latitude3,latitude4];
borderlongitude=[longitude1,longitude2,longitude3,longitude4];
plotm(borderlatitude,borderlongitude,'-k','LineWidth',1);
set(gcf,'color','white')
%*************************************************************************
%------去除经纬度点 Da Cheng and Xu Chen-----2012/07/05----------
%plabel
h_plabel = handlem('plabel');
for i = 1:length(h_plabel)
pstring = get(h_plabel(i),'string');
pstring(4:12) = [];
set(h_plabel(i),'string',pstring);
set(h_plabel(i),'VerticalAlignment','baseline');
end
h_mlabel = handlem('mlabel');
for i = 1:length(h_mlabel)
mstring = get(h_mlabel(i),'string');
mstring(4:12) = []; % 或者5:13,或者4:12
set(h_mlabel(i),'string',mstring);
end
%-----------------------------------------------------------------
print(gcf, '-dtiff','-r600', outpng)
% close(gcf);
是啊,在画观测的亮温,这个程序是画观测减亮温的,就是只能画出色标和坐标,中间那些乘500,800的地方也不是很明白,麻烦您帮我看一下吧,谢谢您 。 |
|