<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Ralf,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Sorry for the delay. I wanted to create an example for you before I answered this question, but ran out of time so I decided to send you this email. I will try to get an example for you soon, that compares an NCL script with a PyNIO/PyNGL script.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><b>PyNIO</b></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Basically, PyNIO is the Python replacement for the NCL "addfile" command, and PyNGL is the replacement for NCL graphics.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">However, you should be aware that PyNIO doesn't have the function of "addfiles" (reading across several files in one call), so if you have calls to addfiles, you will need to convert them to single "Nio.open_file" calls in PyNIO, and then loop across the files yourself to read in the data.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The other feature that's missing from PyNIO is that when you read a variable off a file, you don't automatically get the coordinate variables like you do with NCL. This is not a huge deal, but you will need to read them in separately. For example:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">NCL:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"> f = addfile("<a href="http://uv300.nc" target="_blank">uv300.nc</a>","r")</div><div class="gmail_default" style="font-size:small"> u = f->U</div><div class="gmail_default" style="font-size:small"> printVarSummary(u)</div><div class="gmail_default" style="font-size:small"> print(u&lat) ; the lat/lon coordinate arrays are automatically attached</div><div class="gmail_default" style="font-size:small"> print(u&lon)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><b>PyNIO</b></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"> f = Nio.open_file("<a href="http://uv300.nc">uv300.nc</a>")</div><div class="gmail_default" style="font-size:small"> u = f.variables["U"][:]</div><div class="gmail_default" style="font-size:small"> lat = f.variables["lat"][:]</div><div class="gmail_default" style="font-size:small"><div class="gmail_default"> lon = f.variables["lon"][:]</div><div><br></div></div><div class="gmail_default" style="font-size:small"><b>PyNGL</b></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">As for NCL graphics, PyNGL is *not* a one-to-one drop-in replacement for the gsn_csm functions, if that's what you're using.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">However, you should be able to reproduce any graphic that you have in NCL in PyNGL, but it might require a few more steps.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I will try to create an example for you soon. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 14, 2017 at 5:29 AM, Ralf Mueller <span dir="ltr"><<a href="mailto:ralf.mueller@mpimet.mpg.de" target="_blank">ralf.mueller@mpimet.mpg.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<br>
<br>
I'm thinking about a major re-write of a larger NCL program and I wondered, if there feature differences<br>
between plain NCL and the python-bindings PyNGL/PyNIO.<br>
<br>
My Script is rather complex and I always felt a little limited in terms of language features (not plotting)<br>
when programming NCL. So I thought, I better re-write my stuff in python instead of debugging the NCL version.<br>
<br>
thx in advance<br>
ralf<br>
______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>