Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

GLL vertex data: dual grid cell fill. (uglyunnatural for GLL data): This is the standard option in NCL and pyNGL for plotting unstructured data. NCL can internally compute a Delaunay triangulation of the data (via http://www.cs.cmu.edu/~quake/triangle.html ), where the data now lives on the vertex of each triangle. NCL then appears to form the Voronoi diagram (dual grid of the triangulation). On this dual grid, the data is now located at the center of each Voronoi cells. Alternatively, the user can read in a dual grid from a SCRIP file and specify the polygon containing each GLL node. With “RasterFill”, each of these dual grid cells will be colored based on the value of the original data set. This results are an accurate representation of all the data points in the original field, but can be quite ugly and is a very unnatural representation of the original spectral element datalook ugly with occasional chevrons, star-like cells and triangles.

GLL vertex data: triangulation followed + Gourard shading (bestlooks good): This approach is not available in NCL, but is available in matplotlib. In this approach, a Delaunay triangulation is first computed. Then each triangle is shaded using a linear interpolating based on its three vertex values. This produces nice looking results. It also has the advantage that it is monotone and min/max/oscillation preserving. All values in the original data set will be plotted. It’s perhaps the best visual representation of GLL vertex dataBut if you zoom in, you can see the triangles, which are unnatural for GLL data. A Gourard/bilinear shading option for vertex data on quads would be a nice option and show the actual GLL grid when zoomed in.

PG2 data: triangularization + Voronio cell fill (unnatural): NCL’s Delaunay approach can also be used for PG2 data: computing a Delaunay triangulation and then the associated Voronoi grid. However, this is a lot of work to construct Voronoi cells when in the PG2 case, the data is already given as a cell average over quadrilaterals. For PG2, using these quadrilaterals instead of Voronio cells (next option below) is a more accurate representation of the discrete data.

...

The algorithm above is probably using bilinear interpolation. This is acceptable, especially when upscalingupsampling. But for the best results:

For GLL and PG2 data, the best algorithm to use (see Transition to TempestRemap for Atmosphere grids Recommended Mapping Procedures for E3SM Atmosphere Grids ) is TempestRemap’s “intbilin”, as this map is accurate, monotone, and can be used for both downscaling downsampling and upscalingupsampling. The only drawback is that it is not exactly conservative. If exact conservation is needed (so that the mass computed on the interpolation grid is the same as on the native grid), then TempestRemap’s less accurate “mono” should be used.For PG2 data, to remap from FV (unstructured) to FV (latlon), we dont yet have an integrated bilinear option. ESMF’s “aave” option ( which can be obtained most efficiently using NCO’s ncremap) is conservative and good for downscalingless accurate “mono” should be used. mono is good for downsampling, but will produce blocky plots when upscalingupsampling. For nicer looking plots when upscalingupsampling, ESMF’s “bilinear” is currently the only option.

...

pyNGL can construct this dual grid from a triangulation if the user specifies sfXArray and sfYArray. WE dont conver We don't cover this option here, but instead cover the second option where the user reads a dual grid from the SCRIP file and specifies that via sfXCellBounds and sfYCellBounds. For PG2 data, this is the most natural approach, with the PG2 dual grid made up of uniform quadrilaterals given in the PG2 SCRIP file.

...

It may be possible to simplify this example, but so far this is the best solution I’ve come up with to do this particular thing in mpl. Some caveats: this does not seem to work well with different map projections, and I’m not sure why yet. Attempts to first project vertices to the map coordinate system and then draw the polygons has also been largely unsuccessful, so this is a work in progress. Regardless, both of these approaches have the downside of representing the GLL point data as cell-centered data, which is maybe not completely appropriate for data on the GLL grid (however, it probably is the best representation of data on the alternative pseudo-finite-volume physics grids, e.g, ne4pg2).

...