[ncl-talk] Wonder if there is any printVarSummary() equivalent function in pynio

谢瑾博 xiejinbo at mail.iap.ac.cn
Thu Jun 20 19:01:06 MDT 2019


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?
yours,
Jinbo


-----原始邮件-----
发件人:"Rick Brownrigg" <brownrig at ucar.edu>
发送时间:2019-06-20 23:40:59 (星期四)
收件人: "谢瑾博" <xiejinbo at mail.iap.ac.cn>
抄送: Ncl-talk <ncl-talk at ucar.edu>
主题: Re: Re: [ncl-talk] Wonder if there is any printVarSummary() equivalent function in pynio


Yes, print() works for variables too;  this is from the documentation


https://www.pyngl.ucar.edu/Nio.shtml
Print a summary of a variable in the file
print f.variables['varName']

Here is a sample print of the variable "elev":
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




On Wed, Jun 19, 2019 at 12:32 PM 谢瑾博 <xiejinbo at mail.iap.ac.cn> wrote:

Hi Rick,
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.
yours,
Jinbo


-----原始邮件-----
发件人:"Rick Brownrigg" <brownrig at ucar.edu>
发送时间:2019-06-20 01:45:35 (星期四)
收件人: "谢瑾博" <xiejinbo at mail.iap.ac.cn>
抄送: Ncl-talk <ncl-talk at ucar.edu>
主题: Re: [ncl-talk] Wonder if there is any printVarSummary() equivalent function in pynio


Hi,


I believe if you just print() the variable you get back from Nio.open_file(), it behaves like printVarSummary()


Rick



On Wed, Jun 19, 2019 at 1:02 AM 谢瑾博 via ncl-talk <ncl-talk at ucar.edu> wrote:

Dear Users,
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.
yours,
Jinbo
_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk


--

Dr. Jinbo Xie
State Key Laboratory of Numerical Modeling for Atmospheric Sciences and Geophysical Fluid Dynamics (LASG)
Institute of Atmospheric Physics,Chinese Academy of Sciences 
e-mail: xiejinbo at mail.iap.ac.cn
Tel:86-10-8299-5419(o)

--

Dr. Jinbo Xie
State Key Laboratory of Numerical Modeling for Atmospheric Sciences and Geophysical Fluid Dynamics (LASG)
Institute of Atmospheric Physics,Chinese Academy of Sciences 
e-mail: xiejinbo at mail.iap.ac.cn
Tel:86-10-8299-5419(o)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190621/cba76a31/attachment.html>


More information about the ncl-talk mailing list