[ncl-talk] plotting grid lines for unstructured grids
Mary Haley
haley at ucar.edu
Thu Apr 7 09:37:58 MDT 2016
I'll try to take a look soon. I had a tutorial to give yesterday and was
not checking email for a bit.
Usually, tools want the cells be oriented in counter clockwise order. This
becomes critically important to have this consistency in order for things
like regridding to be applied correctly.
--Mary
On Mon, Apr 4, 2016 at 11:43 AM, adamrhster . <adamrhster at gmail.com> wrote:
> Hi Mary,
>
> I'm trying to plot the cubed-sphere grid using cam-se data. This doesn't
> appear to be addressed in the "seam" examples. In the attached plot, the
> nodes are the red points that I want to connect with ~roughly orthogonal
> grid lines. The blue lines are a result of the cnFillMode = "CellFill"
> using vertices that aren't really of interest to me (these are for the
> interpolating fields to the coupler from file "ne4np4-pentagons.nc")...Alternatively,
> the ESMF re-grid generated a sourcefile with seemingly opposite vertex and
> center coord data (3 vertices for each center coord, and the vertices
> appear to be on the actual computational nodes)
>
> Maybe gsSegments will work...but I don't know a direction to orient the
> line segments since the nodes are not in any particular order. My script
> (and data) are on glade:
>
> /glade/p/work/aherring/grids/seam.ncl
>
>
>
> On Mon, Apr 4, 2016 at 12:35 PM, Mary Haley <haley at ucar.edu> wrote:
>
>> 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/20160407/841eee4b/attachment.html
More information about the ncl-talk
mailing list