<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Xiaoni,<div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div class="" style="word-wrap: break-word;"><div class="">&nbsp; &nbsp; &nbsp; 1) To install Pyngl, I followed the suggestion on your website:</div><div class="">&nbsp; &nbsp; &nbsp;&nbsp;<font color="#831100" class="">conda create --name pyn_test python=2</font></div><div class=""><font color="#831100" class="">&nbsp; &nbsp; &nbsp; source activate pyn_test</font></div><div class=""><font color="#831100" class="">&nbsp; &nbsp; &nbsp; conda install --channel ncar --channel khallock pynio pyngl</font></div></div></blockquote></div></div></blockquote><div class=""><br class=""></div><div class="">Everything above looks correct.</div><br class=""><blockquote type="cite" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div class="" style="word-wrap: break-word;"><div class="">&nbsp; &nbsp; &nbsp; Then I modified my .bashrc by add the new path : &nbsp;export PATH="/obs/xxw/anaconda2/bin:<font color="#7c2a00" class="">/<wbr class="">obs/xxw/anaconda2/envs/pyn_<wbr class="">test/bin</font>:$PATH"</div></div></blockquote></div></div></blockquote><div class=""><blockquote type="cite" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div class="" style="word-wrap: break-word;"><div class="">&nbsp; &nbsp; &nbsp; …</div><div class="">&nbsp; &nbsp; &nbsp; Then I tried to import Nio, but I have an error:&nbsp;ImportError: No module named Nio</div></div></blockquote></div></div></blockquote></div><div class=""><br class=""></div><div class="">You should not need to explicitly add the /obs/xxw/anaconda2/envs/pyn_test/bin directory to your path; running “source activate pyn_test” does that for you.</div><div class=""><br class=""></div><div class="">In this case, it looks like in addition to adding pyn_test/bin to $PATH manually, the root conda environment has been added to $PATH with a higher priority. Running “which python” will output “/obs/xxw/anaconda2/bin/python”, and that python binary uses the directory “/obs/xxw/anaconda2/lib/python2.7/site-packages” for external modules. Because PyNIO and PyNGL were installed in the pyn_test environment, they do not exist in that directory.</div><div class=""><br class=""></div><div class="">Could you please try modifying your .bashrc file and remove all conda-related commands except for export PATH="/obs/xxw/anaconda2/bin:$PATH”? After doing that, try running “source activate pyn_test” again (the other two conda commands are only necessary when creating/installing PyNIO/PyNGL into a new environment).</div><div class=""><br class=""></div><div class="">Please let us know if you continue to experience issues with conda.</div><div class=""><br class=""></div><div class="">Kevin</div></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 24, 2016, at 11:13 AM, Mary Haley &lt;<a href="mailto:haley@ucar.edu" class="">haley@ucar.edu</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_default" style="font-size:small">Xianoi,</div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small">I've already replied offline about the conda issues, and I'm hoping Kevin can address these.</div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small">Meanwhile, with regard to your python script, I think you are on the right track. However, I don't think you want to transpose the data before you plot it. If it is dimensioned latitude x longitude, with latitude being the leftmost dimension, then you don't need to transpose it. If it is dimensioned longitude by latitude, then you need to transpose it.</div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small">To show the figure on the screen (we call it an "X11 window"), then change "wks_type" to be "x11" instead of "ps". You need to click on the X11 window with your left mouse button if you want the plot to go away.</div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small">Also, you don't want to set these two options:</div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small"><div style="font-size:12.8px" class="">&nbsp; &nbsp; resources.nglDraw &nbsp;= False</div><div style="font-size:12.8px" class="">&nbsp; &nbsp; resources.nglFrame = False</div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">because these settings would cause your plot to not be drawn at all.&nbsp; Either remove those lines or comment them out.&nbsp; They are both True by default.</div></div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small">And yes, once you have all the parameters (we call them "resources") set up, you should be able to use the same ones to plot other data. The tiMainString is probably the only thing you'll need to change.</div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small">However, if you decide you don't like the contour levels that PyNGL chooses for you, then you might want to change these for your plots. You can look at the cn05p.py for an example of setting contour levels using a min value, max value, and a spacing (for equally spaced contours), or&nbsp;ctnccl.py for example of explicitly setting contour levels to an unequally-spaced array of values.</div>







<div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small">Finally, if your data is taking a long time to plot because it is a large array, then you can try setting:</div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small"><div style="font-size:12.8px" class="">&nbsp; &nbsp; resources.cnFillMode &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= "RasterFill" &nbsp; &nbsp;# default is AreaFill</div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">Raster contouring can be noticeably faster than the default "AreaFill", which is smooth contouring.&nbsp; You can also set:</div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">&nbsp;resources.cnRasterSmoothingOn = True</div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">which will smooth your raster contours, but still should be faster than AreaFill.</div></div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small">I will attach a Python script that plots the "topo" variable from old and partial ISCCP file that I have.&nbsp; The data on this file is one-dimensional, along with the lat/lon arrays. Here's what a dump of the file looks like:</div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace" class="">&nbsp; &nbsp;file global attributes:</font></div><div class="gmail_default"><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; description : ISSCP reduced grid</font></div><div class="gmail_default"><font face="monospace, monospace" class="">&nbsp; &nbsp;dimensions:</font></div><div class="gmail_default"><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; nodes = 6596</font></div><div class="gmail_default"><font face="monospace, monospace" class="">&nbsp; &nbsp;variables:</font></div><div class="gmail_default"><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; float lon ( nodes )</font></div><div class="gmail_default"><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;units : &nbsp; &nbsp; &nbsp; &nbsp;degrees east</font></div><div class="gmail_default"><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;long_name : &nbsp; &nbsp;longitude</font></div><div class="gmail_default"><font face="monospace, monospace" class=""><br class=""></font></div><div class="gmail_default"><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; float lat ( nodes )</font></div><div class="gmail_default"><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;units : &nbsp; &nbsp; &nbsp; &nbsp;degrees north</font></div><div class="gmail_default"><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;long_name : &nbsp; &nbsp;latitude</font></div><div class="gmail_default"><font face="monospace, monospace" class=""><br class=""></font></div><div class="gmail_default"><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; float topo ( nodes )</font></div><div class="gmail_default"><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;units : &nbsp; &nbsp; &nbsp; &nbsp;meters above sea level (I think)</font></div><div class="gmail_default"><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;long_name : &nbsp; &nbsp;topology</font></div><div class="gmail_default"><br class=""></div></div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small">I'll include the script and the second and third images just in case. I use "png" as the output format.</div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small">--Mary</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Oct 24, 2016 at 6:50 AM, Xiaoni Wang <span dir="ltr" class="">&lt;<a href="mailto:xiaoni.wang@obspm.fr" target="_blank" class="">xiaoni.wang@obspm.fr</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Dear colleague,<div class="">&nbsp; &nbsp; &nbsp; I tried to install Pyngl on my computer in order to draw 2D figures with ISCCP grids. Before this, I had used condo to install python2 and other python tools in /obs/xxwang/anaconda2/.</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; &nbsp; 1) To install Pyngl, I followed the suggestion on your website:</div><div class="">&nbsp; &nbsp; &nbsp; <font color="#831100" class="">conda create --name pyn_test python=2</font></div><div class=""><font color="#831100" class="">&nbsp; &nbsp; &nbsp; source activate pyn_test</font></div><div class=""><font color="#831100" class="">&nbsp; &nbsp; &nbsp; conda install --channel ncar --channel khallock pynio pyngl</font></div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; &nbsp; Then I modified my .bashrc by add the new path : &nbsp;export PATH="/obs/xxw/anaconda2/bin:<font color="#7c2a00" class="">/<wbr class="">obs/xxw/anaconda2/envs/pyn_<wbr class="">test/bin</font>:$PATH&nbsp;»</div><div class="">&nbsp; &nbsp; &nbsp; I can see the environments:</div><div class="">&nbsp; &nbsp; &nbsp; pyn_test &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* &nbsp;/obs/xxw/anaconda2/envs/pyn_<wbr class="">test</div><div class="">&nbsp; &nbsp; &nbsp; root &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /obs/xxw/anaconda2</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; &nbsp; Then I tried to import Nio, but I have an error:&nbsp;ImportError: No module named Nio</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; &nbsp; Could you help me to figure out why ?&nbsp;</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; &nbsp;2) I have another question about using the Pyngl for plotting data on ISCCP grids. Maybe this question would be (too) simple….</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;I have my data on ISCCP equal area grids (0.25 degree in latitude, and varying espace in longitude, with more grids near equator and less grids near pole). My data are global data. In my test:</div><div class="">&nbsp; &nbsp; &nbsp; ISCCP latitude : lat_isccp, 1D, (256915,) ),</div><div class="">&nbsp; &nbsp; &nbsp; ISCCP longitude: lon_isccp, (1D, (256915,))&nbsp;</div><div class="">&nbsp; &nbsp; &nbsp; data: emis (1D , (256915,)). &nbsp;&nbsp;</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;I would like to plot emis data on 2D map. I do not know if I should define&nbsp;<span style="white-space:pre-wrap" class="">resources.mpProjection ?&nbsp;</span><span style="white-space:pre-wrap" class="">how to show figure on screen, or h</span><span style="white-space:pre-wrap" class="">ow to save this figure ? or If I have several parameters to plot, I guess that I can use these configurations for all the figures (except &nbsp;</span>resources.tiMainString &nbsp;)<span style="white-space:pre-wrap" class="">?  </span></div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;In the below is my example code for plotting one parameter ‘emis’ . I adapted from your SEAM example.</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; &nbsp; wks_type = "ps"</div><div class="">&nbsp; &nbsp; &nbsp; wks = Ngl.open_wks(wks_type, "isccp")</div><div class="">&nbsp; &nbsp; &nbsp; resources = Ngl.Resources()</div><div class="">&nbsp; &nbsp; resources.sfXArray &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= lon_isccp</div><div class="">&nbsp; &nbsp; resources.sfYArray &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= lat_isccp</div><div class="">&nbsp; &nbsp; resources.nglSpreadColorStart = 176</div><div class="">&nbsp; &nbsp; resources.nglSpreadColorEnd &nbsp; = 2</div><div class="">&nbsp; &nbsp; resources.cnFillOn &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= True</div><div class="">&nbsp; &nbsp; resources.cnFillMode &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= "AreaFill"</div><div class="">&nbsp; &nbsp; resources.cnFillPalette &nbsp; &nbsp; &nbsp; = "BlAqGrYeOrReVi200"</div><div class="">&nbsp; &nbsp; resources.cnLinesOn &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = False</div><div class="">&nbsp; &nbsp; resources.cnLineLabelsOn &nbsp; &nbsp; &nbsp;= False</div><div class="">&nbsp; &nbsp; resources.lbBoxLinesOn &nbsp; &nbsp; &nbsp; &nbsp;= False</div><div class="">&nbsp; &nbsp; resources.lbLabelFontHeightF &nbsp;= 0.015</div><div class="">&nbsp; &nbsp; resources.tiMainString &nbsp; &nbsp; &nbsp; &nbsp;= "Emis"</div><div class="">&nbsp; &nbsp; resources.nglDraw &nbsp;= False</div><div class="">&nbsp; &nbsp; resources.nglFrame = False</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; zt = np.transpose(emis)</div><div class="">&nbsp; &nbsp; contour = Ngl.contour(wks,zt,resources)</div><div class="">&nbsp; &nbsp;&nbsp;<span style="white-space:pre-wrap" class="">Ngl.end()</span></div><div class=""><span style="white-space:pre-wrap" class=""><br class=""></span></div><div class=""><span style="white-space:pre-wrap" class="">    Thank you very much for your help  in advance !!</span></div><div class=""><span style="white-space:pre-wrap" class=""><br class=""></span></div><div class=""><span style="white-space:pre-wrap" class=""><br class=""></span></div><div class=""><span style="white-space:pre-wrap" class="">Best regards</span></div><div class=""><span style="white-space:pre-wrap" class=""><br class=""></span></div><div class=""><span style="white-space:pre-wrap" class="">Xiaoni W</span></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">&nbsp;</div><div class="">&nbsp; &nbsp;</div><div class="">&nbsp; &nbsp; &nbsp;</div></div><br class="">______________________________<wbr class="">_________________<br class="">
pyngl-talk mailing list<br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/pyngl-talk" rel="noreferrer" target="_blank" class="">http://mailman.ucar.edu/<wbr class="">mailman/listinfo/pyngl-talk</a><br class="">
<br class=""></blockquote></div><br class=""></div>
<span id="cid:2820E7CE-8A67-4259-A048-F2A40ED85790@scd.ucar.edu">&lt;isccp3.png&gt;</span><span id="cid:703E0116-17FF-4753-8D03-68661533207A@scd.ucar.edu">&lt;isccp2.png&gt;</span><span id="cid:A64183EB-BA66-4EB4-AE1B-E222E845EA1F@scd.ucar.edu">&lt;isccp.py&gt;</span>_______________________________________________<br class="">pyngl-talk mailing list<br class="">List instructions, subscriber options, unsubscribe:<br class=""><a href="http://mailman.ucar.edu/mailman/listinfo/pyngl-talk" class="">http://mailman.ucar.edu/mailman/listinfo/pyngl-talk</a><br class=""></div></blockquote></div><br class=""></div></body></html>