Dear Mary,
Thanks for your reply.
My data files are very long time-series and I need a part of it only.
So, reading the whole time-series, as you have suggested in earlier email, is not a good option as my PC's memory is not supporting that!!
Is there any other way to solve the problem?
I am using ndtooned and onedtond functions afterward to rearrange the input array.
Thank you once again.
Regards,
Abhik
----- Original Message -----
From: "Mary Haley" <haley@ucar.edu>
To: "Abhik Santra" <abhiksantra@tropmet.res.in>
Cc: "ncl-talk" <ncl-talk@ucar.edu>
Sent: Monday, June 24, 2013 8:22:30 PM
Subject: Re: Error in concatenation of multiple files
On Jun 24, 2013, at 8:19 AM, Abhik Santra wrote:
> Hi,
>
> I am trying to read multiple files (12 files), each having dimensions (ntim|4018 x nlat|20 x mlon|360).
> Each file contains the data at a particular vertical level (total 12 levels).
>
> My code is the following:
>
> latS = -10.
> latN = 10.
> files = systemfunc ("ls -1rt /data/Anomaly/*.nc")
> fall = addfiles (files, "r")
> ListSetType (fall, "cat")
>
> X = fall[:]->xanom(0:4017,{latS:latN},:)
> printVarSummary(X)
>
> I should get the dimension of X as 48216 x 20 x 360.
> But the printVarSummary output for variable X is:
>
> Variable: X
> Type: float
> Total Size: 115718400 bytes
> 28929600 values
> Number of Dimensions: 3
> Dimensions and sizes: [time | 4018] x [lat | 20] x [lon | 360]
> Coordinates:
> time: [ 0.. 4017]
> lat: [-9.5.. 9.5]
> lon: [ 0.. 359]
>
> It appears that files are not merged properly so far.
> Can you please correct me if I have made any mistakes?
> Thanks in advance.
You are subscripting the leftmost (time) dimension to be 0:4017, which is why you are getting 4018 points:
> X = fall[:]->xanom(0:4017,{latS:latN},:)
Try
> X = fall[:]->xanom(:,{latS:latN},:)
>
> Regards,
> Abhik
>
> ___________________________________________
>
> Abhik Santra
> CSIR Research Fellow,
> Indian Institute of Tropical Meteorology,
> Pune - 411008.
> India
> ___________________________________________
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-- ___________________________________________ Abhik Santra CSIR Research Fellow, Indian Institute of Tropical Meteorology, Pune - 411008. India ___________________________________________ _______________________________________________ ncl-talk mailing list List instructions, subscriber options, unsubscribe: http://mailman.ucar.edu/mailman/listinfo/ncl-talkReceived on Mon Jun 24 11:49:06 2013
This archive was generated by hypermail 2.1.8 : Mon Jul 01 2013 - 12:35:42 MDT