Ticket #329 (closed defect: fixed)

Opened 13 years ago

Last modified 13 years ago

API needs to cope with multiple time steps in one NetCDF input file

Reported by: astephen Owned by: domlowe
Priority: required Milestone: PreBeta
Component: CSML Version:
Keywords: CSML Cc:

Description

If you scan the file:

 http://proj.badc.rl.ac.uk/ndg/browser/TI03-DataExtractor/trunk/dxs/testdata/var1.nc

Then when you try and subset it using similar calls to apicalls.py you get an error. Tracked it down to:

 http://proj.badc.rl.ac.uk/ndg/browser/TI02-CSML/tags/stable-TI02-CMSL-v0-2/parser/API/ops_GridSeriesFeature.py

69 for time in self.times: 70 listPosition=domainreft?.split().index(time) 71 strTimes= strTimes + ' ' + time 72 for comp in self.rangeSet.aggregatedArray.component: 73 data=comp.getData(fileposition=listPosition, kwargs) 74 self.files.append(comp.fileName.split()[listPosition]) 75 if fulldata ==[]: 76 fulldata = data.tolist() 77 else: 78 for item in data.tolist(): 79 fulldata.append(item)

The deepest loop is appending the whole array again even though already got it once.

Change History

comment:1 Changed 13 years ago by domlowe

  • Status changed from new to assigned

There's a more general issue here too.

In the CSML how do we relate the list of times in the rangeSet to the list of filenames? I've assumed a 1:1 relationship (time:filename) for now (which is why the above error occurs). But we need to consider what other patterns are acceptable and whether the relationship needs encoding explicity in CSML or whether we can just have a useable convention.

comment:2 Changed 13 years ago by domlowe

  • Status changed from assigned to closed
  • Resolution set to fixed

This 1:1 relationship is no longer assumed, and it should work okay in CSML 2.

Note: See TracTickets for help on using tickets.