Changeset 2585 for TI02-CSML


Ignore:
Timestamp:
14/06/07 12:13:02 (12 years ago)
Author:
domlowe
Message:

fixing bug with single time selection

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

Legend:

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

    r2584 r2585  
    3333 
    3434 
    35 operationsMap={csml.parser.Dataset:ops_Dataset, csml.parser.FileExtract:ops_FileExtract, csml.parser.RawFileExtract: ops_RawFileExtract, csml.parser.AbstractFeature:ops_AbstractFeature, csml.parser.GridSeriesFeature:ops_GridSeriesFeature, csml.parser.GridFeature:ops_GridFeature, csml.parser.PointSeriesFeature:ops_PointSeriesFeature, csml.parser.PointSeriesFeature:ops_PointSeriesFeature} 
     35operationsMap={csml.parser.Dataset:ops_Dataset, csml.parser.FileExtract:ops_FileExtract, csml.parser.RawFileExtract: ops_RawFileExtract, csml.parser.AbstractFeature:ops_AbstractFeature, csml.parser.GridSeriesFeature:ops_GridSeriesFeature, csml.parser.GridFeature:ops_GridFeature, csml.parser.PointSeriesFeature:ops_PointSeriesFeature, csml.parser.PointSeriesFeature:ops_PointSeriesFeature,csml.parser.ProfileSeriesFeature:ops_ProfileSeriesFeature} 
    3636 
    3737 
  • TI02-CSML/trunk/csml/API/genSubset.py

    r2569 r2585  
    174174 
    175175def getTheData(feature, selection, times,timeName): 
    176      
    177176    #SOME OF THIS SHOULD PROBABLY BE IN THE DATA IO LAYER 
     177    #add time range back into the selection  
     178    if len(times)==1: 
     179        selection[timeName]=times[0] 
     180    else: 
     181         selection[timeName]=(times[0], times[len(times)-1]) 
     182 
    178183    domain = feature.domain 
    179184    value=feature.value 
  • TI02-CSML/trunk/csml/testfiles/gridseries/subset.py

    r2569 r2585  
    4343#define a selection (based on the domain) 
    4444subsetDictionary={} 
    45 subsetDictionary['time']=('2794-12-1T0:0:0.0', '2804-12-1T0:0:0.0') 
     45#subsetDictionary['time']=('2794-12-1T0:0:0.0', '2804-12-1T0:0:0.0') 
     46subsetDictionary['time']='2704-12-01T00:00:00.0' 
    4647#subsetDictionary['latitude']=(-90,60) 
    4748#subsetDictionary['longitude']=(-31.1265,30.258) 
     
    5051#request subsetted data from features (can set paths here) and add to container 
    5152#subset a feature 
    52 csmlContainer.add(feature.subsetToGridSeries(outputdir,ncname='mygridseries.nc',**subsetDictionary)) 
    5353 
    54 #subset another feature (in fact it's the same feature again, but this time subsetting to a profileseries) 
    55 subsetDictionary={} 
    56 subsetDictionary['time']=('2794-12-1T0:0:0.0','2904-12-1T0:0:0.0') 
    57 subsetDictionary['latitude']=(75) 
    58 subsetDictionary['longitude']=(45) 
     54f.subsetToGridSeries(ncname='tmp1.nc', outputdir='.', latitude=(-90, 
     55> 
     56> 90), longitude=(-180,180), time='1975-07-15T00:00:00.0') 
    5957 
    60 ##assigning profileseries feature to variable 
    61 #print 'subset grid to profileseries' 
    62 psfeature, file, descriptor =feature.subsetToProfileSeries(outputdir, ncname='myprofileseries.nc',**subsetDictionary) 
    63 csmlContainer.add([psfeature,file, descriptor]) 
     58    #csmlContainer.add(feature.subsetToGridSeries(outputdir,ncname='mygridseries.nc',**subsetDictionary)) 
     59csmlContainer.add(feature.subsetToGridSeries(outputdir,ncname='mygridseries.nc',latitude=(-90,90), longitude=(-180,180),time='2704-12-01T00:00:00.0')) 
     60 
     61##subset another feature (in fact it's the same feature again, but this time subsetting to a profileseries) 
     62#subsetDictionary={} 
     63#subsetDictionary['time']=('2794-12-1T0:0:0.0','2904-12-1T0:0:0.0') 
     64#subsetDictionary['latitude']=(75) 
     65#subsetDictionary['longitude']=(45) 
     66 
     67###assigning profileseries feature to variable 
     68##print 'subset grid to profileseries' 
     69#psfeature, file, descriptor =feature.subsetToProfileSeries(outputdir, ncname='myprofileseries.nc',**subsetDictionary) 
     70#csmlContainer.add([psfeature,file, descriptor]) 
    6471 
    6572#Now subset this New ProfileSeries feature into a Profile feature 
Note: See TracChangeset for help on using the changeset viewer.