[ncl-talk] plotting grid lines for unstructured grids

Mary Haley haley at ucar.edu
Mon Apr 4 10:35:36 MDT 2016


Hi Adam,

We have a function called "gsn_coordinates" which draws grid points or grid
lines for the given data array, but it doesn't handle the special case of
an unstructured grid with N cells and NE edges.

However, if your grid is defined such that you have an array of indexes
that represent vertex edges for another array that contains the nodes, then
you might be able to use the gsn_add_polyline routine with the special
"gsSegments" resource.

See example "mpas_faster_2.ncl" which shows the gsSegments method, and the
mpas_2.ncl example which draws the same thing, but in a slower fashion
using basic line draws.  The point of this example is to show how much
faster gsSegments can make your code.

https://www.ncl.ucar.edu/Applications/mpas.shtml

The ICON page that Guido pointed you to also makes use of the gsSegments
resource, in example icon_faster_2.ncl.

https://www.ncl.ucar.edu/Applications/icon.shtml

If you have an unstructured grid that is different from the ICON and the
MPAS grids, then I would love to add this as yet another example on our
website.  I could help you create the script if necessary, but would need
access to your data file. I could perhaps use this as a way to enhance
gsn_coordinates to better handle unstructured grids.

--Mary




On Sun, Apr 3, 2016 at 3:01 PM, Adam Herrington <
adam.herrington at stonybrook.edu> wrote:

> How would one plot grid lines for a data array on an unstructured grid?
>
> I am able to plot grid boxes around nodes by setting cnFillMode =
> "CellFill" and defining the vertices of the grid box. But what if I want
> grid lines connecting the nodes? And what if I want to plot grid lines on
> every other node (not that the data arrays have one dimension for the
> horizontal dimension, containing all the tiles of the sphere --this is a
> global model)
>
> Any help would be greatly appreciated
>
> Adam
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160404/0a14430c/attachment.html 


More information about the ncl-talk mailing list