Changeset 5635 for qesdi/geoplot


Ignore:
Timestamp:
19/08/09 09:54:57 (10 years ago)
Author:
pnorton
Message:

Improved the speed of the _areBoundsParralel as it was causing some datasets to render very slowly.

File:
1 edited

Legend:

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

    r5612 r5635  
    7373            norm = matplotlib.colors.Normalize(grid.values.min(), grid.values.max())      
    7474 
    75 #        log.info("Drawing Grid") 
    76  
    77         xLimits, yLimits = self._transformLimits(limits, basemap) 
    78          
    7975        grid_mapUnits = grid.transform(basemap) 
    80          
    81          
    82          
    83          
    84                  
    85 #        log.debug("xLimits = %s" % (xLimits,)) 
    86 #        log.debug("yLimits = %s" % (yLimits,)) 
    87  
    88         #draw the grid return the quadmesh for use 
    89         sm = self._drawGridBoxes(axes, grid_mapUnits, basemap, cmap, norm) 
    90          
    91          
     76 
     77        self._drawGridBoxes(axes, grid_mapUnits, basemap, cmap, norm) 
    9278         
    9379#        log.debug("self.drawValues = %s" % (self.drawValues,)) 
     
    9783            log.debug('drawing grid values') 
    9884 
     85            xLimits, yLimits = self._transformLimits(limits, basemap) 
     86             
    9987            #draw the vlaues onto the grid 
    10088            self._drawMeshValues(axes, grid_mapUnits, xLimits, yLimits) 
     
    231219        Checks the equality to 5 significant figures. 
    232220        """ 
    233         n = 5 
    234         frmt = "%." + str(n) + "e" 
     221         
    235222        st = time.time() 
    236          
    237223        equal = True 
    238         x_first = [frmt % x for x in X[0]] 
    239224         
    240225        for i in range(1, X.shape[0]): 
    241             x_row = [frmt % x for x in X[i]] 
    242             equal = x_first == x_row 
     226             
     227            equal = N.allclose(X[0], X[i]) 
     228             
    243229            if not equal: 
    244230                break 
     
    247233         
    248234        if equal: 
    249             y_first = [frmt % y for y in Y[:,0]] 
    250235             
    251236            for i in range(1, Y.shape[1]): 
    252                 y_col = [frmt % y for y in Y[:,i]] 
    253                 equal = y_first == y_col 
     237                 
     238                equal = N.allclose( Y[:,0], Y[:,i]) 
     239                 
    254240                if not equal: 
    255241                    break 
Note: See TracChangeset for help on using the changeset viewer.