Dear all,
I have a 3 dimension array (longitude*latidute*time) (1439*719*1512) which represents the value of precipitation for 0.25 * 0.25 degrees over the whole globe.
I want to have a raster file (tiff) for time=1. how to do it?
whos lon lat t precipitation
Name Size Bytes Class Attributes
lat 1x719 2880 double
lon 1x1419 5760 double
precipitation 1439x719x1512 12515017536 double
t 1512x1 12096 double

댓글 수: 3

Walter Roberson
Walter Roberson 2019년 10월 12일
If you want a raster file for time=1, then do I understand correctly that the task is to convert the lat/long referenced information precipitation(:,:,1) into a raster form?
thank you for your answer. actually I was export this 3d array from a netcdf file which originaly grids are in 0.5*0.5 degree then I was regrid it to 0.25*0.25 degree, now I want to have this grid information as a raster file.
lat = ncread(filename,'lat');
lon = ncread(filename,'lon');
lat=double(lat);
lon=double(lon);
[Loni,Lati] = meshgrid(lon,lat);
lat actual_range = [89.75 -89.75]
lon actual_range = [0.25 359.75]
I want a raster file to show grided precipitation values on my study area at 0.25*0.25 degree.
I'm not sure but do you think geotiff functuin could help me?
thank you for your time

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2019년 10월 12일

0 개 추천

surf(lon, lat, precip(:,:,1).'); view(2)

추가 답변 (2개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019년 10월 11일

1 개 추천

Hi,
You can get much of help from this source.
Good luck.
Image Analyst
Image Analyst 2019년 10월 12일

1 개 추천

If "m" is your 3-D variable, then do this
time1 = m(:, :, 1);
imshow(time1, []);
This assumes your latitude and longitudes are uniformly spaced. If they're not, then you'll have to convert each into a row and column that is linear and assign the values one pixel at a time with the corrected (linear) latitude or longitude.

댓글 수: 3

BN
BN 2019년 10월 12일
Thank you for your answer I do it. the code runs with no problem but output is one black and white image without any grided cells,
how to grid this output?
thank you again
surf(lon, lat, precip(:,:,1).'); view(2)
BN
BN 2019년 10월 12일
Dear Walter Roberson
Thank you. it works well.
I want to accept your answer but on this page I can't see this button under your comments.

댓글을 달려면 로그인하십시오.

질문:

BN
2019년 10월 11일

답변:

2019년 10월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by