Changeset 516 for trunk/UTIL/PYTHON


Ignore:
Timestamp:
Feb 4, 2012, 1:16:59 PM (13 years ago)
Author:
aslmd
Message:

UTIL PYTHON : a few stupid tricks added. if you ask --mult 2718 you'll have a log(field). if you ask moll projection the colorbar will be horizontal and title under the colorbar. if you use -T (tile) with a 1D plot you will have individual points instead of a line.

Location:
trunk/UTIL/PYTHON
Files:
3 edited

Legend:

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

    r511 r516  
    623623    #steplon = 5.625
    624624    #zelatmax = 89.9
    625     m.drawmeridians(np.r_[-180.:180.:steplon], labels=[0,0,0,1], color=zecolor, linewidth=zelinewidth, fontsize=fontsizemer, latmax=zelatmax)
    626     m.drawparallels(np.r_[-90.:90.:step], labels=[1,0,0,0], color=zecolor, linewidth=zelinewidth, fontsize=fontsizemer, latmax=zelatmax)
     625    if char not in ["moll"]:
     626        m.drawmeridians(np.r_[-180.:180.:steplon], labels=[0,0,0,1], color=zecolor, linewidth=zelinewidth, fontsize=fontsizemer, latmax=zelatmax)
     627        m.drawparallels(np.r_[-90.:90.:step], labels=[1,0,0,0], color=zecolor, linewidth=zelinewidth, fontsize=fontsizemer, latmax=zelatmax)
    627628    if back: m.warpimage(marsmap(back),scale=0.75)
    628629            #if not back:
     
    726727             "DOWNDRAFT":    "%.0f",\
    727728             "TK":           "%.0f",\
     729             #"ZMAX_TH":      "%.0f",\
     730             #"WSTAR":        "%.0f",\
    728731             # Variables from TES ncdf format
    729732             "T_NADIR_DAY":  "%.0f",\
  • trunk/UTIL/PYTHON/myscript.py

    r507 r516  
    1515    parser.add_option('-w', '--with',   action='store',dest='var2',      type="string",  default=None,  help='variable contoured')
    1616    parser.add_option('-a', '--anomaly',action='store_true',dest='anomaly',              default=False, help='compute and plot relative anomaly in %')
    17     parser.add_option('--mult',         action='store',dest='mult',      type="float",   default=1.,    help='a multiplicative factor to plotted field')
     17    parser.add_option('--mult',         action='store',dest='mult',      type="float",   default=1.,    help='multiplicative factor to plotted field (2718=log)')
    1818    parser.add_option('-m', '--min',    action='append',dest='vmin',     type="float",   default=None,  help='bounding minimum value [min]')   
    1919    parser.add_option('-M', '--max',    action='append',dest='vmax',     type="float",   default=None,  help='bounding maximum value [max]')
  • trunk/UTIL/PYTHON/planetoplot.py

    r507 r516  
    342342           what_I_plot, error = reducefield( all_var[index_f], d4=indextime, d1=indexlon, d2=indexlat, d3=indexvert, \
    343343                                             yint=yintegral, alt=vert, anomaly=anomaly, redope=redope )
    344            what_I_plot = what_I_plot*mult
     344           if mult != 2718.:  what_I_plot = what_I_plot*mult
     345           else:              what_I_plot = np.log10(what_I_plot) ; print "log plot"
    345346       if var2:      ### what is contoured.
    346347           what_I_plot_contour, error = reducefield( all_var2[index_f], d4=indextime, d1=indexlon, d2=indexlat , d3=indexvert, \
     
    446447                        if mrate is not None: x = y  ## because swapaxes...
    447448                        #what_I_plot_frame = np.diff(what_I_plot_frame, n=1) ; x = x[1:]
    448                         if indexvert is not None or indextime is None:    plot(x,what_I_plot_frame,label=lbl)  ## regular plot
    449                         else:                                             plot(what_I_plot_frame,x,label=lbl)  ## vertical profile
     449                       
     450                        if not tile:  zeline='-'
     451                        else:         zeline=','
     452                        if indexvert is not None or indextime is None:    plot(x,what_I_plot_frame,zeline,label=lbl)  ## regular plot
     453                        else:                                             plot(what_I_plot_frame,x,zeline,label=lbl)  ## vertical profile
    450454                        if nplot > 1: legend(loc='best')
    451455                        if indextime is None and axtime is not None and xlab is None:    xlabel(axtime.upper()) ## define the right label
     
    469473                            elif mult != 1:                                        daformat = "%.1f"
    470474                            else:                                                  daformat = fmtvar(fvar.upper())
    471                             colorbar( fraction=0.05,pad=0.03,format=daformat,\
     475                            if proj in ['moll']:  zeorientation="horizontal"
     476                            else:                 zeorientation="vertical"
     477                            zecb = colorbar( fraction=0.05,pad=0.03,format=daformat,orientation=zeorientation,\
    472478                                      ticks=np.linspace(zevmin,zevmax,num=min([ticks/2+1,21])),extend='neither',spacing='proportional' )
     479                            if zeorientation == "horizontal":
     480                                zecb.ax.set_xlabel(zetitle)
     481                                zetitle=""
    473482                        if winds:
    474483                            if typefile in ['mesoapi','meso']:
Note: See TracChangeset for help on using the changeset viewer.