Changeset 673 in lmdz_wrf


Ignore:
Timestamp:
Jan 15, 2016, 4:40:14 PM (9 years ago)
Author:
lfita
Message:

Fixing a lot of errors on `draw_TimeSeires'

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing.py

    r668 r673  
    25352535    draw_timeSeries(filen, values, variable):
    25362536      filen= name of the file
    2537       values= [gvarname]:[timetit]:[tkind]:[timefmt]:[title]:[locleg]:[gkind]
     2537      values= [gvarname]:[timetit]:[tkind]:[timefmt]:[title]:[locleg]:[gkind]:[colorlines]:[pointtype]
    25382538      [gvarname]: name of the variable to appear in the graph
    25392539      [timetit]: title of the time axis (assumed x-axis, '|' for spaces)
     
    25512551        9: 'upper center', 10: 'center'
    25522552      [gkind]: kind of graphical output
     2553      [colorlines]: ',' list of colors for the lines, None for automatic, single
     2554          value all the same
     2555      [pointtype]: ',' list of type of points for the lines, None for automatic, single
     2556          value all the same
    25532557      variables= [varname],[timename] names of variable and variable with times
    25542558      draw_timeSeries('wrfout_d01_1979-12-01_00:00:00_bottom_top_B6-E6-I1_south_north_B3-E3-I1_west_east_B26-E26-I1.nc', 'dt_con:time|($[DD]^{[HH]}$):exct,12,h:$%d^{%H}$:time|evolution|at|-1|6|3|26:1:pdf', 'LDQCON,time')
     
    25632567
    25642568    expectargs = ['[gvarname]', '[timetit]', '[tkind]', '[timefmt]', '[title]',      \
    2565       '[locleg]', '[gkind]']
     2569      '[locleg]', '[gkind]', '[colorlines]', '[pointtype]']
    25662570 
    25672571    drw.check_arguments(fname,len(expectargs),values,':',expectargs)
     
    25742578    locleg = int(values.split(':')[5])
    25752579    gkind = values.split(':')[6]
     2580    colorlines = values.split(':')[7]
     2581    pointtype = values.split(':')[8]
    25762582   
    25772583    ncobj = NetCDFFile(filen, 'r')
     
    26072613    tseriesvals.append(varvals)
    26082614
     2615    if colorlines == 'None':
     2616        collines = None
     2617    else:
     2618        collines = colorlines.split(',')
     2619    if pointtype == 'None':
     2620        pttype = None
     2621    else:
     2622        pttype = pointtype.split(',')
     2623
    26092624    drw.plot_TimeSeries(tseriesvals, Spot + drw.units_lunits(gunits), tunits,        \
    26102625      'TimeSeries', gvarname, timetit, tkind, timefmt, title,      \
    2611       gvarname.replace('_','\_'), locleg, gkind)
     2626      gvarname.replace('_','\_'), locleg, gkind, collines, pttype)
    26122627
    26132628    return
    26142629
    2615 #draw_timeSeries('wrfout_d01_1979-12-01_00:00:00_bottom_top_B6-E6-I1_south_north_B3-E3-I1_west_east_B26-E26-I1.nc', 'dt_con:time|($[DD]^{[HH]}$):exct,12,h:$%d^{%H}$:time|evolution|at|-1|6|3|26:1:pdf', 'LDQCON,time')
     2630#draw_timeSeries('wrfout_d01_1979-12-01_00:00:00_bottom_top_B6-E6-I1_south_north_B3-E3-I1_west_east_B26-E26-I1.nc', 'dt_con:time|($[DD]^{[HH]}$):exct,12,h:$%d^{%H}$:time|evolution|at|-1|6|3|26:1:pdf:None:None', 'LDQCON,time')
    26162631
    26172632def draw_trajectories(trjfilens, values, observations):
  • trunk/tools/drawing_tools.py

    r668 r673  
    9696    timeT = np.zeros((3), dtype=int)
    9797
    98     print 'Lluis:',StringDT
    9998#    quit()
    10099
     
    19041903        Srefdate = txtunits[Ntxtunits - 2]
    19051904
    1906     print 'Lluis Srefdate:',Srefdate, 'txtunits:',txtunits,'units:',units
    19071905    if not trefT == -1:
    19081906#        print '  ' + fname + ': refdate with time!'
     
    20672065            day = firstTvec[2]
    20682066 
    2069             Iunits = np.mod(hour,Nunits)
     2067            Iunits = np.mod(day,Nunits)
    20702068            if np.sum(firstTvec[2:5]) > 0:
    20712069                firstTdt = dt.datetime(yr, mon, day+1, 0, 0, 0)
     
    24902488        quit()
    24912489
    2492     Nlines = len(linesn)
     2490    Nlines = len(valtimes)
    24932491# Canging line kinds every 7 lines (end of standard colors)
    24942492    linekinds = []
    24952493    if ptl is None:
    24962494        linekindsauto=['.-','x-','o-']
    2497         for ptype in range(4):
     2495        for ptype in range(3):
    24982496            for ip in range(7):
    24992497                linekinds.append(linekindsauto[ptype])
     
    25392537            if vmin < ymin: ymin = vmin
    25402538            if vmax > ymax: ymax = vmax
    2541         print il,'Lluis: ymin;',ymin,'ymax;',ymax
    25422539
    25432540    dx = np.max(Ntimes)
     
    25702567    timevals = np.arange(xmin,xmax)*1.
    25712568
    2572     print 'Lluis tunits:',tunits
    25732569    tpos, tlabels = CFtimes_plot(timevals, tunits, tkind, tformat)
    25742570
     
    25792575    plt.xticks(tpos, tlabels)
    25802576#    plt.Axes.set_xticklabels(tlabels)
     2577
    25812578
    25822579    plt.legend(loc=lloc)
     
    48034800    fname = 'dxdy_lonlatDIMS'
    48044801
    4805     print 'Lluis dd:',dd
    4806 
    48074802    slicex = []
    48084803    ipos=0
Note: See TracChangeset for help on using the changeset viewer.