Re: getfilevarnames does not work with addfiles function

From: Rick Brownrigg <brownrig_at_nyahnyahspammersnyahnyah>
Date: Fri Sep 14 2012 - 09:19:49 MDT

Hi,

getfilevarnames expects a variable of type file, whereas addfiles returns a variable of type "list" whose elements are of type "file". If you know your files are all uniformly structured, you could do something like:

    b = addfiles(….)
    vnames = getfilevarnames(b[0])

which returns the varnames for the first such file in the list.

Make sense?

Rick

On Sep 14, 2012, at 8:27 AM, Shabeh ul Hasson wrote:

> Hello everyone,
>
> the code below works fine but when i used ADDFILES function for multiple files then GETFILEVARNAMES does work and there is error of type mismatch.
>
> kindly help
>
>
> b = addfile("wrfout_d01_2008-10-21_00:00:00.nc","r")
> vnames = getfilevarnames(b)
> print(vnames)
>
> Shabeh ul Hasson,
> Scientific Officer, GCISC, NCP Complex,
> Near Quaid-i-Azam University, Islamabad
> Office# +92(51)9230226,
> Fax# +92(51)2077385
> Cell# +92-321-5033864
> http://www.gcisc.org.pk
>
> P Please don't print this e-mail unless you really need to. Thank you!
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Sep 14 09:19:57 2012

This archive was generated by hypermail 2.1.8 : Fri Sep 21 2012 - 16:22:30 MDT