Ignore:
Timestamp:
27/08/09 16:23:55 (11 years ago)
Author:
pnorton
Message:

Improved the legend min and max handling in the csml backend, also changed the controller slightly to pass the dimensions to the getLegendImage function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/service/imps/csml_geoplot_backend/csml_geoplot_wms_layer_slab_base.py

    r5641 r5672  
    3333        some custom rendering options. 
    3434    """ 
    35     def __init__(self, netcdf, title, crs, dimValues, transparent, bbox, renderOpts): 
    36         self._netcdf=netcdf 
     35    def __init__(self, variable, title, crs, dimValues, transparent, bbox, renderOpts): 
     36 
    3737        self.title = title 
    3838        self.crs = crs 
     
    4141        self.transparent = transparent 
    4242        self.bbox=bbox 
     43        self.variable = variable 
    4344         
    44         self.variable =  self._netcdf(self.title, squeeze=1)  
     45        self.minval = variable.min() 
     46        self.maxval = variable.max() 
    4547         
    46         self.minval = self.variable.min() 
    47         self.maxval = self.variable.max() 
    48   
    4948        #log.debug("renderOpts = %s" % (renderOpts,)) 
    5049         
     
    108107        xRange = [ lonAx.getBounds().min(), lonAx.getBounds().max()] 
    109108        yRange = [ latAx.getBounds().min(), latAx.getBounds().max()] 
    110         log.debug("xLimits = %s" % (xLimits,)) 
    111         log.debug("yLimits = %s" % (yLimits,)) 
    112         log.debug("xRange = %s" % (xRange,)) 
    113         log.debug("yRange = %s" % (yRange,)) 
     109#        log.debug("xLimits = %s" % (xLimits,)) 
     110#        log.debug("yLimits = %s" % (yLimits,)) 
     111#        log.debug("xRange = %s" % (xRange,)) 
     112#        log.debug("yRange = %s" % (yRange,)) 
    114113         
    115114        xRange = self._fixLongitudeRange(xLimits, xRange) 
     
    139138                range180to360 = True 
    140139         
    141         log.debug("range180to360 = %s, range_180to0 = %s" % (range180to360, range_180to0,)) 
     140#        log.debug("range180to360 = %s, range_180to0 = %s" % (range180to360, range_180to0,)) 
    142141        assert not (range_180to0 and range180to360), "confusing bounds found on longitude range %s " % (xLimits,) 
    143142         
     
    157156                    break 
    158157                 
    159         log.debug("returnRange = %s" % (returnRange,)) 
     158#        log.debug("returnRange = %s" % (returnRange,)) 
    160159        return returnRange 
    161160         
Note: See TracChangeset for help on using the changeset viewer.