Re: why the variable loses its attributes after concatenating in the time dimension?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 20 Nov 2006 08:06:05 -0700 (MST)

SUN Xuguang,

Unfortunately, the "addfiles" function does not retain metadaa
information. This is currently on our list of things to look into.

The "addfile" and "addfiles" functions are two very different
functions and return different types of variables. "addfiles" returns
a "List" type, which doesn't have the concept of being able to
retain metadata from a file.

However, you can use the "addfiles_GetVar" function to retrieve a
variable from the file and have metadata attached for you. Please see:

http://www.ncl.ucar.edu/Document/Functions/Contributed/addfiles_GetVar.shtml

--Mary

On Mon, 20 Nov 2006, Xuguang Sun wrote:

> Hi, everyone,
> Here, I've several nc files, and they are continuous
> in the time dimension.When I tried to open them by the
> following commands (suppose the variable's name is
> "pr"),
>
> files=systemfunc("ls *.nc")
> fin=addfiles(files,"r")
> ListSetType("cat")
> pr=fin[:]->pr
>
> and then printVarSummary(pr), I found that the
> attributes of pr were losing, but when I used
> pr=fin[0]->pr, the attributes were still there. So
> what's the problems? Is that the command pr=fin[:]->
> can make the attributes lose?
>
> Thanks in advance.
>
>
> SUN Xuguang
> Department of Atmospheric Sciences
> 22 Hankou Road, Nanjing University, 210093
> Nanjing, P.R.China
>
>
>
> ___________________________________________________________
> ÇÀ×¢ÑÅ»¢Ãâ·ÑÓÊÏä-3.5GÈÝÁ¿£¬20M¸½¼þ£¡
> http://cn.mail.yahoo.com
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Nov 20 2006 - 08:06:05 MST

This archive was generated by hypermail 2.2.0 : Tue Nov 28 2006 - 15:20:59 MST