- 积分
- 2492
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2022-1-11
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2022-5-26 08:23:00
|
显示全部楼层
你好,以下是全部过程,请指教
clear;clc;
filename=('F:\HadISST_sst.nc');
ncdisp(filename);
lon=ncread(filename,'longitude');
lat=ncread(filename,'latitude');
sst=ncread(filename,'sst');
time=ncread(filename,'time');
time=double(time); date=datenum(1870,1,1)+time;date2=datestr(date);
ytime=find(date>=datenum(1948,1,1)&date<=datenum(2007,12,31));
T_time=length(ytime);
lon1=find(lon>=40&lon<=290);
lat1=find(lat>=-30&lat<=30);
lonpos=length(Lon1);latpos=length(latn1); pos=lonpos*latpos;
TPsst=sst(lon1,lat1,ytime);
for it = 1:12
TPsst_monthly(:,:,it) = nanmean(TPsst(:,:,it:12:end),3);
end
for it = 1:60
ssta(:,:,1+(it-1)*12:12+(it-1)*12) = TPsst(:,:,1+(it-1)*12:12+(it-1)*12)-TPsst_monthly;
end
b=squeeze(nanmean(ssta(:,:,1:10),3));
m_proj('Equidistant Cylindrical','lat',[-30,30],'lon',[40 290]);
m_coast('patch',[.8 .8 .8]);
hold on
% a=-0.07:0.01:0.07;
[cs,h]=m_contourf(lon1,lat1,b,10)
m_grid('linest','none','fontsize',11)
colormap(jet)
colorbar('fontsize',11)
% caxis([-0.07,0.07])
title('距平','fontsize',12,'fontname','黑体') |
|