Changeset 204 in lmdz_wrf for trunk/tools
- Timestamp:
- Dec 9, 2014, 5:30:58 PM (10 years ago)
- Location:
- trunk/tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/drawing.py
r203 r204 1578 1578 draw_lines_time(ncfilens, values, varname): 1579 1579 ncfilens= [filen] ',' separated list of netCDF files 1580 values= [dimvname];[valuesaxis];[dimtit];[leglabels];[vtit];[title];[timevals];[ graphk]1580 values= [dimvname];[valuesaxis];[dimtit];[leglabels];[vtit];[title];[timevals];[locleg];[graphk] 1581 1581 [dimvname]: name of the variable with he values of the common dimension 1582 1582 [valuesaxis]: which axis will be used for the values ('x', or 'y') … … 1596 1596 'l': milisecond 1597 1597 [tfmt]; desired format 1598 [locleg]: location of the legend (-1, autmoatic) 1599 1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right', 1600 5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center', 1601 9: 'upper center', 10: 'center' 1598 1602 [graphk]: kind of the graphic 1599 1603 varname= variable to plot 1600 values= 'time;y;time ([DD]${[HH]}$);32x32;$wss^{*}$;wss Taylor's turbulence term;time|hours!since!1949-12-01_00:00:00;exct,12,h|%d$^{%H}$; pdf'1604 values= 'time;y;time ([DD]${[HH]}$);32x32;$wss^{*}$;wss Taylor's turbulence term;time|hours!since!1949-12-01_00:00:00;exct,12,h|%d$^{%H}$;2;pdf' 1601 1605 """ 1602 1606 … … 1609 1613 1610 1614 expectargs = '[dimvname];[valuesaxis];[dimtit];[leglabels];[vtit];[title];' 1611 expectargs = expectargs + '[timevals];[ graphk]'1615 expectargs = expectargs + '[timevals];[locleg];[graphk]' 1612 1616 drw.check_arguments(fname,len(expectargs.split(';')),values,';',expectargs) 1613 1617 … … 1620 1624 title = values.split(';')[5].replace('|',' ') 1621 1625 timevals = values.split(';')[6] 1622 graphk = values.split(';')[7] 1626 locleg = int(values.split(';')[7]) 1627 graphk = values.split(';')[8] 1623 1628 1624 1629 Nfiles = len(ncfiles) … … 1702 1707 1703 1708 drw.plot_lines_time(dimvalues, varvalues, valuesaxis, dimtit, leglabels.split(','), \ 1704 vartit, varunits, timepos, timelabels, title, graphk)1709 vartit, varunits, timepos, timelabels, title, locleg, graphk) 1705 1710 1706 1711 return -
trunk/tools/drawing_tools.py
r197 r204 4461 4461 4462 4462 def plot_lines_time(vardv, varvv, vaxis, dtit, linesn, vtit, vunit, tpos, tlabs, \ 4463 gtit, kfig):4463 gtit, gloc, kfig): 4464 4464 """ Function to plot a collection of lines with a time axis 4465 4465 vardv= list of set of dimension values … … 4473 4473 tlabs= labels of the time ticks 4474 4474 gtit= main title 4475 gloc= location of the legend (-1, autmoatic) 4476 1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right', 4477 5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center', 4478 9: 'upper center', 10: 'center' 4475 4479 kfig= kind of figure 4476 4480 plot_lines([np.arange(10)], [np.sin(np.arange(10)*np.pi/2.5)], 'y', 'time (s)', \ … … 4525 4529 4526 4530 plt.title(graphtit) 4527 plt.legend( )4531 plt.legend(loc=gloc) 4528 4532 4529 4533 output_kind(kfig, figname, True) -
trunk/tools/nc_var_tools.py
r200 r204 8461 8461 newval = True 8462 8462 elif vtype == '|S1': 8463 newval = val 8464 elif vtype == 'str': 8465 print val, type(val) 8466 newval = str(val) 8463 newval = char(val) 8467 8464 else: 8468 8465 print errormsg
Note: See TracChangeset
for help on using the changeset viewer.