Re: PyNGL vector_map with irregular grid

From: Thomas Shay <tshay_at_nyahnyahspammersnyahnyah>
Date: Thu, 6 Dec 2007 21:13:10 -0500

On Dec 6, 2007, at 8:46 PM, Dennis Shea wrote:

> FYI: There is a pyngl-talk mailing list [pyngl-talk_at_ucar.edu]
>
> The leap from NCL graphics to PYNGL graphics is not
> that great. Look at:
> http://www.ncl.ucar.edu/Applications/trimesh.shtml
> for the appropriate resources.
>
> ===============================
> The pyngl solution is at:
> http://www.pyngl.ucar.edu/Examples/gallery.shtml
> See "Contouring on non-rectangular Grids"
>
> Good luck

Thanks for that, although I have already been able to make contour
plots on this grid. My problem is with vector plots specifically, in
which the u and v need to be 2-d arrays. This is not the case with
contour plots, where the scalar field can be specified as either a 1-
d or a 2-d array.

 From the documentation for Ngl.contour_map:

data
The data to contour. data can be a two-dimensional NumPy array or
NumPy masked array (ny x nx), or a one-dimensional array that is
accompanied by one-dimensional coordinate arrays of the same length
(see description below).

 From the documentation for Ngl.vector_map:

u, v
The U and V components of the vectors. u and v should be two-
dimensional NumPy arrays or NumPy masked arrays (dimensioned ny x nx).

> Thomas J. Shay wrote:
>> I am using the PyNGL interface for this problem.
>>
>> I'm trying to figure out how to make a vector/map plot
>> (Ngl.vector_map) with the output of a finite element model. The
>> lon, lat, u, and v are 1-d arrays, with each element corresponding
>> to a node in the mesh. According to the documentation of
>> Ngl.vector_map, the u and v (and presumably lon and lat) need to
>> be 2-d arrays. My mesh has irregular triangle elements and the
>> boundary is also irregular (has a real coastline, etc.), so it's
>> not clear how to turn u, v, etc. into 2-d arrays.
>>
>> Can anyone point me in the right direction?
>>
>> Thanks,
>>
>> Tom
>>
>>
>
>

-- 
Thomas Shay
UNC Chapel Hill
tshay_at_email.unc.edu
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Dec 06 2007 - 19:13:10 MST

This archive was generated by hypermail 2.2.0 : Tue Dec 11 2007 - 14:19:21 MST