Ignore:
Timestamp:
19/03/07 09:51:59 (13 years ago)
Author:
domlowe
Message:

subset ProfileSeries to Profile, netcdf working

File:
1 edited

Legend:

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

    r2288 r2290  
    7171    pathToSubsetNetCDF, crs, timeName, times, strTimes, calunits, caltype, axisorder,units, fulldata, fillvalue, kwargs=self._subsetProfileSeries(csmlpath, ncpath,**kwargs)  
    7272     
    73     #print crs 
    74     #print timeName 
    75     #print times 
    76     #print strTimes 
    77     #print calunits 
    78     #print caltype 
    79     #print axisorder 
    80     #print units 
    81     #print fillvalue 
    82     #print kwargs   
    83     #import sys 
    84      
    85      
    8673    (time, lat, lon)=(crs.axes[crs.timeAxis],crs.axes[crs.latAxis], crs.axes[crs.lonAxis]) 
    8774    print axisorder 
     
    124111  
    125112    ### write netcdf using NCWriter class (wraps cdms) ### 
    126     #nc=csml.csmllibs.netCDFWriter.NCwriter(pathToSubsetNetCDF) 
    127     #ords=None 
    128     #axislist=[] 
    129     #for a in axisorder: 
    130         #axislist.append(self.gridnames[a]) 
    131     #nc.genWriteVar(self.id,ords, times, calunits, caltype, axislist, units, fulldata, fillvalue) 
    132     #nc.closeFinishedFile() 
     113    nc=csml.csmllibs.netCDFWriter.NCwriter(pathToSubsetNetCDF) 
     114    axislist=[] 
     115    for a in axisorder: 
     116        if self.gridnames.has_key(a): 
     117            axislist.append(self.gridnames[a]) 
     118        else: 
     119            axislist.append(a) 
     120    ords=None 
     121    nc.genWriteVar(self.id,ords, times, calunits, caltype, axislist, units, fulldata, fillvalue) 
     122    nc.closeFinishedFile() 
    133123    print 'NetCDF file written to %s'%pathToSubsetNetCDF 
    134124    return subsettedFeature, pathToSubsetNetCDF 
Note: See TracChangeset for help on using the changeset viewer.