Ignore:
Timestamp:
Nov 2, 2012, 5:15:38 PM (12 years ago)
Author:
aslmd
Message:

PYTHON UTIL mcd interface. few improvements: set bounds, set better resolution for figs, address Steve remarks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/mcd/mcd.py

    r821 r827  
    8080        self.fixedlt = False
    8181        self.zonmean = False
     82        self.min2d = None
     83        self.max2d = None
     84        self.dpi = 80.
    8285
    8386    def viking1(self): self.name = "Viking 1 site. MCD v4.3 output" ; self.lat = 22.48 ; self.lon = -49.97 ; self.xdate = 97.
     
    101104        if not oneline: self.title = self.title + "\n"
    102105        if self.lats is None:  self.title = self.title + " Latitude " + str(self.lat) + "N"
    103         if self.zonmean: self.title = self.title + "Zonal mean over all longitudes."
    104         elif self.lons is None: self.title = self.title + " Longitude " + str(self.lon) + "E"
     106        if self.zonmean and self.lats is not None and self.xzs is not None:
     107            self.title = self.title + "Zonal mean over all longitudes."
     108        elif self.lons is None:
     109            self.title = self.title + " Longitude " + str(self.lon) + "E"
    105110        if self.xzs is None:   
    106111            self.vertunits()
     
    513518      # The size * the dpi gives the final image size
    514519      #   a4"x4" image * 80 dpi ==> 320x320 pixel image
    515       canvas.print_figure(figname, dpi=80)
     520      canvas.print_figure(figname, dpi=self.dpi)
    516521
    517522###################
     
    704709        ## define field. bound field.
    705710        what_I_plot = np.transpose(field)
    706         zevmin, zevmax = myplot.calculate_bounds(what_I_plot)  ## vmin=min(what_I_plot_frame), vmax=max(what_I_plot_frame))
     711        zevmin, zevmax = myplot.calculate_bounds(what_I_plot,vmin=self.min2d,vmax=self.max2d) 
    707712        what_I_plot = myplot.bounds(what_I_plot,zevmin,zevmax)
    708713        ## define contour field levels. define color palette
     
    734739      # The size * the dpi gives the final image size
    735740      #   a4"x4" image * 80 dpi ==> 320x320 pixel image
    736       canvas.print_figure(figname, dpi=80)
     741      canvas.print_figure(figname, dpi=self.dpi)
    737742
    738743    def htmlplot2d(self,tabtodo,figname="temp.png"):
     
    775780        ## define field. bound field.
    776781        what_I_plot = np.transpose(field)
    777         zevmin, zevmax = myplot.calculate_bounds(what_I_plot)  ## vmin=min(what_I_plot_frame), vmax=max(what_I_plot_frame))
     782        zevmin, zevmax = myplot.calculate_bounds(what_I_plot,vmin=self.min2d,vmax=self.max2d) 
    778783        what_I_plot = myplot.bounds(what_I_plot,zevmin,zevmax)
    779784        ## define contour field levels. define color palette
     
    806811      # The size * the dpi gives the final image size
    807812      #   a4"x4" image * 80 dpi ==> 320x320 pixel image
    808       canvas.print_figure(figname, dpi=80)
     813      canvas.print_figure(figname, dpi=self.dpi)
    809814
    810815
Note: See TracChangeset for help on using the changeset viewer.