Ignore:
Timestamp:
03/12/07 15:10:24 (12 years ago)
Author:
domlowe
Message:

subsetting of profileseries, pointseries retested and fixed

File:
1 edited

Legend:

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

    r2590 r3096  
    4848    #get the CRS from a  the  catalogue 
    4949    cat=csml.csmllibs.csmlcrs.CRSCatalogue() 
    50     crs=cat.getCRS(self.value.profileSeriesDomain.srsName, labels = self.value.profileSeriesDomain.axisLabels)   
     50    crs=cat.getCRS(self.value.profileSeriesDomain.srsName) 
    5151     
    5252    #non-feature specific setup code, mainly handles the time dimension/calendar 
     
    6363        except KeyError: 
    6464            allValues=tuple(self.domain[gridOrd.coordAxisLabel.CONTENT]) 
    65     strTimes, axisorder, units, fulldata, fillvalue =csml.API.genSubset.getTheData(self, selection, times, timeName) 
     65    strTimes, axisorder, units, fulldata, fillvalue =csml.API.genSubset.getTheData(self, selection, times, timeName, timeAxis) 
    6666    return pathToSubsetNetCDF, crs, timeName, times, strTimes, caltype, axisorder,units, fulldata, fillvalue, kwargs 
    6767             
     
    137137    #parameter, as before subsetting. 
    138138    param = self.parameter 
     139    stdname=param.getStandardName() 
    139140         
    140141    #create 'location' attribute: 
     
    166167    otherdims['latitude']=float(loc.CONTENT.split()[0]) 
    167168    otherdims['longitude']=float(loc.CONTENT.split()[1]) 
    168     nc.genWriteVar(self.name.CONTENT,ords, times,  caltype, axislist, units, fulldata, fillvalue, **otherdims) 
     169    nc.genWriteVar(self.name.CONTENT,ords, times,  caltype, axislist, units, stdname, fulldata, fillvalue, **otherdims) 
    169170    nc.closeFinishedFile() 
    170171    print 'NetCDF file written to %s'%pathToSubsetNetCDF 
     
    178179    elif csml.API.csmlContainer.globalContainer.OUTPUTDIR is not None: 
    179180        self.outputdir=csml.API.csmlContainer.globalContainer.OUTPUTDIR 
    180      
    181     pathToSubsetNetCDF, crs, timeName, times, strTimes, calunits, caltype, axisorder,units, fulldata, fillvalue, kwargs=self._subsetProfileSeries(**kwargs)  
    182      
    183     (time, lat, lon)=(crs.axes[crs.timeAxis],crs.axes[crs.latAxis], crs.axes[crs.lonAxis]) 
    184     print axisorder 
     181    self.ncname=ncname 
     182     
     183    pathToSubsetNetCDF, crs, timeName, times, strTimes, caltype, axisorder,units, fulldata, fillvalue, kwargs=self._subsetProfileSeries(**kwargs)     
     184    time=crs.axes[crs.timeAxis] 
     185    lon='longitude' 
     186    lat='latitude' 
    185187    for axis in axisorder: 
    186188        if axis not in [time, lat, lon]: 
     
    196198     
    197199    rangeSet=csml.parser.RangeSet() 
    198     #rangeSet.arrayDescriptor=csml.parser.NetCDFExtract(id=self.id,fileName=csml.parser.csString(pathToSubsetNetCDF),variableName=csml.parser.csString(self.id),arraySize=csml.parser.csString(totalArraySize)) 
     200    rangeSet.arrayDescriptor=csml.parser.NetCDFExtract(id=self.id,fileName=csml.parser.csString(pathToSubsetNetCDF),variableName=csml.parser.csString(self.id),arraySize=csml.parser.csString(len(times))) 
    199201     
    200202    #gridseries coverage 
     
    205207    #parameter, as before subsetting. 
    206208    param = self.parameter 
     209    stdname=param.getStandardName() 
    207210         
    208211    #create 'location' attribute: 
     
    227230    otherdims[extraName]=extraAxis 
    228231    otherdims['latitude']=float(loc.CONTENT.split()[0]) 
    229     otherdims['longitude']=float(loc.CONTENT.split()[1]) 
    230      
    231     nc.genWriteVar(self.name.CONTENT,ords, times, calunits, caltype, axislist, units, fulldata, fillvalue, **otherdims) 
     232    otherdims['longitude']=float(loc.CONTENT.split()[1])     
     233    nc.genWriteVar(self.name.CONTENT,ords, times, caltype, axislist, units, stdname,fulldata, fillvalue, **otherdims) 
    232234    nc.closeFinishedFile() 
    233235    print 'NetCDF file written to %s'%pathToSubsetNetCDF 
    234     return subsettedFeature, pathToSubsetNetCDF 
    235  
     236    return subsettedFeature, pathToSubsetNetCDF, rangeSet.arrayDescriptor 
     237 
Note: See TracChangeset for help on using the changeset viewer.