Re: problem with indexing when spanning multiple files

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri, 19 Dec 2008 16:35:48 -0700

Hi Franco,

the default most of addfiles is to *concatenate*
records over the leftmost dimension.

I think what you want is:

      ph_1 = a[:]->PH(:,1,:,:)
and, not
      ph_1 = a[:]->PH(1,:,:,:)

If the latter is what you want try
      ListSetType[f, "join"]

Good luck
D

franco.catalano_at_uniroma1.it wrote:
> Hi ncl team,
> I have found a problem with variable indexing when spanning multiple files.
> I have two big wrf output files:
> wrfout-00-09.nc which contains the first 9 hours of simulation;
> wrfout-09-18.nc which contains the subsequent 9 hours.
> I read both files with the following commands:
>
> all_files = systemfunc("ls /data/wrfout*")
> a = addfiles (all_files,"r")
>
> If I read all time instants of variable, it works fine:
>
> phb = a[:]->PH(:,:,:,:)
>
> and the dimensions of ph are correct:
>
> print(dimsizes(ph))
>
> gives me the expected output:
>
> (0) 108
> (1) 58
> (2) 99
> (3) 359
>
> If, instead, I read the same variable, but only for a specified time
> instant, let's say 1:
>
> http://www.ncl.ucar.edu
>
> the second dimension, z, is read with a dimension which is double as the
> correct one:
>
> (0) 116
> (2) 99
> (3) 359
>
> This is a serious problem when working with large datasets, since
> reading the whole variables is time and memory consuming. This could be
> avoided with a correct indexed reading.
> Thank you for your kindness.
>
> Franco Catalano
>
> ____________________________________________________
> Eng. Franco Catalano
> Ph.D. Student
>
> D.I.T.S.
> Department of Hydraulics, Transportation and Roads.
> Via Eudossiana 18, 00184 Rome
> Sapienza University of Rome.
> tel: +390644585218
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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 Dec 19 2008 - 16:35:48 MST

This archive was generated by hypermail 2.2.0 : Sat Dec 20 2008 - 12:36:21 MST