フィルターのクリア

Precipitation Data with latitude and longitude showing up sideways

1 回表示 (過去 30 日間)
Cayla Whiteside
Cayla Whiteside 2019 年 5 月 23 日
回答済み: James Karden 2020 年 12 月 14 日
I downloaded precipitation data from the TRMM satellite for a specific region of Africa. The precipitation data downloaded as a 60x100 matrix. Each pixel represents 0.25 degrees of latitude/longitude. The longitude range is from 10 to 25 (at 100 pixels) and the latitude range is from -30 to -5 (60 pixels). However, when I plot the data using imagesc, the data is flipped. It looks like Africa fell over to the right. I have tried transposing the matrix into a 100x60 matrix using the transpose function but that messes up the data even further.
This is how I downloaded the precipitation data from the HDF file
precipitation(:,:)= hdfread(filename, '/Grid/precipitation', 'Index', {[1 1],[1 1],[60 100]});
This is the code I used to create the latitude and longtidue vectors:
gridSize=0.25; % arc degrees
lat=-30+(gridSize/2):0.25:-5-(gridSize/2);
lon=10+(gridSize/2):0.25:25-(gridSize/2);
[lonGrid,latGrid]=meshgrid(lon,lat);
This is the code I used to plot my data:
imagesc(lon,lat,precipitation(:,:,1))
capture1.PNG

回答 (2 件)

Hitesh Bugata
Hitesh Bugata 2020 年 6 月 12 日
Use Panoply by NASA to visualize netCDF files. It is easy to use.

James Karden
James Karden 2020 年 12 月 14 日
Try this
flip_data = data';
This should flip it on its side for you and be right!

カテゴリ

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