<div><font size="1">Hi Rick,</font></div><font size="1">I am currently trying the following code.</font><div><font size="1"><br></font></div><div><p class="p1" style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 32px; line-height: normal; font-family: Menlo; color: rgb(46, 174, 187);"><font size="1"><span class="s1" style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0); background-color: rgb(135, 138, 4);"><b>import</b></span><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);"> os</span></font></p><p class="p2" style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 32px; line-height: normal; font-family: Menlo;"><font size="1"><span class="s3" style="font-variant-ligatures: no-common-ligatures; color: rgb(180, 36, 25);"><b>import</b></span><span class="s1" style="font-variant-ligatures: no-common-ligatures; background-color: rgb(135, 138, 4);"> Nio,Ngl</span></font></p><font size="1"><div><p class="p1" style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 32px; line-height: normal; font-family: Menlo; color: rgb(46, 174, 187);"><font size="1"><span class="s1" style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0); background-color: rgb(135, 138, 4);">dirc=</span><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);"><b>"/T0/xjb/Analysis/GWD/"</b></span></font></p><p class="p2" style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 32px; line-height: normal; font-family: Menlo;"><font size="1"><span class="s2" style="font-variant-ligatures: no-common-ligatures;">f<span class="Apple-converted-space"> </span>= Nio.open_file(os.path.join(dirc,</span><span class="s2" style="font-variant-ligatures: no-common-ligatures;"><b>"USGS_gtopo30_cube1.5min_to_128x256_c190611_IAP-720dir.nc"</b></span><span class="s1" style="font-variant-ligatures: no-common-ligatures; background-color: rgb(135, 138, 4);">))</span></font></p><p class="p2" style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 32px; line-height: normal; font-family: Menlo;"><span class="s1" style="font-variant-ligatures: no-common-ligatures; background-color: rgb(135, 138, 4);"><font size="1"></font></span></p><p class="p1" style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 32px; line-height: normal; font-family: Menlo; color: rgb(46, 174, 187);"><font size="1"><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);"><b><span class="Apple-converted-space"><span style="background-color: rgb(135, 138, 4);">terr</span> </span>= f.variables["</b></span><span class="s1" style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0); background-color: rgb(135, 138, 4);"><b>terr</b></span><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);"><b>"][:,:,:]</b></span></font></p><p class="p1" style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 32px; line-height: normal; font-family: Menlo; color: rgb(46, 174, 187);"><font size="1"><span class="s2" style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);"><b>terr_sp=terr[:,84,40]</b></span></font></p></div><div><font size="1"><br></font></div><div><font size="1">terr_sp is a processed slice of the terr, I wonder which way could be used to do the PrinVarSummary() in this case? In the pynio, the example showed is only on f.variables than on other variables such as terr_sp.</font></div><div><span style="white-space: pre;"> </span>Jinbo</div></font></div><br><br><blockquote name="replyContent" class="ReferenceQuote" style="padding-left:5px;margin-left:5px;border-left:#b6b6b6 2px solid;margin-right:0">-----原始邮件-----<br>
<b>发件人:</b><span id="rc_from">"Rick Brownrigg" <brownrig@ucar.edu></span><br>
<b>发送时间:</b><span id="rc_senttime">2019-06-21 09:40:12 (星期五)</span><br>
<b>收件人:</b> "谢瑾博" <xiejinbo@mail.iap.ac.cn><br>
<b>抄送:</b> Ncl-talk <ncl-talk@ucar.edu><br>
<b>主题:</b> Re: Re: Re: [ncl-talk] Wonder if there is any printVarSummary() equivalent function in pynio<br><br><div dir="ltr"><div>Well, I think you can use it in any fashion that you could use print/printVarSummary in NCL. I would invite a little experimentation to see if you are getting what you need.</div><div><br></div><div>Rick</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 20, 2019 at 7:01 PM 谢瑾博 <<a href="mailto:xiejinbo@mail.iap.ac.cn" target="_blank">xiejinbo@mail.iap.ac.cn</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Sory for a little digging in this issue. The print() variables, as stated in this website, shows that the print summary can be done once a data is read in and has a reference f. I wonder if this can be used after I used an array that gets the variable and maybe another that process the data again once getting the variables from f? In the old ncl, printVarSummary can basically be used anywhere and any array, not restricted to a reference variable in f. Can this work for Nio?<div><span style="white-space:pre-wrap"> </span>yours,</div><div><span style="white-space:pre-wrap"> </span>Jinbo<br><br><br><blockquote name="replyContent" class="gmail-m_-7576767151873302430ReferenceQuote" style="padding-left:5px;margin-left:5px;border-left:2px solid rgb(182,182,182);margin-right:0px">-----原始邮件-----<br>
<b>发件人:</b><span id="gmail-m_-7576767151873302430rc_from">"Rick Brownrigg" <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>></span><br>
<b>发送时间:</b><span id="gmail-m_-7576767151873302430rc_senttime">2019-06-20 23:40:59 (星期四)</span><br>
<b>收件人:</b> "谢瑾博" <<a href="mailto:xiejinbo@mail.iap.ac.cn" target="_blank">xiejinbo@mail.iap.ac.cn</a>><br>
<b>抄送:</b> Ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>><br>
<b>主题:</b> Re: Re: [ncl-talk] Wonder if there is any printVarSummary() equivalent function in pynio<br><br><div dir="ltr"><div>Yes, print() works for variables too; this is from the documentation</div><div><br></div><div><a href="https://www.pyngl.ucar.edu/Nio.shtml" target="_blank">https://www.pyngl.ucar.edu/Nio.shtml</a></div><div><ul><li><h3>Print a summary of a variable in the file</h3>
<pre>print f.variables['varName']
</pre>
Here is a sample print of the variable "elev":
<pre>Variable: elev
Type: float
Total Size: 259200 bytes
64800 values
Number of Dimensions: 2
Dimensions and sizes: [lat | 180] x [lon | 360]
Coordinates:
lat: [89.5..-89.5]
lon: [0.5..359.5]
Number of Attributes: 3
units : meters
long_name : median topography
_FillValue : -99999
</pre>
</li></ul></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 19, 2019 at 12:32 PM 谢瑾博 <<a href="mailto:xiejinbo@mail.iap.ac.cn" target="_blank">xiejinbo@mail.iap.ac.cn</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Rick,<div><span style="white-space:pre-wrap"> </span>Does this work for variables inside the program? Because printVarSummary() tends to work anywhere in the program, and sometimes we may want to know the attributes after a certain processing.</div><div><span style="white-space:pre-wrap"> </span>yours,</div><div><span style="white-space:pre-wrap"> </span>Jinbo<br><br><br><blockquote name="replyContent" class="gmail-m_-7576767151873302430gmail-m_-6385138619524954470ReferenceQuote" style="padding-left:5px;margin-left:5px;border-left:2px solid rgb(182,182,182);margin-right:0px">-----原始邮件-----<br>
<b>发件人:</b><span id="gmail-m_-7576767151873302430gmail-m_-6385138619524954470rc_from">"Rick Brownrigg" <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>></span><br>
<b>发送时间:</b><span id="gmail-m_-7576767151873302430gmail-m_-6385138619524954470rc_senttime">2019-06-20 01:45:35 (星期四)</span><br>
<b>收件人:</b> "谢瑾博" <<a href="mailto:xiejinbo@mail.iap.ac.cn" target="_blank">xiejinbo@mail.iap.ac.cn</a>><br>
<b>抄送:</b> Ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>><br>
<b>主题:</b> Re: [ncl-talk] Wonder if there is any printVarSummary() equivalent function in pynio<br><br><div dir="ltr"><div>Hi,</div><div><br></div><div>I believe if you just print() the variable you get back from Nio.open_file(), it behaves like printVarSummary()</div><div><br></div><div>Rick<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 19, 2019 at 1:02 AM 谢瑾博 via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear Users,<div><span style="white-space:pre-wrap"> </span>I wonder if there is any printVarSummary() equivalent function in the pynio, this is a very handy function to print the attributes summary of the variables.</div><div><span style="white-space:pre-wrap"> </span>yours,</div><div><span style="white-space:pre-wrap"> </span>Jinbo</div>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>
</blockquote><br><span>--<br><div style="font-family:tahoma,verdana,arial,helvetica,sans-serif"><span style="font-family:Arial;white-space:pre-wrap;line-height:22px;background-color:rgb(255,252,246)">Dr</span><span style="font-family:"lucida Grande",Verdana;line-height:23px">. Jinbo Xie</span></div><div><span style="line-height:23px"><font face="lucida Grande, Verdana">State Key Laboratory of Numerical Modeling for Atmospheric Sciences and Geophysical Fluid Dynamics (LASG)</font></span></div><div style="font-family:tahoma,verdana,arial,helvetica,sans-serif"><font face="'lucida Grande', Verdana"><span style="line-height:23px">Institute of Atmospheric Physics,Chinese Academy of Sciences </span></font></div><div style="font-family:tahoma,verdana,arial,helvetica,sans-serif"><span style="font-family:"lucida Grande",Verdana;line-height:23px">e-mail: <a href="mailto:xiejinbo@mail.iap.ac.cn" target="_blank">xiejinbo@mail.iap.ac.cn</a></span></div><div id="gmail-m_-7576767151873302430gmail-m_-6385138619524954470aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown" style="font-family:tahoma,verdana,arial,helvetica,sans-serif"><span style="font-family:"lucida Grande",Verdana;line-height:23px">Tel:86-10-8299-5419(o)</span></div></span></div></blockquote></div>
</blockquote><br><span>--<br><div style="font-family:tahoma,verdana,arial,helvetica,sans-serif"><span style="font-family:Arial;white-space:pre-wrap;line-height:22px;background-color:rgb(255,252,246)">Dr</span><span style="font-family:"lucida Grande",Verdana;line-height:23px">. Jinbo Xie</span></div><div><span style="line-height:23px"><font face="lucida Grande, Verdana">State Key Laboratory of Numerical Modeling for Atmospheric Sciences and Geophysical Fluid Dynamics (LASG)</font></span></div><div style="font-family:tahoma,verdana,arial,helvetica,sans-serif"><font face="'lucida Grande', Verdana"><span style="line-height:23px">Institute of Atmospheric Physics,Chinese Academy of Sciences </span></font></div><div style="font-family:tahoma,verdana,arial,helvetica,sans-serif"><span style="font-family:"lucida Grande",Verdana;line-height:23px">e-mail: <a href="mailto:xiejinbo@mail.iap.ac.cn" target="_blank">xiejinbo@mail.iap.ac.cn</a></span></div><div id="gmail-m_-7576767151873302430aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown" style="font-family:tahoma,verdana,arial,helvetica,sans-serif"><span style="font-family:"lucida Grande",Verdana;line-height:23px">Tel:86-10-8299-5419(o)</span></div></span></div></blockquote></div>
</blockquote><br><span>--<br><div style="font-family: tahoma, verdana, arial, helvetica, sans-serif;"><span style="font-family: Arial; white-space: pre-wrap; line-height: 22px; background-color: rgb(255, 252, 246);">Dr</span><span style="font-family: "lucida Grande", Verdana; line-height: 23px;">. Jinbo Xie</span></div><div><span style="line-height: 23px;"><font face="lucida Grande, Verdana">State Key Laboratory of Numerical Modeling for Atmospheric Sciences and Geophysical Fluid Dynamics (LASG)</font></span></div><div style="font-family: tahoma, verdana, arial, helvetica, sans-serif;"><font face="'lucida Grande', Verdana"><span style="line-height: 23px;">Institute of Atmospheric Physics,Chinese Academy of Sciences </span></font></div><div style="font-family: tahoma, verdana, arial, helvetica, sans-serif;"><span style="font-family: "lucida Grande", Verdana; line-height: 23px;">e-mail: <a href="mailto:xiejinbo@mail.iap.ac.cn" target="_blank">xiejinbo@mail.iap.ac.cn</a></span></div><div id="aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown" style="font-family: tahoma, verdana, arial, helvetica, sans-serif;"><span style="font-family: "lucida Grande", Verdana; line-height: 23px;">Tel:86-10-8299-5419(o)</span></div></span>