Changeset 2587 for TI02-CSML


Ignore:
Timestamp:
14/06/07 14:09:37 (12 years ago)
Author:
domlowe
Message:

fixed bug where nearest neighbour search conflicted with longitude transformation

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

Legend:

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

    r2495 r2587  
    2626                if _anyitemlessthanzero(request[key]): 
    2727                    pass #no need to convert request if data is also -ve to +ve 
    28                 else: 
    29                     for val in request[key]: 
     28                else:                  
     29                    for val in request[key]:                        
    3030                        if val < 0: 
    3131                            pass 
    32                         else: 
     32                        else:         
    3333                            if kwargs[key][0] < 0: 
    3434                                kwargs[key]=(kwargs[key][0]+360,kwargs[key][1]) 
  • TI02-CSML/trunk/csml/API/genSubset.py

    r2585 r2587  
    77import Numeric 
    88 
    9 def checkNeighbours(domain, gridnames, **kwargs): 
     9def checkNeighbours(domain, **kwargs): 
    1010    #for any non-range requests, get nearest neighbour 
    1111    #e.g if 'latitude': (11) requested, latitude=12 may be the nearest value 
    12       
    1312    for key in kwargs: 
    1413    #need to skip time axis 
     
    242241    #if the request is in -ve,+ve eg (-30,30) but the data is in (0,360) need to handle this by changing the args. 
    243242    kwargs=csmlutils.fixLongitude(domain,kwargs) 
    244          
     243     
     244    #if request doesn't match domain points find nearest neighbours 
     245    kwargs=csml.API.genSubset.checkNeighbours(domain, **kwargs) 
     246     
     247     
    245248    #get the name of the time axis in the coordinate reference system 
    246249    cat=csml.csmllibs.csmlcrs.CRSCatalogue() 
  • TI02-CSML/trunk/csml/API/ops_GridSeriesFeature.py

    r2584 r2587  
    127127    self.getDomain()       
    128128     
    129     #if request doesn't match domain points find nearest neighbours 
    130     kwargs=csml.API.genSubset.checkNeighbours(self.domain, self.gridnames, **kwargs) 
    131129    #get the CRS from a  the  catalogue 
    132130    cat=csml.csmllibs.csmlcrs.CRSCatalogue() 
Note: See TracChangeset for help on using the changeset viewer.