Using pcolorm with irregular model grids
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
Having been a long-term m_map user, I've recently switched to using Matlab's mapping toolbox (v2013a at the moment). On the whole, it's pretty great, and it more-or-less replaces m_map's functionality.
In particular, I've been using it to generate quick, and rather nice, plots of geographical output from a model that I use, NEMO. As aficionados will know, this ocean model has a strange tripolar grid that's regular in the southern hemisphere, but distorts to two poles in the north to avoid the dreaded north pole singularity. When plotting, I use pcolorm as follows:
pcolorm (yy, xx, fld);
Where yy is a 2D matrix of latitude locations, xx is a 2D matrix of longitude locations and fld is whatever 2D matrix of model properties I'm interested in at the time. The matrices xx and yy have to be 2D because of this distorted grid, and they are usually the position (in latitude and longitude degrees) of the centre of a given grid cell.
I can't find anything on the Matlab webpages to help me, but I suspect I shouldn't be using the position of grid cell centres for this sort of plot, and should instead be doing something like using the southwest corner of a grid cell. Or, in fact, doing something completely different in which I formally specify the grid cell edges.
Does anyone know of any resources that would explain what the best approach is? The Matlab page is a bit too thin in detail to my mind - especially as a geographical example is used to illustrate it. And though the impact may be less significant, the question of grid cell centres vs. grid cell edges occurs even on a regular grid.
Cheers,
Andrew.
0 commentaires
Réponses (2)
Rob Comer
le 6 Août 2015
Hi Andrew,
With an irregular grid, for which a full latitude-longitude geolocation mesh is needed, I think it's always appropriate to specify centers (sample locations, that is) rather than cell boundaries. Cell boundaries, particularly if the grid is not global, can be defined only indirectly at best. The spherical version of Voronoi cells could be used in the interior, perhaps, but at the edges things become unconstrained.
So, I think you're doing the right thing in your call to pcolorm.
In the case of regular grids, the distinction between cells and point sample locations (postings) is more critical, and you can find some documentation on that here:
See the description of RasterInterpretation.
Regards, Rob
C. Zu Bai
le 28 Nov 2020
Hi Andrew,
I have encountered with the same problem when I tried to plot the map of NEMO model. It took me a lot of time to find the solution. A feasible method is to interpolate the irregular grid onto the regular one using "griddata" or "ScatteredInterpolate". This would introduce some errors of interpolation (not evaluated though). Hope it would help.
Regards,
Hengqian
Voir également
Catégories
En savoir plus sur Geographic Plots dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!