Re: multiple files reading

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Jan 12 2012 - 20:09:44 MST

On Jan 11, 2012, at 3:58 AM, sk wrote:

> Hi There,
>
> I want to open several files which have an overlap period. I want to ignore the overlap period in each file.
> However, the line
> combined_var=f[:]->var(24:,:,:,:)
> ignores the spin up period only in the first file but not in the rest files in the list. Is there an easy way to do this or i should loop though the list and extract what i need and then combine the results in new variable?
>
> Regards,
> Ico

Ico,

How are the periods overlapping? I believe you will have to do it the "non-easy" way.

 - First, in order to get the all the period values, you will need to read the variable in with the default "cat" mode.

- Loop through the period variable to collect the indexes where the period values are unique.

You will have to decide which "unique" index to keep, and what to do with the data values that have the same two period values.
Do you just throw one of them away, or do you average the two, or what? If they are the same then no problem.

 - Index the array with this list of indexes to get the subset of the data you want:

  combined_var = var(iuniq,:,:,:,:)

> _______________________________________________
> 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 Thu Jan 12 20:09:56 2012

This archive was generated by hypermail 2.1.8 : Wed Jan 18 2012 - 09:21:55 MST