Re: Contour plot using lat/lon coordinates

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 8 Jan 2007 08:24:20 -0700 (MST)

I'm hoping one of our other developers will chime in here, but did you
try raster contouring:

   resources = Ngl.Resources()
   resourcs.cnFillOn = True
   resources.cnFillMode = "RasterFill"
   cloudcontour = Ngl.contour_map(wks,t,resources)

You didn't say what happened when you try the bigger array. Is there
anyway you can give us the data so we can try it here?

If possible, you might also try striding the data, although I know
this is not an ideal solution:

   cloudcontour = Ngl.contour_map(wks,t[::2,::2],resources)

The other thing I noticed is that you are not setting sfXArray and
sfYArray. If your data is already tranformed into a particular map
projecton, then it is necessary to do this in order to correctly
overlay the contours on a map. These two resources should be
set to your 1D or 2D longitude/latitude values that represent the
lon/lat points of your data.

If your data are already projected to a particular map projection,
then you need to set up your map limits correctly and also set:

     resources.tfDoNDCOverlay = True

We don't have a PyNGL example of this, but you can see a similar
NCL example at:

http://www.ncl.ucar.edu/Applications/lcnative.shtml

(See the first couple of examples.)

--Mary

On Mon, 8 Jan 2007, Satellite Data Research Group wrote:

> I'd just like to know how to go about making the array.
> I've been trying to use:
> #(non-relevant lines omitted)
> # t is the data set
> import PyNGL.Ngl as Ngl
> wkres = Ngl.Resources()
> # resources is then modified to correctly reflect the appropriate region
> wks = Ngl.open_wks('ps','title',wkres)
> resources = Ngl.Resources()
> cloudcontour = Ngl.contour_map(wks,t,resources)
> Which appears tro be too big. Reducing the array to 900*1650 produces an
> image which does not correctly mirror the input data.
>
> Is it possible to obtain some code examples to show how to correctly go about
> mapping this data?
>
> Cheers,
> satgroup
>
> Quoting Mary Haley <haley_at_ucar.edu>:
>
>>
>> Can you describe what kind of problems you're having? Are they
>> due to the large size of your data, or something else?
>>
>> --Mary
>>
>>
>> On Fri, 29 Dec 2006, Satellite Data Research Group wrote:
>>
>>> Hi,
>>> I'm having a bit of trouble using PyNGL.
>>> I would like to be able to create a contour plot of a large data set
>>> (1700,3000) by it's lat/lon coordinates (which are stored in another
>>> array).
>>> Suggestions would be appreciated.
>>> Cheers,
>>> satgroup
>>>
>>> -----------------------------------------------------------------------
>>> This mail sent through University of Auckland http://www.auckland.ac.nz
>>>
>>> _______________________________________________
>>> pyngl-talk mailing list
>>> pyngl-talk_at_ucar.edu
>>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>>>
>>
>
>
>
> -----------------------------------------------------------------------
> This mail sent through University of Auckland http://www.auckland.ac.nz
>
>
_______________________________________________
pyngl-talk mailing list
pyngl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Mon Jan 08 2007 - 08:24:20 MST

This archive was generated by hypermail 2.2.0 : Mon Feb 05 2007 - 16:33:49 MST