Changeset 2275 for TI02-CSML


Ignore:
Timestamp:
14/03/07 15:43:59 (13 years ago)
Author:
domlowe
Message:

unravelled grid/axis name confusion

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

Legend:

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

    r2225 r2275  
    1010    #for any non-range requests, get nearest neighbour 
    1111    #e.g if 'latitude': (11) requested, latitude=12 may be the nearest value 
     12    print 'DOMAIN' 
     13    print domain 
     14    print 'GRIDNAMES' 
     15    print gridnames 
     16    print 'KWARGS' 
     17    print kwargs 
     18    #think this has got muddled..  
     19     
    1220    for key in kwargs: 
     21    #need to skip time axis 
    1322        #handle single values 
    1423        if type(kwargs[key]) is not tuple: 
    15             if type(domain[gridnames[key]]) is not list: 
    16                 axeslist=domain[gridnames[key]].tolist() 
     24            if type(domain[Key]) is not list: 
     25                axeslist=domain[Key].tolist() 
    1726            else: 
    18                 axeslist = domain[gridnames[key]] 
     27                axeslist = domain[key] 
    1928            nearestNeighbour=csml.API.csmlutils.nudgeSingleValuesToAxisValues(kwargs[key],axeslist) 
    2029            if nearestNeighbour is not None: 
     
    2433            tmpkey=[] 
    2534            for val in kwargs[key]: 
    26                 nearestNeighbour=csml.API.csmlutils.nudgeSingleValuesToAxisValues(val, domain[gridnames[key]]) 
     35                nearestNeighbour=csml.API.csmlutils.nudgeSingleValuesToAxisValues(val, domain[key]) 
    2736                if nearestNeighbour is not None: 
    2837                    tmpkey.append(nearestNeighbour)    
     
    3948    totalArraySize=1 
    4049    for key in domain.keys(): 
    41         print key 
    4250        straxisValues='' 
    4351        if key in kwargs: 
     
    155163 
    156164def getTheData(feature, selection, times,timeName): 
     165    print selection 
     166    print times 
     167    print timeName 
     168     
    157169    #SOME OF THIS SHOULD PROBABLY BE IN THE DATA IO LAYER 
    158170    domain = feature.domain 
     
    163175    #get the ratio of times to files 
    164176    timeToFileRatio = _getTimeToFileRatio(feature, domain, timeName) 
    165     print selection 
    166177             
    167178    #list to keep track of files that have already been fetched. eg. if multiple times are in a single file only need to get data from that file once... 
     
    173184            filePos=int(float(listPosition)/timeToFileRatio) 
    174185            if filePos in filesFetched: 
    175                 continue #already got data from this file, try next time 
     186                continue #already got data from this file, try next time           
    176187            data, fillvalue, axisorder, units=comp.getData(fileposition=filePos, **selection) 
    177188            files.append(comp.fileList.fileNames.CONTENT[filePos]) #TODO, get the right file name 
     
    212223    calunits, caltype=_setCalendar(feature, timeName, gridordinates) 
    213224     
    214     #selection by time - get explcit time values, not just a range mint, maxt 
    215      
    216225    try: 
    217         timeSelection=kwargs[timeAxis] 
     226        timeSelection=kwargs[timeName] 
    218227    except KeyError: 
    219228        timeSelection=[] 
    220          
     229     
    221230    times=_getTimes(timeSelection, timeName,domain)     
    222      
    223231    return pathToSubsetNetCDF, kwargs, timeAxis,timeName, calunits, caltype, times 
  • TI02-CSML/trunk/csml/API/ops_FileExtract.py

    r2221 r2275  
    3333    #**kwargs can hold subsetting request. 
    3434    #get the right file  ##TO DO< check this is ok with FILE LIST 
     35        
     36    # TODO - cannot subset times within an individual file - no way to determine the original time crs.. 
     37     
    3538    if fileposition is not None: 
    3639        file =self.fileList.fileNames.CONTENT.split()[fileposition] 
  • TI02-CSML/trunk/csml/csmllibs/csmldataiface.py

    r2255 r2275  
    452452                        subset=subset1 
    453453        if type(subset) is not cdms.tvariable.TransientVariable: 
    454             print kwargs 
    455             #kwargs['longitude']=45 
    456454            subset=self.file(self.varobj.id,**kwargs) 
    457455        return subset 
  • TI02-CSML/trunk/csml/testfiles/gridseries/testGSconfig.cfg

    r2003 r2275  
    44 
    55[files] 
    6 root: /home/dom/Desktop/SVN/trunk/csml/testfiles/gridseries 
     6root: /home/dom/svn/trunk/csml/testfiles/gridseries 
    77mapping: onetomany 
    8 output: /home/dom/Desktop/SVN/trunk/csml/testfiles/gridseries/testout.xml 
     8output: /home/dom/svn/trunk/csml/testfiles/gridseries/testout.xml 
    99printscreen:1 
    1010 
Note: See TracChangeset for help on using the changeset viewer.