Changeset 638 in lmdz_wrf


Ignore:
Timestamp:
Sep 19, 2015, 11:04:07 AM (9 years ago)
Author:
lfita
Message:

Changing separation character to '~' in 'draw_2D_shad_time'
Starting to add `transform', function to transform the values and axes ('transpose', 'flip', ...)

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing.py

    r636 r638  
    216216    draw_2D_shad(ncfile, values, varn)
    217217      ncfile= file to use
    218       values=[vnamefs]:[dimvals]:[dimxvn]:[dimyvn]:[colorbar]:[sminv],[smaxv]:[figt]:
    219        [kindfig]:[reverse]:[timevals]:[close]
     218      values=[vnamefs]~[dimvals]~[dimxvn]~[dimyvn]~[colorbar]~[sminv],[smaxv]~[figt]~
     219       [kindfig]~[reverse]~[timevals]~[close]
    220220        [vnamefs]: Name in the figure of the variable to be shaded
    221221        [dimvals]: ',' list of [dimname]|[value] telling at which dimension of the
    222           variable a given value is required (-1, all the length)
     222          variable a given value is required (-1, all the length, [beg]@[end] for an interval)
    223223        [dimx/yvn]: name of the variables with the values of the final dimensions (x,y)
    224224        [colorbar]: name of the color bar
     
    251251           [label]; label at the graph ('!' for spaces)
    252252        [close]: should figure be closed (finished)
    253       values='dtcon:Time|-1,bottom_top|-1:presmean:time:seismic:-3.e-6,3.e-6:monthly|'
    254         'dtcon:pdf:transpose:time|hours!since!1949-12-01|exct,2,d|%d|date!([DD])|x:True
     253      values='dtcon~Time|-1,bottom_top|-1~presmean~time~seismic~-3.e-6,3.e-6~monthly|'
     254        'dtcon~pdf~transpose~time|hours!since!1949-12-01|exct,2,d|%d|date!([DD])~True
    255255      varn= [varsn] name of the variable to plot with shading
    256256    """
     
    264264    farguments = ['[vnamefs]', '[dimvals]', '[dimxvn]', '[dimyvn]', '[colorbar]',     \
    265265      '[sminv],[smaxv]', '[figt]', '[kindfig]', '[reverse]', '[timevals]', '[close]']
    266     drw.check_arguments(fname,11,values,':',farguments)
    267 
    268     vnamesfig = values.split(':')[0]
    269     dimvals= values.split(':')[1].replace('|',':')
    270     vdimxn = values.split(':')[2]
    271     vdimyn = values.split(':')[3]
    272     colbarn = values.split(':')[4]
    273     shadminmax = values.split(':')[5]
    274     figtitle = values.split(':')[6].replace('|',' ')
    275     figkind = values.split(':')[7]
    276     revals = values.split(':')[8]
    277     timevals = values.split(':')[9]
    278     close = values.split(':')[10]
     266    drw.check_arguments(fname,11,values,'~',farguments)
     267
     268    vnamesfig = values.split('~')[0]
     269    dimvals= values.split('~')[1].replace('|',':')
     270    vdimxn = values.split('~')[2]
     271    vdimyn = values.split('~')[3]
     272    colbarn = values.split('~')[4]
     273    shadminmax = values.split('~')[5]
     274    figtitle = values.split('~')[6].replace('|',' ')
     275    figkind = values.split('~')[7]
     276    revals = values.split('~')[8]
     277    timevals = values.split('~')[9]
     278    close = values.split('~')[10]
    279279
    280280    ncfiles = ncfile
  • trunk/tools/drawing_tools.py

    r637 r638  
    37213721#quit()
    37223722
     3723def transform(vals, dxv, dyv, dxt, dyt, dxl, dyl, dxtit, dytit, trans):
     3724    """ Function to transform the values and the axes
     3725      vals= values to transform
     3726      d[x/y]v= original values for the [x/y]-axis
     3727      d[x/y]t= original ticks for the [x/y]-axis
     3728      d[x/y]l= original tick-labels for the [x/y]-axis
     3729      d[x/y]tit= original titels for the [x/y]-axis
     3730      trans= '|' separated list of operations of transformation
     3731        'transpose': Transpose matrix of values (x-->y, y-->x)
     3732        'flip@[x/y]': Flip the given axis
     3733    """
     3734    fname = 'transform'
     3735
     3736    return newvals, newdxv, newdyv
     3737
    37233738def plot_2D_shadow_time(varsv,vnames,dimxv,dimyv,dimxu,dimyu,dimn,colorbar,vs,uts,   \
    37243739  vtit,kfig,reva,taxis,tpos,tlabs,ifclose):
Note: See TracChangeset for help on using the changeset viewer.