Changeset 2128


Ignore:
Timestamp:
08/02/07 16:22:22 (12 years ago)
Author:
domlowe
Message:

fixed problems with longitude subsetting

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

Legend:

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

    r2112 r2128  
    4949            arraySize=len(subsetDomain[key].split()) 
    5050        totalArraySize = totalArraySize * arraySize 
     51    print 'SUBSET DOMAIN: %s'%subsetDomain 
    5152    return subsetDomain, totalArraySize 
    5253     
  • TI02-CSML/trunk/csml/API/ops_FileExtract.py

    r2112 r2128  
    3535        fillvalue=DI.getVariableAttribute('_FillValue') 
    3636        if kwargs: 
    37             #print 'getting data for %s'%kwargs 
     37            print 'getting data for %s'%kwargs 
    3838            data = DI.getSubsetOfDataForVar(**kwargs) 
    3939        else: 
  • TI02-CSML/trunk/csml/DDC/model/is92/cccma.cfg

    r2126 r2128  
    55[files] 
    66root: /home/users/domlowe/SVN/csml/DDC/model/is92/cccma/ 
    7 mapping: onetoseveral 
     7mapping: onetoone 
    88output: /home/users/domlowe/SVN/csml/DDC/model/is92/cccma.xml 
    99printscreen:1 
  • TI02-CSML/trunk/csml/DDC/model/is92/cccmasubset.py

    r2126 r2128  
    1818#print flist 
    1919 
     20for f in flist: 
     21    feature=csmldoc.getFeature(f) 
     22    print feature.id 
     23    print feature.description.CONTENT 
     24 
     25 
    2026#select a feature by name (gml:id) 
    2127#print '\n Selecting feature with gml:id = %s' %flist[3] 
    22 feature=csmldoc.getFeature(flist[3]) 
     28feature=csmldoc.getFeature(flist[0]) 
    2329 
    2430#feature 'bestname' 
    25 #print feature.id 
    26 #print feature.description 
     31print feature.id 
     32print feature.description 
    2733 
    2834#get the domain of the feature 
     
    3844#define a selection (based on the domain) 
    3945subsetDictionary={} 
    40 subsetDictionary['time']=('2010-1-15T0:0:0.0','2010-4-15T0:0:0.0') 
    41 subsetDictionary['latitude']=(40, 41) 
    42 subsetDictionary['longitude']=(0,4) 
     46subsetDictionary['time']=('2024-1-15T0:0:0.0','2024-8-15T0:0:0.0') 
     47subsetDictionary['latitude']=(0, 20) 
     48subsetDictionary['longitude']=(-10,10) 
    4349#request subsetted data from features (can set paths here) and add to container 
    4450#subset a feature 
    4551csmlContainer.add(feature.subsetToGridSeries(ncpath='DDC/model/is92/subsClim10_1.nc',**subsetDictionary)) 
    46 subsetDictionary['longitude']=(-1,4) 
    47 csmlContainer.add(feature.subsetToGridSeries(ncpath='DDC/model/is92/subsClim10_2.nc',**subsetDictionary)) 
     52#subsetDictionary['longitude']=(-5,6) 
     53#csmlContainer.add(feature.subsetToGridSeries(ncpath='DDC/model/is92/subsClim10_2.nc',**subsetDictionary)) 
    4854 
    4955 
  • TI02-CSML/trunk/csml/csmllibs/csmldataiface.py

    r2121 r2128  
    423423                lonMax =kwargs[lonkey][1] 
    424424                kwargs[lonkey]=(0.0, lonMax) 
    425                 sel=cdms.selectors.Selector(**kwargs) 
    426                 subset1=self.file(self.varobj.id,sel) 
     425                subset1=self.file(self.varobj.id,**kwargs) 
    427426                kwargs[lonkey]=(lonMin,359.9999) 
    428                 sel=cdms.selectors.Selector(**kwargs) 
    429                 subset2=self.file(self.varobj.id,sel) 
    430                 #concatenate arrays along longitude               
    431                 longitudeAxis=subset1.getAxisIndex(lonkey) 
    432                 subset = cdms.MV.concatenate([subset1,subset2],axis=longitudeAxis) 
     427                print 'kwargs: %s'%kwargs 
     428                try: 
     429                    subset2=self.file(self.varobj.id,**kwargs) 
     430                    longitudeAxis=subset1.getAxisIndex(lonkey) 
     431                    #concatenate arrays along longitude               
     432                    subset = cdms.MV.concatenate([subset1,subset2],axis=longitudeAxis) 
     433                except: 
     434                    subset=subset1 
    433435        if type(subset) is not cdms.tvariable.TransientVariable: 
    434             sel=cdms.selectors.Selector(**kwargs) 
    435             subset=self.file(self.varobj.id,sel) 
     436            subset=self.file(self.varobj.id,**kwargs) 
    436437        return subset 
    437438 
Note: See TracChangeset for help on using the changeset viewer.