Re: two files with different timesteps

From: Erik Noble <enoble_at_nyahnyahspammersnyahnyah>
Date: Fri, 01 Feb 2008 17:14:46 -0500

Hi.
Disregard my previous question. Due to an answer form an earlier post, I see
that I can can get around this by creating 2 separate new arrays before
entering the do loops and comparing them after.
Thanks.
-Erik

On 2/1/08 5:04 PM, "Erik Noble" <enoble_at_giss.nasa.gov> wrote:

> Hi.
>
> Are there any examples of reading in two different files that require
> their own loops for purposes of comparing a common variable between
> them?
> I am trying to read in one file "a" , which is a big file that has
> many timesteps (4 x daily). The other," b," is many files each with
> one timestep that corresponds with the time period of "a" (except 8 x
> daily).
> Could anyone offer a suggestion?
>
> Thank you in advance.
> Sincerely,
> Erik
>
> Here is the first loop:
>
> diri1 ="/Volumes/Data_and_Models/Model-Output/Athena/"
> ifile1 ="WRF-SOP3_Athena_3_1_2.nc"
> a=addfile(diri1+ifile1,"r")
> ; What times and how many time steps are in the data set?
> times = wrf_user_list_times(a) ; get times in the file
> ntimes = dimsizes(times) ; number of times in the file
>
> do it = 4, ntimes-1, 8 ; TIME LOOP of "a"
> ; GET VARIABLE
> v = wrf_user_getvar(a, "va",it) ; grid point variable
>
>
>
>
> Here is the second loop:
>
> DATADir = "/Volumes/Data_and_Models/NAMA-SOP3/" ; path to your
> data - must have trailing "/"
> FILES = systemfunc ("csh -c ' ls " + DATADir + "met_em.d01.2006* '")
> ; root of data file you want to plot
> numFILES = dimsizes(FILES)
> ;Create a loop out of how many files exist in the directory
> do ifil = 2, numFILES-1,4 ; Time loop of "b"
> b = addfile(FILES(ifil)+".nc","r")
> ; GET VARIABLE
> v700 = a->VV(0,10,1::,:)
> _______________________________________________
> 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 Fri Feb 01 2008 - 15:14:46 MST

This archive was generated by hypermail 2.2.0 : Mon Feb 04 2008 - 10:52:23 MST