Ignore:
Timestamp:
07/03/08 12:34:02 (14 years ago)
Author:
spascoe
Message:

Uses new ows_common interface. Works with Cadcorp (at least partially).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DPPP/ukcip02_server/trunk/ukcip_server/ukcip_server/model/ukcip02.py

    r3551 r3565  
    1717log = logging.getLogger(__name__) 
    1818 
    19 log.debug('Data dir set to %s' % data_dir) 
    20  
    2119 
    2220class UKCIP02LayerMapper(ILayerMapper): 
    2321    def __init__(self): 
    24         self.dataDir = config['ukcip02.data_dir'] 
    25         log.debug('Data dir set to %s' % self.dataDir) 
     22        self.dataFile = config['ukcip02.data'] 
     23        log.debug('Input data set to set to %s' % self.dataFile) 
    2624 
    2725    def map(self, **kwargs): 
    28         g = '%s*.nc' % kwargs['pattern'] 
    29         try: 
    30             f = glob(os.path.join(self.dataDir, g))[0] 
    31         except IndexError: 
    32             raise ValueError("No matching NetCDF found") 
    33  
    34         ds = cdms.open(f) 
     26        # Ignore kwargs 
     27        ds = cdms.open(self.dataFile) 
     28         
    3529        layers = {} 
    3630        for varName in ds.listvariables(): 
     
    4135        return layers 
    4236 
    43 # We need to hard-code the bbox for now 
    44 bbox = (-200000, -200000, 695000, 1245000) 
Note: See TracChangeset for help on using the changeset viewer.