continuous contours in sphere map
4 次查看(过去 30 天)
显示 更早的评论
Hello,
I'm using the mapping toolbox to make contours of measures of magnetic field component and plotting them in a Hammer projection. My original data was in 3 vectors: latitude, longitude and variable values. I used meshgrid to obtain a grid for the latitude and longitude values and griddata to obtain the matrix to pass to contourm.
My problem is: In the projection I should have the same values of the variable in the longitude limits (0º and 360º of longitude), because I'm plotting the whole globe. But griddata doesn't interpolate the variable in the these limits. So I end up with a discontinuity in the variable in one meridian. You can see the problem in this image:
Any idea on how to solve this?
Thank you very much!
0 个评论
回答(1 个)
Rob Comer
2012-3-29
I think you can get griddata to approximate the spherical topology by replicating some of your scattered input points before calling it. Try duplicating all the points in the longitude interval [0 30], for example, and add 360 to the longitudes of the duplicates. Then duplicate the points in [330 360] and subtract 360 from the longitudes of the duplicates. Now your data set will span, roughly, [-30 390]. Grid it this way, then truncate both east and west to bring the grid back to [0 360].
Then, before calling contourm, use georasterref to set up a geographic raster reference object, R, and use the contourm(Z,R,...) syntax. As long as R.Lonlim spans 360 degrees, contourm will handle the longitude wrapping from here. (Don't try to use the contourm(lat, lon, Z, ...) syntax.)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Mapping Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!