Changeset 2084 for TI02-CSML/trunk


Ignore:
Timestamp:
31/01/07 15:34:45 (13 years ago)
Author:
domlowe
Message:

more restructuring of subsetting code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/csml/API/ops_GridSeriesFeature.py

    r2083 r2084  
    3939    self.getDomain() 
    4040     
    41     #non-feature specific setup code: 
     41    #get the CRS from a  the  catalogue 
     42    cat=csml.csmllibs.csmlcrs.CRSCatalogue() 
     43    crs=cat.getCRS(self.value.gridSeriesDomain.srsName)   
     44     
     45    #non-feature specific setup code, mainly handles the time dimension/calendar 
    4246    pathToSubsetNetCDF, kwargs, timeName, calunits, caltype, times=csml.API.genSubset._genericSubset(self, csmlpath, ncpath, self.domain, kwargs) 
    4347       
     
    4953            print 'crs not supported' 
    5054               
     55 
     56   #get the ratio of times to files 
     57    timeToFileRatio = csml.API.genSubset._getTimeToFileRatio(self, self.domain, timeName) 
     58         
     59             
     60    #list to keep track of files that have already been fetched. eg. if multiple times are in a single file only need to get data from that file once... 
     61    filesFetched=[] 
     62         
     63    ##Get names of variables in file and relate them to the subset selection  
     64    selection={} 
     65    for gridOrd in self.value.gridSeriesDomain.coordTransformTable.gridOrdinates: 
     66        selection[gridOrd.gridAxesSpanned.CONTENT]=kwargs[gridOrd.coordAxisLabel.CONTENT] 
    5167     
    52                
    53                
     68     
    5469    self.files=[] 
    5570    strTimes='' 
    5671    fulldata=[] 
    57     
    58     timeToFileRatio = csml.API.genSubset._getTimeToFileRatio(self, self.domain, timeName) 
    59          
    6072     
    61              
    62     #to keep track of files that have already been fetched. eg. if multiple times are in a single file only need to get data from that file once... 
    63     filesFetched=[] 
    64     #get data: 
    65     selection={} 
    6673     
    67     #Get names of variables in file 
    68     cat=csml.csmllibs.csmlcrs.CRSCatalogue() 
    69     crs=cat.getCRS(self.value.gridSeriesDomain.srsName)   
    70      
    71     for gridOrd in self.value.gridSeriesDomain.coordTransformTable.gridOrdinates: 
    72         selection[gridOrd.gridAxesSpanned.CONTENT]=kwargs[gridOrd.coordAxisLabel.CONTENT] 
    73      
    74                      
    7574    for time in times: 
    7675        listPosition=self.domain[timeName].index(time) 
Note: See TracChangeset for help on using the changeset viewer.