Changeset 218 in lmdz_wrf for trunk


Ignore:
Timestamp:
Jan 14, 2015, 5:28:41 PM (10 years ago)
Author:
lfita
Message:

Committing without knowing what's new!? brbrbrbrbrb

Location:
trunk/tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing.py

    r204 r218  
    14791479    draw_lines(ncfilens, values, varname):
    14801480      ncfilens= [filen] ',' separated list of netCDF files
    1481       values= [dimvname]:[valuesaxis]:[dimtit]:[leglabels]:[vtit]:[title]:[graphk]
     1481      values= [dimvname]:[valuesaxis]:[dimtit]:[leglabels]:[vtit]:[title]:[locleg]:[graphk]
    14821482        [dimvname]: name of the variable with he values of the common dimension
    14831483        [valuesaxis]: which axis will be used for the values ('x', or 'y')
     
    14861486        [vartit]: name of the variable in the graph
    14871487        [title]: title of the plot ('|' for spaces)
     1488        [locleg]: location of the legend (-1, autmoatic)
     1489          1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',
     1490          5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center',
     1491          9: 'upper center', 10: 'center'
    14881492        [graphk]: kind of the graphic
    14891493      varname= variable to plot
     
    14981502        quit()
    14991503
    1500     expectargs = '[dimvname]:[valuesaxis]:[dimtit]:[leglabels]:[vtit]:[title]:[graphk]'
     1504    expectargs = '[dimvname]:[valuesaxis]:[dimtit]:[leglabels]:[vtit]:[title]:[locleg]:[graphk]'
    15011505    drw.check_arguments(fname,len(expectargs.split(':')),values,':',expectargs)
    15021506
  • trunk/tools/drawing_tools.py

    r208 r218  
    34663466                        y[i,:] = dimyv
    34673467
    3468     plt.rc('text', usetex=True)
     3468#    plt.rc('text', usetex=True)
    34693469
    34703470    plt.pcolormesh(x, y, varsv, cmap=plt.get_cmap(colorbar), vmin=vs[0], vmax=vs[1])
     
    44314431    return
    44324432
    4433 def plot_lines(vardv, varvv, vaxis, dtit, linesn, vtit, vunit, gtit, kfig):
     4433def plot_lines(vardv, varvv, vaxis, dtit, linesn, vtit, vunit, gtit, gloc, kfig):
    44344434    """ Function to plot a collection of lines
    44354435      vardv= list of set of dimension values
     
    44414441      vunit= units of the vaxis
    44424442      gtit= main title
     4443      gloc= location of the legend (-1, autmoatic)
     4444        1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',
     4445        5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center',
     4446        9: 'upper center', 10: 'center'
    44434447      kfig= kind of figure
    44444448      plot_lines([np.arange(10)], [np.sin(np.arange(10)*np.pi/2.5)], 'y', 'time (s)',      \
     
    44854489
    44864490    plt.title(graphtit)
    4487     plt.legend()
     4491    plt.legend(loc=gloc)
    44884492   
    44894493    output_kind(kfig, figname, True)
  • trunk/tools/nc_var_tools.py

    r204 r218  
    1213412134          'tex3': printed output as LaTeX table of three columns \verb+namelist_name+ & value
    1213512135          'column': printed output as namelist_name value
    12136           'dic': as python dictionary object
     12136          'dict': as two python dictionary object (namelistname, value and namelistname, sectionname)
    1213712137      namelist= namelist_like file to retrieve values
    1213812138    >>> get_namelist_vars('geogrid,dic','/home/lluis/etudes/domains/medic950116/namelist.wps')
     
    1216712167    sections = {}
    1216812168    namelistvals = {}
     12169    namelistsecs = {}
    1216912170    sectionnames = []
    1217012171    namessec = []
    1217112172    allnames = []
    1217212173    namelistvalssec = {}
     12174    namelistsecssec = {}
     12175    nmlname = ''
    1217312176    sectionname = ''
    1217412177
     
    1218212185
    1218312186            sectionname = linevals[0][1:len(linevals[0])+1]
    12184             print '    ' + fname + ": new section '" + sectionname + "' !!!"
     12187#            print '    ' + fname + ": new section '" + sectionname + "' !!!"
    1218512188            sectionnames.append(sectionname)
    1218612189            namessec = []
     12190            nmlname = ''
    1218712191        elif Nvals >= 1 and not searchInlist(commentchars,linevals[0][0:1]):
    1218812192            if Nvals >= 3 and searchInlist(valuessep,linevals[1]):
     
    1221212216                print '    line values:',linevals
    1221312217#                quit(-1)
     12218
    1221412219            namelistvals[nmlname] = nmlval
     12220            namelistsecs[nmlname] = sectionname
     12221
    1221512222            namessec.append(nmlname)
    1221612223            allnames.append(nmlname)
     
    1223012237            for nnml in sections[secname]:
    1223112238                namelistvalssec[nnml] = namelistvals[nnml]
     12239                namelistsecssec[nnml] = secname
    1223212240                if nml == nnml: namestouse.append(nml)
    1223312241    else:
    1223412242        namestouse = allnames
    1223512243        namelistvalssec = namelistvals
     12244        namelistsecssec = namelistsecs
    1223612245
    1223712246    if kout == 'tex3':
     
    1228812297        return
    1228912298    elif kout == 'dict':
    12290         return namelistvalssec
     12299        return namelistvalssec, namelistsecssec
    1229112300    else:
    1229212301        print errormsg
     
    1261612625
    1261712626#filter_2dim('80,y,x,lon,lat', 'tahiti_5m_ll.grd', 'z')
    12618 
    1261912627
    1262012628def ncreplace(values, ncfile, varn):
Note: See TracChangeset for help on using the changeset viewer.