[pyngl-talk] Importing pyngl error

Kevin Hallock hallock at ucar.edu
Thu Sep 28 16:58:54 MDT 2017


Hi Alyssa,

In the future, please submit new questions as a separate email to pyngl-talk at ucar.edu <mailto:pyngl-talk at ucar.edu>. Asking and answering questions publicly via pyngl-talk has the potential to help other users with similar questions; sometimes other users are even able to respond before any of the developers have an opportunity to do so.

Regarding NCL’s “gsm_csm_contour_map” function, PyNGL actually has a similar function called “contour_map”, which is accessible in Python as “Ngl.contour_map()”. The Examples page of our PyNGL documentation website has several “contours of unstructured data” scripts that may be useful as a reference: https://www.pyngl.ucar.edu/Examples/gallery.shtml#Contours_of_unstructured_data <https://www.pyngl.ucar.edu/Examples/gallery.shtml#Contours_of_unstructured_data>

In particular, I have attached a modified version of the camse1.py script that you might be able to use as a starting point. The data file it uses (“MPAS.nc”) can be downloaded from the NCL documentation website: http://ncl.ucar.edu/Applications/Data/ <http://ncl.ucar.edu/Applications/Data/>

You can substitute “MPAS.nc” in this script with one of your own data files, although you will likely need to update variable names (“surface_pressure”, “latCell”, and “lonCell” in MPAS.nc) to match the contents of your replacement data file.

Kevin

> On Sep 28, 2017, at 3:20 PM, Alyssa Stansfield <alyssa.stansfield at stonybrook.edu> wrote:
> 
> Kevin,
> 
> Another question. Does pyngl have any functions for plotting unstructured data? I have files where the latitude, longitude, and actual data arrays are all one dimensional, and I want to plot this data on a cylindrical equidistant map. I tried using "gsm_csm_contour_map", but pyngl does not seem to contain this function?
> 
> -Alyssa
> 
> On Thu, Sep 28, 2017 at 5:06 PM, Kevin Hallock <hallock at ucar.edu <mailto:hallock at ucar.edu>> wrote:
> Alyssa,
> 
> Great, I’m glad that fixed it!
> 
> Kevin
> 
>> On Sep 28, 2017, at 2:27 PM, Alyssa Stansfield <alyssa.stansfield at stonybrook.edu <mailto:alyssa.stansfield at stonybrook.edu>> wrote:
>> 
>> Kevin,
>> 
>> I updated XQuartz and now Ngl does import! Thank you!
>> 
>> -Alyssa
>> 
>> On Thu, Sep 28, 2017 at 3:47 PM, Kevin Hallock <hallock at ucar.edu <mailto:hallock at ucar.edu>> wrote:
>> Hi Alyssa,
>> 
>> Could you please check the version of XQuartz that’s installed on your machine? (select “About X11” in the “XQuartz” menu while the XQuartz application is open)
>> 
>> For reference, I currently have XQuartz 2.7.11 installed on my Mac. If your version of XQuartz is lower than 2.7.11, you may need to upgrade it in order for PyNIO and PyNGL to work: https://www.xquartz.org/ <https://www.xquartz.org/>
>> 
>> I hope this helps!
>> Kevin
>> 
>>> On Sep 28, 2017, at 12:47 PM, Alyssa Stansfield <alyssa.stansfield at stonybrook.edu <mailto:alyssa.stansfield at stonybrook.edu>> wrote:
>>> 
>>> Hello,
>>> 
>>> I tried installing PyNIO and PyNGL using anaconda in a separate environment, as suggested on the website. When I open Python and import NIO, it works, but when I try to import Ngl, this error message comes up:
>>> 
>>>   File "/Users/Alyssa/anaconda/envs/pyn_test/lib/python2.7/site-packages/PyNGL/Ngl.py", line 45, in <module>
>>> 
>>>     import fplib
>>> 
>>> ImportError: dlopen(/Users/Alyssa/anaconda/envs/pyn_test/lib/python2.7/site-packages/PyNGL/fplib.so, 2): Library not loaded: /opt/X11/lib/libcairo.2.dylib
>>> 
>>>   Referenced from: /Users/Alyssa/anaconda/envs/pyn_test/lib/python2.7/site-packages/PyNGL/fplib.so
>>> 
>>>   Reason: Incompatible library version: fplib.so requires version 11403.0.0 or later, but libcairo.2.dylib provides version 11203.0.0
>>> 
>>> I tried updating all my modules using conda, but still I get this error. Any ideas on how to fix this?
>>> 
>>> -Alyssa
>>> 
>>> _______________________________________________
>>> pyngl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk <http://mailman.ucar.edu/mailman/listinfo/pyngl-talk>
>> 
>> 
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20170928/3bc75858/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unstruct_1d.py
Type: text/x-python-script
Size: 1025 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20170928/3bc75858/attachment-0001.bin>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20170928/3bc75858/attachment-0003.html>


More information about the pyngl-talk mailing list