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 CenterFile Exchange에서 Weather and Atmospheric Science에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by