[pyngl-talk] Updates for using Pyngl

Mary Haley haley at ucar.edu
Mon Oct 24 11:31:42 MDT 2016


I think the issue is that you are using "resources" to set wsMaximizeSize,
and then you also pass this list into the contour_map call. You don't want
to do this, so I suggest using a different resource list to set

wresources = Ngl.Resources()
wresources.wsMaximumSize = 33554432

Since you have a large grid, I recommend setting res.cnFillMode =
"RasterFill" if you haven't already. This may fix the warning as well.

You can then use "resources" for setting your contour plot options.

Also, I don't think you need to do all that stuff with calling get_float to
retrieve a bunch of values and creating the contours twice.

See the modified version of your script attached.  It looks like you just
sent me a partial script, so what I've modified is just an example of how
you can change your original script.


On Mon, Oct 24, 2016 at 9:52 AM, Xiaoni Wang <xiaoni.wang at obspm.fr> wrote:

> Dear Sir or Madam,
>       Sorry to write to you several emails !  I would like to update the
> news and questions since I have wrote to you.  I solved the installation
> problem of Pyngl and Pynio. I can import them without problem.
>      Now I tried to run a python code to plot data on ISCCP grids. As I
> mentioned to you in my previous email, I have data such as:
>       ISCCP latitude : lat_isccp, 1D, (256915,)
>       ISCCP longitude: lon_isccp, (1D, (256915,))
>       data: emis, (1D , (256915,))
>       I also have the horizontal width for each grid (in km).
>      I would like to make 2D plot on ISCCP grids. When I launched my
> program, it has fatal errors:
>         fatal:ContourPlotDraw: Workspace reallocation would exceed
> maximum size 100000000
>      After reading the FAQ, I added the following lines in my codes:
> ws_id = Ngl.get_workspace_id()
>         resources = Ngl.Resources()
>         resources.wsMaximumSize = 33554432
>         Ngl.set_values(ws_id,resources)
>     But then I got another error:
>        fatal:["Error.c":406]:ErrorInitialize:Only one instance of
> ErrorClass is supported.
>     I do not understand….. I will look again at your tutorial to get more
> information. The attached is the code that I used. Thank you in advance if
> you could give some clue.
> Best regards
> Xiaoni
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20161024/449ddf57/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_mod.py
Type: text/x-python-script
Size: 1138 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20161024/449ddf57/attachment.bin 

More information about the pyngl-talk mailing list