Changeset 21289


Ignore:
Timestamp:
10/19/16 04:54:26 (8 years ago)
Author:
cborstad
Message:

CHG: updating some plotdoc, changing option name for overlay_image for consistency

Location:
issm/trunk-jpl/src/m/plot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/plot/plot_overlay.py

    r21254 r21289  
    3737                raise StandardError('overlay plot not supported for 3D meshes, project on a 2D layer first')
    3838
    39         if not options.exist('geotiff_name'):
    40                 raise StandardError('overlay error: provide geotiff_name with path to geotiff file')
    41         geotiff=options.getfieldvalue('geotiff_name')
     39        if not options.exist('overlay_image'):
     40                raise StandardError('overlay error: provide overlay_image with path to geotiff file')
     41        image=options.getfieldvalue('overlay_image')
    4242
    4343        xlim=options.getfieldvalue('xlim',[min(md.mesh.x),max(md.mesh.x)])
    4444        ylim=options.getfieldvalue('ylim',[min(md.mesh.y),max(md.mesh.y)])
    4545
    46         gtif=gdal.Open(geotiff)
     46        gtif=gdal.Open(image)
    4747        trans=gtif.GetGeoTransform()
    4848        xmin=trans[0]
     
    5151        ymax=trans[3]
    5252       
    53         # allow supplied geotiff to have limits smaller than basemap or model limits
     53        # allow supplied image to have limits smaller than basemap or model limits
    5454        x0=max(min(xlim),xmin)
    5555        x1=min(max(xlim),xmax)
     
    5757        y1=min(max(ylim),ymax)
    5858        inputname='temp.tif'
    59         os.system('gdal_translate -quiet -projwin ' + str(x0) + ' ' + str(y1) + ' ' + str(x1) + ' ' + str(y0) + ' ' + geotiff + ' ' + inputname)
     59        os.system('gdal_translate -quiet -projwin ' + str(x0) + ' ' + str(y1) + ' ' + str(x1) + ' ' + str(y0) + ' ' + image+ ' ' + inputname)
    6060       
    6161        gtif=gdal.Open(inputname)
  • issm/trunk-jpl/src/m/plot/plotdoc.py

    r21283 r21289  
    7575                                                 'mask':" condition. Only 'true' values are plotted ",
    7676                                                 'log':" cutoff value for log",
    77                                                  'backgroundcolor':" plot background color. RGB tuple or standard string"}
     77                                                 'backgroundcolor':" plot background color. RGB tuple or standard string",
     78                                                 'expdisp':" path (or list of paths) to the exp file to be plotted ",
     79                                                 'explinewidth':" linewidth ",
     80                                                 'explinestyle':" matplotlib linestyle string ",
     81                                                 'explinecolor':" matplotlib color string ",
     82                                                 'expfill':" (True/False) fill a closed contour ",
     83                                                 'expfillcolor':" Color for a filled contour, only used if expfill is True ",
     84                                                 'expfillalpha':" alpha transparency for filled contour ",
     85                                                 'overlay':" True/False. Overlay a georeferenced image (radar/visible) ",
     86                                                 'overlay_image':" path to overlay image ",
     87                                                 'overlayhist':" plot a histogram of overlay image, used for setting overlaylims ",
     88                                                 'overlaylims':" normalized limits to clip and stretch contrast of overlay image (in [0,1], ex. [0.25,0.75]) ",
     89                                                 'alpha':" set transparency of plotted data (in [0,1]) "
     90                                                 }
     91
    7892        TODOoptions={'basin':" zoom on a given basin ('pineislandglacier','ronneiceshelf', use isbasin to identify a basin",
    7993                                         'figurebackgroundcolor':" figure background color. (default is 'none',",
     
    104118                                         'xticklabel':" specifiy xticklabel",
    105119                                         'yticklabel':" specifiy yticklabel",
    106                                          'overlay':" yes or no. This will overlay a radar amplitude image behind",
    107                                          'overlay_image':" path to overlay image. provide overlay_xlim, overlay_ylim, overlay_xposting and overlay_yposting options also",
    108120                                         'contrast':" (default 1) coefficient to add contrast to the radar amplitude image used in overlays",
    109121                                         'highres':" resolution of overlayed radar amplitude image (default is 0, high resolution is 1).",
     
    111123                                         'scaling':" scaling factor used by quiver plots. Default is 0.4",
    112124                                         'autoscale':" set to 'off' to have all the quivers with the same size. Default is 'on'",
    113                                          'expprint':" plot exp file on top of a data plot. provide exp file as an argument (use a cell of strings if more than one)",
    114                                          'expstyle':" marker style for expprint plot (use a cell of strings if more than one)",
    115                                          'linewidth':" line width for expprint plot (use a cell of strings if more than one)",
     125                                                                                 'linewidth':" line width for expprint plot (use a cell of strings if more than one)",
    116126                                         'border':" size of printlay border (in pixels). active only for overlay plots",
    117127
     
    165175        print("")
    166176        print("   The general look of the plot is then given by the following keywords")
    167         for key in pyoptions.keys():
     177        for key in sorted(pyoptions):
    168178                print("     - {} : {}".format(key,pyoptions[key]))
    169179        print("       any options (except 'data') can be followed by '#i' where 'i' is the subplot number, or '#all' if applied to all plots")
Note: See TracChangeset for help on using the changeset viewer.