Please help . I want to exert precipitation data from nc file .

3 ビュー (過去 30 日間)
Reza E Rabby
Reza E Rabby 2018 年 1 月 25 日
コメント済み: Walter Roberson 2018 年 1 月 29 日
Three dimension lat , lon , time . Three hour interval data that means eight precipitation data in a day.
filename='267523.cmorph_precip.cmorph.3hr-025deg.20030102.nc'
ncdisp(filename)
time=ncread(filename,'time')
lon=ncread(filename,'lon')
lat=ncread(filename,'lat')
Some of code given here . If it is possible provide me the code .
Thank you

採用された回答

Walter Roberson
Walter Roberson 2018 年 1 月 25 日
cmorph_precip = ncread(filename, 'cmorph_precip');
After that, you can do things like
isosurface(lat, lon, time, cmorph_precip, 0.3)
Notice here that lat and lon had to be exchanged for isosurface. Your data has lon as the first coordinate, with MATLAB normally storing 3D data having the Y coordinate first but your data storing the X coordinate first. Just be aware if this if you try to xlabel or ylabel: x and y might be reversed from what you expect.
  2 件のコメント
Reza E Rabby
Reza E Rabby 2018 年 1 月 29 日
Sir How I can determine precipitation of a fix point by lat ,lon,time ? Like that for lon=88.5 lat=22.5 time=0
Walter Roberson
Walter Roberson 2018 年 1 月 29 日
lat_to_query = 88.5;
long_to_query = 22.5;
time_to_query = 0;
lat_idx = interp1(lat, 1:length(lat), lat_to_query, 'nearest');
lon_idx = interp1(long, 1:length(long), long_to_query, 'nearest');
time_idx = interp1(time, 1:length(time), time_to_query, 'nearest');
desired_precip = cmorph_precip(lon_idx, lat_idx, time_idx);
You can query multiple points at the same time using the above code: just make sure that the _to_query variables are vectors the same length (repeat data as needed) and same orientation, and the desired_precip will then be a vector with the same number of values.
This code deliberately looks for the nearest defined data. In some situations where you are dealing with precipitation in adjacent catch basins, you need to use 'previous' instead of 'nearest' so that you query the data for the cell that the location is in instead of querying the closest location.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWeather and Atmospheric Science についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by