Ignore:
Timestamp:
02/01/07 13:54:52 (13 years ago)
Author:
domlowe
Message:

changes to !subsetGridSeries

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/csml/testfiles/apicalls.py

    r1929 r1932  
    2626print feature.description 
    2727 
    28 #new style domain: 
     28#get the domain of the feature 
     29 
     30print '\n The feature has domain:'  
    2931print feature.getDomain() 
    30 sys.exit() 
    31  
    32 #get the domain of the feature 
    33 print '\n The feature has domain reference:'  
    34 print feature.getDomainReference() 
    35  
    36 #get the domain complement of the feature 
    37 print '\n The feature has domain complement :'  
    38 print feature.getDomainComplement() 
    39  
    40 #get combined domain 
    41 print '\n The feature has domain:'  
    42 #print feature.getDomain() 
    4332 
    4433#get list of allowed subsettings 
     
    4736 
    4837 
    49 #define a selection (based on the domain ref/complement) 
    50 #timeSelection=['2881-3-16T0:0:0.0', '2881-4-16T0:0:0.0', '2881-5-16T0:0:0.0', '2881-6-16T0:0:0.0', '2881-7-16T0:0:0.0', '2881-8-16T0:0:0.0', '2881-9-16T0:0:0.0'] 
    51 timeSelection=['2794-12-1T0:0:0.0', '2844-12-1T0:0:0.0'] 
    52  
    53 spatialSubsetDictionary= {} 
    54 spatialSubsetDictionary['latitude']=(-90,90) 
    55 #spatialSubsetDictionary['longitude']=(330,359) 
    56 spatialSubsetDictionary['longitude']=(-31.265,30.258) 
    57  
     38#define a selection (based on the domain) 
     39subsetDictionary={} 
     40subsetDictionary['t']=('2794-12-1T0:0:0.0', '2814-12-1T0:0:0.0') 
     41subsetDictionary['latitude']=(-90,90) 
     42subsetDictionary['longitude']=(-31.265,30.258) 
    5843#request subsetted data from features (can set paths here) and add to container 
    5944#subset a feature 
    60 csmlContainer.add(feature.subsetToGridSeries(timeSelection,  ncpath='myfile.nc',**spatialSubsetDictionary)) 
     45csmlContainer.add(feature.subsetToGridSeries(ncpath='myfile.nc',**subsetDictionary)) 
    6146#subset another feature (in fact it's the same feature again, but it proves the concept) 
    62 csmlContainer.add(feature.subsetToGridSeries(timeSelection,  ncpath='myfile2.nc',**spatialSubsetDictionary)) 
     47#csmlContainer.add(feature.subsetToGridSeries(timeSelection,  ncpath='myfile2.nc',**spatialSubsetDictionary)) 
    6348 
    6449#when you have finished, get the contents of the container 
Note: See TracChangeset for help on using the changeset viewer.