Changeset 673 in lmdz_wrf
- Timestamp:
- Jan 15, 2016, 4:40:14 PM (9 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/drawing.py
r668 r673 2535 2535 draw_timeSeries(filen, values, variable): 2536 2536 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] 2538 2538 [gvarname]: name of the variable to appear in the graph 2539 2539 [timetit]: title of the time axis (assumed x-axis, '|' for spaces) … … 2551 2551 9: 'upper center', 10: 'center' 2552 2552 [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 2553 2557 variables= [varname],[timename] names of variable and variable with times 2554 2558 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') … … 2563 2567 2564 2568 expectargs = ['[gvarname]', '[timetit]', '[tkind]', '[timefmt]', '[title]', \ 2565 '[locleg]', '[gkind]' ]2569 '[locleg]', '[gkind]', '[colorlines]', '[pointtype]'] 2566 2570 2567 2571 drw.check_arguments(fname,len(expectargs),values,':',expectargs) … … 2574 2578 locleg = int(values.split(':')[5]) 2575 2579 gkind = values.split(':')[6] 2580 colorlines = values.split(':')[7] 2581 pointtype = values.split(':')[8] 2576 2582 2577 2583 ncobj = NetCDFFile(filen, 'r') … … 2607 2613 tseriesvals.append(varvals) 2608 2614 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 2609 2624 drw.plot_TimeSeries(tseriesvals, Spot + drw.units_lunits(gunits), tunits, \ 2610 2625 'TimeSeries', gvarname, timetit, tkind, timefmt, title, \ 2611 gvarname.replace('_','\_'), locleg, gkind )2626 gvarname.replace('_','\_'), locleg, gkind, collines, pttype) 2612 2627 2613 2628 return 2614 2629 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') 2616 2631 2617 2632 def draw_trajectories(trjfilens, values, observations): -
trunk/tools/drawing_tools.py
r668 r673 96 96 timeT = np.zeros((3), dtype=int) 97 97 98 print 'Lluis:',StringDT99 98 # quit() 100 99 … … 1904 1903 Srefdate = txtunits[Ntxtunits - 2] 1905 1904 1906 print 'Lluis Srefdate:',Srefdate, 'txtunits:',txtunits,'units:',units1907 1905 if not trefT == -1: 1908 1906 # print ' ' + fname + ': refdate with time!' … … 2067 2065 day = firstTvec[2] 2068 2066 2069 Iunits = np.mod( hour,Nunits)2067 Iunits = np.mod(day,Nunits) 2070 2068 if np.sum(firstTvec[2:5]) > 0: 2071 2069 firstTdt = dt.datetime(yr, mon, day+1, 0, 0, 0) … … 2490 2488 quit() 2491 2489 2492 Nlines = len( linesn)2490 Nlines = len(valtimes) 2493 2491 # Canging line kinds every 7 lines (end of standard colors) 2494 2492 linekinds = [] 2495 2493 if ptl is None: 2496 2494 linekindsauto=['.-','x-','o-'] 2497 for ptype in range( 4):2495 for ptype in range(3): 2498 2496 for ip in range(7): 2499 2497 linekinds.append(linekindsauto[ptype]) … … 2539 2537 if vmin < ymin: ymin = vmin 2540 2538 if vmax > ymax: ymax = vmax 2541 print il,'Lluis: ymin;',ymin,'ymax;',ymax2542 2539 2543 2540 dx = np.max(Ntimes) … … 2570 2567 timevals = np.arange(xmin,xmax)*1. 2571 2568 2572 print 'Lluis tunits:',tunits2573 2569 tpos, tlabels = CFtimes_plot(timevals, tunits, tkind, tformat) 2574 2570 … … 2579 2575 plt.xticks(tpos, tlabels) 2580 2576 # plt.Axes.set_xticklabels(tlabels) 2577 2581 2578 2582 2579 plt.legend(loc=lloc) … … 4803 4800 fname = 'dxdy_lonlatDIMS' 4804 4801 4805 print 'Lluis dd:',dd4806 4807 4802 slicex = [] 4808 4803 ipos=0
Note: See TracChangeset
for help on using the changeset viewer.