How does I extract data from netcdf on given lat lon?

5 ビュー (過去 30 日間)
HN
HN 2022 年 1 月 19 日
コメント済み: HN 2022 年 1 月 22 日
Dear,
I have a .NC file of 'uwnd' with 4 dimensions that includes lon, lat, level, time. I would like to extract uwnd data time seris from the netcdf file on this given lat (10 to 70 N) lon (only 32.5 E) position and all time. Is there any way to do that? My netcdf file name is "uwnd.1972.nc".
I wrote an incomplete code in MATLAB for this purpose, which is as follows
file='uwnd.1972.nc';
ncdisp(file)
longitude=ncread(file,'lon');
latitude=ncread(file,'lat');
time=ncread(file,'time');
lev=ncread(file,'level');
u=ncread(file,'uwnd',[14 9 8 1],[14 33 8 inf],[1 1 1 1]);
thanks,

回答 (1 件)

KSSV
KSSV 2022 年 1 月 19 日
You have multiple ways to do it.
  1. Load all the data into work space using ncread. And use slice. Read about slice function.
  2. Find out in which row/ column the 32.5 E lies using knnsearch and extract the entire row data.
  1 件のコメント
HN
HN 2022 年 1 月 22 日
Data is available for 17 levels (1000, 925, 850, 700, 600, 500, 400, 300 , .....and 10). I just want 300 hPa level data, not all levels. I have loaded the data into the workspace with the ncread command. uwnd=ncread(file,'uwnd'); The dimensions of the data are as follows: uwnd Size: 144x73x17x366 Dimensions: lon,lat,level,time My attempt to use the slice function failed.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeNetCDF についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by