Changeset 1196 for TI02-CSML


Ignore:
Timestamp:
15/06/06 15:54:26 (13 years ago)
Author:
domlowe
Message:

removing BADC_CSML_FILES directory

Location:
TI02-CSML/trunk
Files:
1 deleted
1 edited

Legend:

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

    r1186 r1196  
    77 
    88def testmethod(self): 
    9     print 'testmethod for gridseries feature' 
     9    #print 'testmethod for gridseries feature' 
    1010    return 'testmethod - gridseries' 
    1111 
     
    2121        domainref  = time 
    2222    return domainref 
    23      
     23 
    2424def getDomainComplement(self): 
    2525    #This will return a list containing one or more ordinates: 
     
    4848 
    4949 
    50          
     50 
    5151 
    5252def subsetToGridSeries(self, timeSubset,  csmlpath=None, ncpath=None,**kwargs): 
     
    6060        pathToSubsetNetCDF='temp.nc' 
    6161 
    62     domainref = getDomainReference(self)  
     62    domainref = getDomainReference(self) 
    6363    self.times=timeSubset 
    6464    self.files=[] 
     
    7676    for time in self.times: 
    7777        listPosition=domainref['t'].split().index(time) 
    78         strTimes= strTimes + ' ' + time  
    79         print self.rangeSet.aggregatedArray.component 
     78        strTimes= strTimes + ' ' + time 
     79        #print self.rangeSet.aggregatedArray.component 
    8080        for comp in self.rangeSet.aggregatedArray.component: 
    8181            data=comp.getData(fileposition=listPosition, **kwargs) 
    8282            self.files.append(comp.fileName.split()[listPosition]) 
    8383            #sys.exit() 
    84              
     84 
    8585            if fulldata ==[]: 
    8686                fulldata = data.tolist() 
    87                 print shape(fulldata) 
     87         #       print shape(fulldata) 
    8888            #    sys.exit() 
    8989            else: 
     
    9999    ### define domain and rangeSet to use for feature in csml document#### 
    100100    domain=Parser.GridSeriesDomain() 
    101     domain.domainReference=Parser.TimePositionList(timePositions=strTimes)  
     101    domain.domainReference=Parser.TimePositionList(timePositions=strTimes) 
    102102    grid=Parser.Grid() 
    103103    dc = self.getDomainComplement() 
     
    143143    ### create and write netcdf - uses scientific python#### 
    144144    ncfile=NetCDFFile(pathToSubsetNetCDF,'w') 
    145     # create the dimensions         
     145    # create the dimensions 
    146146    ncfile.createDimension ( 'time', len(self.times)) 
    147147    time_var = ncfile.createVariable ( 'time', Float, ('time',) ) 
    148148    time_var.longname = 'time' 
    149149    floatTimes=[] 
    150     print len(fulldata[0]) 
     150    #print len(fulldata[0]) 
    151151    for time in self.times: 
    152152        time=ops_AbstractFeature.__getCDtime(time).torel(calunits) 
     
    157157 
    158158    for ordinate in ordinates: 
    159         ncfile.createDimension(ordinate.definesAxis, len(ordinate.axisValues.split()))  
     159        ncfile.createDimension(ordinate.definesAxis, len(ordinate.axisValues.split())) 
    160160        item_var = ncfile.createVariable (ordinate.definesAxis, Float, (ordinate.definesAxis,) ) 
    161161        #convert to list 
     
    163163        for val in ordinate.axisValues.split(','): 
    164164            vals.append(float(val)) 
    165         print ordinate.definesAxis 
     165        #print ordinate.definesAxis 
    166166        if ordinate.definesAxis=='latitude': 
    167167            #this is just a fix till I work out what's going wrong 
    168168            vals.reverse() 
    169         print vals 
     169        #print vals 
    170170        item_var[:]=vals[:] 
    171171    #this needs reconsidering - do the shapes always match up?? 
    172     for ordinate in ordinates: 
    173         if ordinate.definesAxis in axisorder: 
    174             print axisorder 
    175             #(ordinate.definesAxis) 
    176         #print ordinate.definesAxis 
    177     #print axisorder 
    178      
    179      
     172 
     173 
     174 
    180175    if len(ordinates)==3: 
    181         #feature_var = ncfile.createVariable (self.id, Float, ('time',ordinates[1].definesAxis,ordinates[0].definesAxis,ordinates[2].definesAxis)) 
    182         feature_var = ncfile.createVariable (self.id, Float, ('time',axisorder[1],axisorder[2],axisorder[3])) 
     176        feature_var = ncfile.createVariable (self.id, 
     177Float,('time',axisorder[1],axisorder[2],axisorder[3])) 
    183178    elif len(grid.ordinates)==2: 
    184         #feature_var = ncfile.createVariable (self.id, Float, ('time',ordinates[0].definesAxis,ordinates[1].definesAxis)) 
    185         feature_var = ncfile.createVariable (self.id, Float, ('time',axisorder[1],axisorder[2])) 
    186     print shape(feature_var) 
    187     print shape(fulldata) 
    188     #print fulldata 
     179        feature_var =ncfile.createVariable (self.id, 
     180Float,('time',axisorder[1],axisorder[2])) 
    189181    feature_var[:]=fulldata[:] 
    190182    ncfile.close() 
    191  
    192     return pathToSubsetCSML, pathToSubsetNetCDF, totalArraySize 
     183    return pathToSubsetCSML,pathToSubsetNetCDF, totalArraySize 
Note: See TracChangeset for help on using the changeset viewer.