Changeset 440 in lmdz_wrf for trunk


Ignore:
Timestamp:
May 26, 2015, 3:46:27 PM (10 years ago)
Author:
lfita
Message:

Adding kind of statistics on the plot following trajectory

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing.py

    r422 r440  
    22442244    draw_vals_trajectories(ncfile, values, variable)
    22452245    ncfile= [ncfile] ',' list of files to use
    2246     values= [statistics]:[Tint]:[labels]@[locleg]:[gvarname]:[timetit]:[tkind]:[timefmt]:[title]:[gkind]
    2247       [statistics]: which statistics to use, from: 'center', 'min', 'max', 'mean',
     2246    values= [statisticskind]:[Tint]:[labels]@[locleg]:[gvarname]:[timetit]:[tkind]:[timefmt]:[title]:[gkind]
     2247      [statisticskind]=[statistics][kind]
     2248        [statistics]: which statistics to use, from: 'center', 'min', 'max', 'mean',
    22482249        'mean2', 'stdev'
     2250        [kind]: 'box', 'circle' statistics taking the values from a box or a circle
     2251        'trj': value following the trajectory
    22492252      [Tint]: [Tbeg]@[Tend] or None, interval of time to plot or -1 for all the times
    22502253      [labels]: ',' separated list of labels for the legend
     
    22832286        quit(-1)
    22842287
    2285     statistics = values.split(':')[0]
     2288    statisticskind = values.split(':')[0]
    22862289    Tint = values.split(':')[1]
    22872290    labels = values.split(':')[2]
     
    23182321        trjobj = NetCDFFile(trjfile, 'r')
    23192322        otim = trjobj.variables['time']
    2320         if not trjobj.variables.has_key(statistics + 'box_' + variable):
     2323        if not trjobj.variables.has_key(statisticskind + '_' + variable):
    23212324            print errormsg
    23222325            print '  ' + fname + ": file '" + trjfile + "' does not have variable '"+\
    2323               statistics + 'box_' + variable + "' !!"
     2326              statisticskind + '_' + variable + "' !!"
    23242327            quit(-1)
    2325         ovar = trjobj.variables[statistics + 'box_' + variable]
     2328        ovar = trjobj.variables[statisticskind + '_' + variable]
    23262329        dimt = otim.shape[0]
    23272330
     
    23622365
    23632366    drw.plot_TimeSeries(vartimetrjv, drw.units_lunits(gunits), tunits,               \
    2364       'val_trajectories_' + statistics, gvarname, timetit, tkind, timefmt, title,    \
     2367      'val_trajectories_' + statisticskind, gvarname, timetit, tkind, timefmt, title,\
    23652368      leglabels, locleg, gkind)
    23662369
  • trunk/tools/drawing_tools.py

    r422 r440  
    23182318    plt.xlabel(ttit)
    23192319    plt.ylabel(vtit + " (" + vunits + ")")
    2320     plt.title(tit).replace('_','\_').replace('&','\&')
     2320    plt.title(tit.replace('_','\_').replace('&','\&'))
    23212321
    23222322    figname = hfileout + '_' + vtit
Note: See TracChangeset for help on using the changeset viewer.