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

1 visualizzazione (ultimi 30 giorni)
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

Risposta accettata

Walter Roberson
Walter Roberson il 25 Gen 2018
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 Commenti
Reza E Rabby
Reza E Rabby il 29 Gen 2018
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 il 29 Gen 2018
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.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Weather and Atmospheric Science in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by