Re: Problem with addfiles?

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Mon Jan 25 2010 - 12:24:10 MST

Hi Bridget,

I am not sure I understand your problem completely, but one thing to
note is that when you subscript a dimension using a single value, the
dimension goes away. So something like v(0,:,:) produces a 2-D
variable. Therefore the time dimension has been removed before it gets
to the concatenation operation. To retain a single element time
dimension you should use the start:end subscripting syntax, i.e.
something like v(d:d,:,:).
  -dave

On Jan 23, 2010, at 9:32 PM, Bridget Thrasher wrote:

> They are different because the first set is 5 files of 10 years
> each, and the second set is 50 files of 1 year each. The code is in
> a loop d = 0,364 to get a single day from all 50 years. So the first
> set gets 10 records (d::365) per file, while the second gets only 1
> record (d) per file and so doesn't need the stride. The first
> concatenates the five groups of 10 records, as shown in
> printVarSummary, while the second does not, resulting in only 1
> timestep instead of 50. I can add the stride to the second set to
> see if it then concatenates, but shouldn't it work as written?
>
> On Sat, Jan 23, 2010 at 7:04 AM, Dennis Shea <shea@ucar.edu> wrote:
> concatenation is the default. do you do not need
> ListSetType(...,"cat")
>
> the 1st set of files you did:
> day_data_20c = fall20c[:]->$var$(d::365,:,:)
>
>
> the 2nd set of files you did
> sortobs = fallobs[:]->$var$(d,:,:)
>
> I think the (d,:,:) should be (d::365,:,:)
>
> sortobs = fallobs[:]->$var$(d::365,:,:)
>
> Good luck
>
> Bridget Thrasher wrote:
> I am finding some peculiar behavior when getting data from a set
> resulting from a call to addfiles. Both arrays should be the same
> size (50x180x360), but the second is not concatenating. Am I doing
> something wrong?
>
> Code snippets:
>
> fall20c = addfiles(files20c,"r") ; files20c contains 5 files, each
> with 10 years of daily data
> ListSetType(fall20c,"cat")
>
> fallobs = addfiles(filesobs,"r") ; filesobs contains 50 files, each
> with 1 year of daily data
> ListSetType(fallobs,"cat")
>
> day_data_20c = fall20c[:]->$var$(d::365,:,:)
> printVarSummary(day_data_20c)
>
> sortobs = fallobs[:]->$var$(d,:,:)
> printVarSummary(sortobs)
>
>
> Output to screen:
>
> Variable: day_data_20c
> Type: float
> Total Size: 12960000 bytes
> 3240000 values
> Number of Dimensions: 3
> Dimensions and sizes: [time | 50] x [latitude | 180] x [longitude
> | 360]
> Coordinates:
> time: [711751.5..729636.5]
> latitude: [-89.5..89.5]
> longitude: [ 0.5..359.5]
>
>
> Variable: sortobs
> Type: float
> Total Size: 259200 bytes
> 64800 values
> Number of Dimensions: 2
> Dimensions and sizes: [lat | 180] x [lon | 360]
> Coordinates:
> lat: [-89.5..89.5]
> lon: [ 0.5..359.5]
>
>
>
> --
> Bridget Thrasher, PhD
> Postdoctoral Researcher
> Climate Central
> www.climatecentral.org <http://www.climatecentral.org>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> --
> Bridget Thrasher, PhD
> Postdoctoral Researcher
> Climate Central
> www.climatecentral.org
>
>
> _______________________________________________
> 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 Mon Jan 25 12:24:22 2010

This archive was generated by hypermail 2.1.8 : Mon Feb 01 2010 - 08:05:34 MST