Ignore:
Timestamp:
23/10/09 16:25:45 (10 years ago)
Author:
pnorton
Message:

Added a faster layer drawer for the grid, a new style of colour bar and colour schemes which now hold the normalisation and colour map instances.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • qesdi/geoplot/trunk/lib/geoplot/grid_builder_base.py

    r5826 r5876  
    1111#python modules 
    1212import logging 
     13import time 
    1314 
    1415#third party modules 
     
    6768#        log.debug("self.cdmsVar.shape = %s" % (self.cdmsVar.shape,)) 
    6869 
    69         xmid, ymid = self._buildGridMidpoints(self.cdmsVar) 
     70         
     71#        xmid, ymid = self._buildGridMidpoints(self.cdmsVar) 
    7072         
    7173#        log.debug("y midpoints min =[" + str(ymid.min()) + \ 
     
    7375#        log.debug("x midpoints min =[" + str(xmid.min()) + \ 
    7476#                "] max =[" + str(xmid.max()) + "]") 
    75 #         
     77 
     78        st = time.time() 
    7679        reducedVar = self._getResizedVar(xLimits, yLimits) 
    77          
    78              
     80        log.debug("Reduced variable in %ss" % (time.time() - st,)) 
     81         
     82        st = time.time()     
    7983        (gridBoundsX, gridBoundsY) = self._buildGridBounds(reducedVar) 
     84        log.debug("built bounds in %ss" % (time.time() - st,)) 
     85         
     86        st = time.time()     
    8087        (gridMidpointX, gridMidpointY) = self._buildGridMidpoints(reducedVar) 
    81  
     88        log.debug("built midpoints in %ss" % (time.time() - st,)) 
     89         
     90        st = time.time()     
    8291        gridValues = self._buildGridValues(reducedVar) 
     92        log.debug("built values in %ss" % (time.time() - st,)) 
     93         
    8394                 
    8495#        log.debug("After resize:") 
     
    97108#        log.debug("gridBoundsX.shape = %s" % (gridBoundsX.shape,)) 
    98109 
    99         return Grid(gridBoundsX, gridBoundsY, gridMidpointX, gridMidpointY, gridValues) 
     110        return Grid(gridBoundsX, gridBoundsY, gridMidpointX, gridMidpointY, gridValues, 
     111                    self.cdmsVar[:].max(), self.cdmsVar[:].min()) 
    100112 
    101113    def _getResizedVar(self, xLimits, yLimits): 
     
    324336 
    325337        if not self.__class__._areAxisInOrderYX(cdmsVar): 
     338            log.warning("axis are in order y,x. Swapping them.") 
    326339            data = data.swapaxes(0,1) 
    327340                  
Note: See TracChangeset for help on using the changeset viewer.