Matlab處理氣象數據(十三)逐點變化的DTR及其異常

% 兩套數據逐點DTR
% 導入Tmax1,72*128*396
% 導入Tmax2,72*128*396
% 導入Tmin1,72*128*396
% 導入Tmin2,72*128*396
 
Ymax1=reshape(Tmax1,[72,128,12,33]);
Ymax1=nanmean(Ymax1,3);
Ymax1=squeeze(Ymax1); %<72x128x33 double>
 
Ymax2=reshape(Tmax2,[72,128,12,33]);
Ymax2=nanmean(Ymax2,3);
Ymax2=squeeze(Ymax2); 
 
Ymin1=reshape(Tmin1,[72,128,12,33]);
Ymin1=nanmean(Ymin1,3);
Ymin1=squeeze(Ymin1); 
 
Ymin2=reshape(Tmin2,[72,128,12,33]);
Ymin2=nanmean(Ymin2,3);
Ymin2=squeeze(Ymin2); 
 
DTR1=Ymax1-Ymin1;
DTR2=Ymax2-Ymin2;

畫兩套數據的DTR變化趨勢圖

%NCEP的
for j=1:128
for i=1:72
if isnan(DTR1)==1
continue
else
y=DTR1(i,j,:);
n = 33;
dt=1;
% 計算斜率
ndash = n * ( n - 1 ) / 2;
s = zeros( ndash,1 );
s=nan;
r = 1;
for p = 1:n-1
for q = p+1:n
s(r) = ( y(q) - y(p) ) / ( q - p ) / dt;
r = r + 1;
end
end
sDTR1(i,j) = median( s );
end
end
end
pcolor(sDTR1);
shading flat;
%添加邊界線
[x y]=meshgrid(72:0.5:135.5,18:0.5:53.5);
pcolor(x,y,sDTR1);
shading flat;
hold on
map=shaperead('E:\數據\邊界\china_map1\maps\bou2_4l.shp');%加載省界帶南海的邊界線
bou2_4lx=[map(:).X];%提取經度
bou2_4ly=[map(:).Y];%提取緯度
provence=[bou2_4lx',bou2_4ly']; 
plot(bou2_4lx,bou2_4ly,'-k','LineWidth',1.2);%繪國界
axis([72 136 18 54]);%設置顯示的經緯度範圍
hold off
%最後調整colormap顏色區間爲-0.1~0.1

在這裏插入圖片描述

NCEP數據逐點DTR變化
%觀測數據的
for j=1:128
for i=1:72
if isnan(DTR2)==1
continue
else
y=DTR2(i,j,:);
n = 33;
dt=1;
% 計算斜率
ndash = n * ( n - 1 ) / 2;
s = zeros( ndash,1 );
s=nan;
r = 1;
for p = 1:n-1
for q = p+1:n
s(r) = ( y(q) - y(p) ) / ( q - p ) / dt;
r = r + 1;
end
end
sDTR2(i,j) = median( s );
end
end
end
pcolor(sDTR2);
shading flat;
%添加邊界線
[x y]=meshgrid(72:0.5:135.5,18:0.5:53.5);
pcolor(x,y,sDTR2);
shading flat;
hold on
map=shaperead('E:\數據\邊界\china_map1\maps\bou2_4l.shp');%加載省界帶南海的邊界線
bou2_4lx=[map(:).X];%提取經度
bou2_4ly=[map(:).Y];%提取緯度
provence=[bou2_4lx',bou2_4ly']; 
plot(bou2_4lx,bou2_4ly,'-k','LineWidth',1.2);%繪國界
axis([72 136 18 54]);%設置顯示的經緯度範圍
hold off
%最後調整區間爲-0.1~0.1

在這裏插入圖片描述

觀測數據逐點DTR變化

相關鏈接:
Matlab處理氣象數據——目錄

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章