Changeset 5890 for qesdi


Ignore:
Timestamp:
27/10/09 12:11:03 (10 years ago)
Author:
pnorton
Message:

Fixed a problem with the subsetting in the grid_builder_lat_lon_subset.py file.

Location:
qesdi/geoplot/trunk/lib/geoplot
Files:
1 added
7 edited

Legend:

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

    r5876 r5890  
    5252        self.intervals = intervals 
    5353        self.intervalNames = intervalNames 
    54          
    55         log.debug("self.intervals = %s" % (self.intervals,)) 
    56         log.debug("self.intervalNames = %s" % (self.intervalNames,)) 
    5754         
    5855    def buildScheme(self, grid=None): 
  • qesdi/geoplot/trunk/lib/geoplot/config.ini

    r5876 r5890  
    5656drawValuesFile=False 
    5757valueFormat=%.2f 
    58 forcePcolor=False 
    5958 
    6059[PlotProperties] 
  • qesdi/geoplot/trunk/lib/geoplot/grid_builder_base.py

    r5876 r5890  
    336336 
    337337        if not self.__class__._areAxisInOrderYX(cdmsVar): 
    338             log.warning("axis are in order y,x. Swapping them.") 
     338            log.warning("axis are in order x,y. Swapping them.") 
    339339            data = data.swapaxes(0,1) 
    340                   
     340         
    341341        if missing == None: 
    342342            missing = 1e20 
  • qesdi/geoplot/trunk/lib/geoplot/grid_builder_lat_lon.py

    r5876 r5890  
    101101        """ 
    102102 
    103         import time 
    104         st = time.time() 
    105103        lon = cdmsVar.getLongitude() 
    106104        lat = cdmsVar.getLatitude() 
    107105         
    108         log.debug("lat/lon in = %s" % (time.time() - st ,)) 
    109          
    110         st = time.time() 
    111106        latBoundsMerged = GridBuilderBase._getBoundsFromAxis(lat) 
    112107        lonBoundsMerged = GridBuilderBase._getBoundsFromAxis(lon) 
    113108         
    114         log.debug("lat/lon bounds merged in = %s" % (time.time() - st ,))  
    115  
    116         st = time.time() 
    117109        gridBoundsX, gridBoundsY = N.meshgrid(lonBoundsMerged, latBoundsMerged,) 
    118         log.debug("meshed grid in = %s" % (time.time() - st ,)) 
    119110         
    120111        return (gridBoundsX, gridBoundsY) 
  • qesdi/geoplot/trunk/lib/geoplot/grid_builder_lat_lon_subset.py

    r5886 r5890  
    7575        # the bounds + midpoints for the new number of points. 
    7676         
    77         lonbounds = self._buildReducedBounds(reducedLonMidpoints, subsetVar.shape[1] + 1) 
    78         latbounds = self._buildReducedBounds(reducedLatMidpoints, subsetVar.shape[0] + 1) 
    79          
     77        if GridBuilderLatLon._areAxisInOrderYX(subsetVar): 
     78            lonbounds = self._buildReducedBounds(reducedLonMidpoints, subsetVar.shape[1] + 1) 
     79            latbounds = self._buildReducedBounds(reducedLatMidpoints, subsetVar.shape[0] + 1) 
     80        else: 
     81            lonbounds = self._buildReducedBounds(reducedLonMidpoints, subsetVar.shape[0] + 1) 
     82            latbounds = self._buildReducedBounds(reducedLatMidpoints, subsetVar.shape[1] + 1) 
     83                
    8084        lonmidpoints = geoplot.utils.getMidpoints(lonbounds) 
    8185        latmidpoints = geoplot.utils.getMidpoints(latbounds) 
  • qesdi/geoplot/trunk/lib/geoplot/layer_drawer_grid_fast.py

    r5886 r5890  
    2222                 colourBarMin=None, 
    2323                 colourBarMax=None,  
    24                  outline=False, 
    2524                 transparent=False,  
    2625                 intervals=None,  
     
    3231        self.cdmsVar = cdmsVar 
    3332        self.showGridLines = showGridLines 
    34         self.outline = outline 
    35         self._csBuilder = ColourSchemeBuilder() 
    3633        self._bgcolour = 'white' 
    3734         
  • qesdi/geoplot/trunk/lib/geoplot/tests/drawing/draw_test_grid_plot.py

    r5876 r5890  
    44import geoplot 
    55from geoplot.tests.make_data_functions import fnSinXAddCosY_10to10 
    6  
     6from geoplot.layer_drawer_grid_fast import LayerDrawerGridFast 
    77log = logging.getLogger(__name__) 
    88         
     
    4040 
    4141    #var = makeLLVar(lonBounds=xLimits, latBounds=yLimits, nx=20, ny=20) 
    42     from geoplot.legend_colour_bar import LegendColourBar 
    43     geoplot.plot_base.ColourBar = LegendColourBar 
    44     LegendColourBar.__name__ = 'ColourBar' 
    4542     
    46     var = makeLLVar(lonBounds=xLimits, latBounds=yLimits, nx=20, ny=20, function=fnSinXAddCosY_10to10, missing_value=-999) 
     43    var = makeLLVar(lonBounds=xLimits, latBounds=yLimits, nx=12, ny=50,  
     44                    function=fnSinXAddCosY_10to10, missing_value=-999, 
     45                    axisOrder='xy') 
    4746 
    4847    plot =  GridPlot(cdmsVar=var, format = plot_format, 
     
    5049                    plotTitle = "A Test Plot", showGridLines = True, 
    5150                    drawLogo = True, metadataList = eg_metadata_list, 
    52                     drawCoast = True, drawRivers = True, 
    53                     drawColourBar = True, drawValues = True, 
     51                    drawCoast = True, drawRivers = False, 
     52                    drawColourBar = True, drawValues = False, 
    5453                    xLimits=xLimits, yLimits=yLimits, 
    5554                    colourBarPosition='vertical', 
    56                     intervalColourbar=True, 
    57                      
    5855                    intervals="-10,-7.5,-5,-2.5,0,2.5,5,7.5,10", 
    5956                    #intervalNames=','.join(list('abcdefgh')) 
     
    6461    plot.drawMap(outputFile) 
    6562     
    66     log.debug('wrote %s' % outputFile)     
     63    log.debug('wrote %s' % outputFile) 
     64     
     65    outputFile = outputDir + '/layer_drawer_plot_lat_lon.' + plot_format 
     66    fld = LayerDrawerGridFast(var) 
     67    img = fld.makeImage(xLimits, yLimits, 600, 900) 
     68    img.save(outputFile) 
     69    log.debug('wrote %s' % outputFile) 
     70     
Note: See TracChangeset for help on using the changeset viewer.