Ignore:
Timestamp:
02/03/07 13:54:04 (14 years ago)
Author:
domlowe
Message:

more on profile features

File:
1 edited

Legend:

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

    r2224 r2225  
    5454    pathToSubsetNetCDF, crs, timeName, times, strTimes, calunits, caltype, axisorder,units, fulldata, fillvalue, kwargs=self._subsetProfileSeries(csmlpath, ncpath,**kwargs)  
    5555     
     56    print crs 
     57    print timeName 
     58    print times 
     59    print strTimes 
     60    print calunits 
     61    print caltype 
     62    print axisorder 
     63    print units 
     64    print fillvalue 
     65    print kwargs   
     66    import sys 
     67     
     68     
     69    (time, lat, lon)=(crs.axes[crs.timeAxis],crs.axes[crs.latAxis], crs.axes[crs.lonAxis]) 
     70    for axis in axisorder: 
     71        if axis not in [time, lat, lon]: 
     72            #this should be the 'profile' axis 
     73            prof=self.domain[axis] 
     74     
     75     
    5676    #Okay, got the data now. Need to write CSML feature and NetCDF files. 
    5777    #Writing out the CSML feature 
    5878    # define domain/coverage  to use in 'value' attribute    
    59     newdomain=csml.parser.ProfileSeriesDomain() 
    60     domainSubset, totalArraySize=csml.API.genSubset.subsetDomain(timeName,strTimes,self.domain, **kwargs) 
    61     cTT=csml.API.genSubset.getCoordTransformTable(domainSubset, crs) 
    62     newdomain.coordTransformTable=cTT 
     79     
     80    newdomain=csml.parser.csString(prof) 
     81     
    6382    rangeSet=csml.parser.RangeSet() 
    64     rangeSet.arrayDescriptor=csml.parser.NetCDFExtract(id=self.id,fileName=csml.parser.csString(pathToSubsetNetCDF),variableName=csml.parser.csString(self.id),arraySize=csml.parser.csString(totalArraySize)) 
     83    #rangeSet.arrayDescriptor=csml.parser.NetCDFExtract(id=self.id,fileName=csml.parser.csString(pathToSubsetNetCDF),variableName=csml.parser.csString(self.id),arraySize=csml.parser.csString(totalArraySize)) 
    6584     
    6685    #gridseries coverage 
     
    87106  
    88107    ### write netcdf using NCWriter class (wraps cdms) ### 
    89     nc=csml.csmllibs.netCDFWriter.NCwriter(pathToSubsetNetCDF) 
    90     ords=cTT.gridOrdinates 
    91     axislist=[] 
    92     for a in axisorder: 
    93         axislist.append(self.gridnames[a]) 
    94     nc.genWriteVar(self.id,ords, times, calunits, caltype, axislist, units, fulldata, fillvalue) 
    95     nc.closeFinishedFile() 
     108    #nc=csml.csmllibs.netCDFWriter.NCwriter(pathToSubsetNetCDF) 
     109    #ords=None 
     110    #axislist=[] 
     111    #for a in axisorder: 
     112        #axislist.append(self.gridnames[a]) 
     113    #nc.genWriteVar(self.id,ords, times, calunits, caltype, axislist, units, fulldata, fillvalue) 
     114    #nc.closeFinishedFile() 
    96115    print 'NetCDF file written to %s'%pathToSubsetNetCDF 
    97116    return subsettedFeature, pathToSubsetNetCDF 
Note: See TracChangeset for help on using the changeset viewer.