Plotting data on curvilinear coord projection

조회 수: 2 (최근 30일)
mashtine
mashtine 2016년 7월 1일
Hello,
I have two lat and lon matrices, each 622x810 and they are of a curvilinear projection. I previously just used vectors of lon and lat to plot my data with surfacem (see below) but I am not sure how to do this with lat and lon as a matrix of curvilinear coordinates.
Any suggestions?
ax = worldmap(latlim, lonlim);
S = shaperead('landareas','UseGeoCoords',true);
surfacem(lat, lon, inpdata)
shading interp
geoshow([S.Lat], [S.Lon],'Color','black');

답변 (3개)

KSSV
KSSV 2016년 7월 1일
As you have matrices in hand, it shall be very easy to plot what you want. If you want to get vectors of lon, lat from 622x810 matrices of each, try using unique(); this will give you the vectors.
  댓글 수: 2
mashtine
mashtine 2016년 7월 1일
Hey!
Thanks for the reply. This won't be as simple because the projection of the map needs to change. When I use geoshow for instance, the coastline will not match up with where it should be for the UK as the data is in one projection and the geoshow is putting the coastline in another.
Dushantha Sandaruwan WIJENDRA NAIDHELAGE
Is ther anyway to convert the covarian projection (meshgird) into noramal Longitude and latitudes?

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


José-Luis
José-Luis 2016년 7월 1일
It is not clear to me how you want those arrays displayed. If you only want to show the points:
geoshow(S.Lat(:), S.Lon(:),'Color','black');
  댓글 수: 2
mashtine
mashtine 2016년 7월 1일
Hi Jose-Luis,
I have another 622x810 matrix of data (inpdata) with values for each grid cells that I would like to plot. Basically, the lon and lat are coordinates of the UK and inpdata is a parameter that I would like to plot to show the pattern across the UK domain.
Makes sense? I need to use surfacem as shown in my code
José-Luis
José-Luis 2016년 7월 4일
I don't know what a matrix of curvilinear coordinates is.

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


Jonathan Eliashiv
Jonathan Eliashiv 2016년 10월 18일
편집: Jonathan Eliashiv 2016년 10월 18일
Super simple actually.
Go ahead and reshape your coordinates and data into 1-d vectors:
X_curvi = reshape(lon,[],1);
Y_curvi = reshape(lat,[],1);
data_curvi = reshape(inpdata,[],1);
Make a meshgrid that you want to interpolate into:
[lon_grid,lat_grid] = meshgrid(minlon:dx:maxlon,minlat:dy:maxlat)
and then you can use the griddata function:
[~,~,data_rectilinear] = griddata(X_curvi,Y_curvi,data_curvi,...
lon_grid,lat_grid)
and plot away
pcolor(lon_grid,lat_grid,data_rectilinear); shading flat

카테고리

Help CenterFile Exchange에서 Map Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by