Changeset 2220


Ignore:
Timestamp:
01/03/07 09:38:51 (12 years ago)
Author:
domlowe
Message:

workaround for masked array bug

Location:
TI02-CSML/trunk/csml/API
Files:
3 edited

Legend:

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

    r2208 r2220  
    214214        timeSelection=[] 
    215215         
    216     times=_getTimes(timeSelection, timeName,domain) 
    217      
     216    times=_getTimes(timeSelection, timeName,domain)     
    218217     
    219218    return pathToSubsetNetCDF, kwargs, timeAxis,timeName, calunits, caltype, times 
  • TI02-CSML/trunk/csml/API/ops_FileExtract.py

    r2215 r2220  
    33import sys 
    44import Numeric 
     5import MA 
    56 
    67 
     
    1415     
    1516    def setup(self): 
    16         self.dataArray=Numeric.array(self.data) 
    17          
    18         #try:  
    19             #self.dataArray=self.data.tolist() 
    20         #except: 
    21             #self.dataArray=self.data 
     17        #print self.data 
     18        #print type(self.data) 
     19        #self.dataArray=Numeric.array(self.data) 
     20        try:  
     21            self.dataArray=Numeric.array(self.data) 
     22        except MA.MA.MAError: 
     23            self.dataArray=self.data.tolist() 
     24            self.dataArray=Numeric.array(self.dataArray) 
    2225       
    23  
     26        print  
    2427         
    2528def testmethod(self): 
     
    3437    #file position defines the position of the filename if a list of filenames exists 
    3538    #**kwargs can hold subsetting request. 
    36     #print fileposition 
    37     #print self.fileName 
    38      
    3939    #get the right file  ##TO DO< check this is ok with FILE LIST 
    4040    if fileposition is not None: 
  • TI02-CSML/trunk/csml/API/ops_GridSeriesFeature.py

    r2211 r2220  
    9797    subsettedFeature=csmlWrap.createGridSeriesFeature(value=cvg,parameter=param,featureID=self.id,description=self.description) 
    9898  
    99      
    10099    ### write netcdf using NCWriter class (wraps cdms) ### 
    101100    nc=csml.csmllibs.netCDFWriter.NCwriter(pathToSubsetNetCDF) 
     
    106105    nc.genWriteVar(self.id,ords, times, calunits, caltype, axislist, units, fulldata, fillvalue) 
    107106    nc.closeFinishedFile() 
    108      
     107    print 'NetCDF file written to %s'%pathToSubsetNetCDF 
    109108    return subsettedFeature, pathToSubsetNetCDF 
    110109     
Note: See TracChangeset for help on using the changeset viewer.