How do I take the average SST over a specific region and date.
4 ビュー (過去 30 日間)
古いコメントを表示
I provided the code I have done so far, I have no experience coding. I'm trying to figure out how to take the average sst from 01-Jan-1984 and 01-Dec-2014 within Latitude: 60N to 30N and Longitude 150 to 240. This is for a time series. Please help.
0 件のコメント
回答 (1 件)
ANKUR KUMAR
2017 年 12 月 2 日
lat=ncread('sst.mnmean.nc','lat'); %for reading the lat variable from .nc file
lon=ncread('sst.mnmean.nc','lon');
sst=ncread('sst.mnmean.nc','sst');
id1=find(lat>30&lat<60); %find function finds the index in lats where the value lies between 30 and 60
id2=find(lon>150&lon<240);
lat1=lat(id1); %lat1 stores those lat values from id1, in which the specific indices are saved
lon1=lon(id2);
sst1=nanmean(sst(id2,id1,:),3); % sst accepts the indices from id1 and id2 and mean takes the mean alone the third dimension
contourf(lon1,lat1,sst1','linecolor','none') %contour plot of the required plot.
You can delete the comments, which are written after %
1 件のコメント
Amir Barkhordary
2018 年 11 月 7 日
Thanks for the input. I have already seen your answer on a similar problem. However, I am not sure how to integrate your code to modify mine to create a mean plot.
参考
カテゴリ
Help Center および File Exchange で Time Series についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!