Changeset 934 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Jun 23, 2016, 7:42:49 PM (8 years ago)
Author:
lfita
Message:

Removing `map' from 'draw_2D_shad_cont_time'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing.py

    r833 r934  
    623623    draw_2D_shad_cont(ncfile, values, varn)
    624624      ncfile= [ncfilevars],[ncfilevarc] files to use (one value, same file)
    625       values=[vnamefs]:[dimvals]:[dimvalc]:[dimxvn]:[dimyvn]:[colorbar]:[ckind]:[clabfmt]:[sminv],[smaxv]:[sminc],[smaxv],[Nlev]:[figt]:[kindfig]:[reverse]:[timevals]:[mapv]
     625      values=[vnamefs];[dimvals];[dimvalc];[dimxvn];[dimyvn];[colorbar];[ckind];[clabfmt];[sminv],[smaxv];[sminc],[smaxv],[Nlev];[figt];[kindfig];[reverse];[timevals]
    626626        [vnamefs],[vnamefc]: Name in the figure of the shaded and the contour variables
    627627        [dimvals/c]: list of [dimname]|[value] telling at which dimension of the
     
    653653           [tfmt]; desired format
    654654           [label]; label at the graph ('!' for spaces)
    655         [mapv]: map characteristics: [proj],[res]
    656           see full documentation: http://matplotlib.org/basemap/
    657           [proj]: projection
    658             * 'cyl', cilindric
    659             * 'lcc', lamvbert conformal
    660           [res]: resolution:
    661             * 'c', crude
    662             * 'l', low
    663             * 'i', intermediate
    664             * 'h', high
    665             * 'f', full
    666       valules= 'rh,ta:z|-1,x|-1:z|-1,x|-1:lat:pressure:BuPu:fixsigc,black:%d:0.,100.:195.,305.,7:Meridonal|average|of|rh|&|ta:pdf:flip@y:time!hours!since!1949/12/01|exct,5d|%d|date!([DD]):None'
     655      valules= 'rh,ta;z|-1,x|-1;z|-1,x|-1;lat;pressure;BuPu;fixsigc,black;%d;0.,100.;195.,305.,7;Meridonal|average|of|rh|&|ta;pdf;flip@y;time!hours!since!1949/12/01|exct,5d|%d|date!([DD])'
    667656      varn= [varsn],[varcn] name of the variable to plot with shading variable with contour
    668657    """
     
    674663        quit()
    675664
    676     expectargs = '[vnamefs]:[dimvals]:[dimvalc]:[dimxvn]:[dimyvn]:[colorbar]:' +     \
    677       '[ckind]:[clabfmt]:[sminv],[smaxv]:[sminc],[smaxv],[Nlev]:[figt]:[kindfig]:' + \
    678       '[reverse]:[timevals]:[mapv]'
     665    expectargs = '[vnamefs];[dimvals];[dimvalc];[dimxvn];[dimyvn];[colorbar];' +     \
     666      '[ckind];[clabfmt];[sminv],[smaxv];[sminc],[smaxv],[Nlev];[figt];[kindfig];' + \
     667      '[reverse];[timevals]'
    679668 
    680     drw.check_arguments(fname,values,expectargs,':')
    681 
    682     vnamesfig = values.split(':')[0].split(',')
    683     dimvals= values.split(':')[1].replace('|',':')
    684     dimvalc= values.split(':')[2].replace('|',':')
    685     vdimxn = values.split(':')[3]
    686     vdimyn = values.split(':')[4]
    687     colbarn = values.split(':')[5]
    688     countkind = values.split(':')[6]
    689     countlabelfmt = values.split(':')[7]
    690     shadminmax = values.split(':')[8]
    691     contlevels = values.split(':')[9]
    692     figtitle = values.split(':')[10].replace('|',' ')
    693     figkind = values.split(':')[11]
    694     revals = values.split(':')[12]
    695     timevals = values.split(':')[13]
    696     mapvalue = values.split(':')[14]
     669    drw.check_arguments(fname,values,expectargs,';')
     670
     671    vnamesfig = values.split(';')[0].split(',')
     672    dimvals= values.split(';')[1].replace('|',':')
     673    dimvalc= values.split(';')[2].replace('|',':')
     674    vdimxn = values.split(';')[3]
     675    vdimyn = values.split(';')[4]
     676    colbarn = values.split(';')[5]
     677    countkind = values.split(';')[6]
     678    countlabelfmt = values.split(';')[7]
     679    shadminmax = values.split(';')[8]
     680    contlevels = values.split(';')[9]
     681    figtitle = values.split(';')[10].replace('|',' ')
     682    figkind = values.split(';')[11]
     683    revals = values.split(';')[12]
     684    timevals = values.split(';')[13]
    697685
    698686    if2filenames = ncfile.find(',')
     
    755743    valcont, dimscont = drw.slice_variable(objvarc, dimvalc.replace(',','|'))
    756744
    757 # Dimensions names
    758 ##    print fname + ' obj dimnames: ', objvars.dimensions, dimvals, len(dimvals.split(','))
    759 ##    dimnamesv = []
    760 ##    for idd in range(len(objvars.dimensions)):
    761 ##        cutdim = False
    762 ##        for idc in range(len(dimvals.split(','))):
    763 ##            dimcutn = dimvals.split(',')[idc].split(':')[0]
    764 ##            print objvars.dimensions[idd], dimcutn
    765 ##            if objvars.dimensions[idd] == dimcutn:
    766 ##                cutdim = True
    767 ##                break
    768 ##        if not cutdim: dimnamesv.append(objvars.dimensions[idd])
    769745    dimnamesv = [vdimyn, vdimxn]
    770746
     
    813789
    814790    cutslice = []
    815     for idimn in dimsshad:
     791    for idimn in dimnvx:
    816792        found = False
    817         for dimsn in dimnvx:
     793        for dimsn in dimsshad:
    818794            if idimn == dimsn:
    819795                cutslice.append(slice(0,len(objsf.dimensions[idimn])))
    820796                found = True
    821         if not found: cutslice.append(0)
     797        if not found: cutslice.append(slice(0,len(objsf.dimensions[idimn])))
    822798
    823799    ovalaxisv = ovalaxis[tuple(cutslice)]
    824 
    825 ##    if len(ovalaxis.shape) <= 2:
    826 ##        ovalaxisv = ovalaxis[:]
    827 
    828 ##    elif len(ovalaxis.shape) == 3:
    829 ##        ovalaxisv = ovalaxis[0,:]
    830 ##    else:
    831 ##        print errormsg
    832 ##        print '  ' + fname + ': shape of dimension variable:', ovalaxis.shape,       \
    833 ##          ' not ready!!'
    834 ##        quit(-1)
    835800
    836801    if countlabelfmt == 'None':
     
    857822        print '    generating default ones: ',levels_cont
    858823
    859     if mapvalue == 'None': mapvalue = None
     824    if revals == 'None': revals = None
    860825
    861826    drw.plot_2D_shadow_contour_time(valshad, valcont, vnamesfig, ovalaxisv,         \
    862827      timevals, timepos, timelabels, ovalu, timelabel, dimt, dimnamesv, colbarn,    \
    863828      countkind, countlfmt, shading_nx, levels_cont, varunits, figtitle, figkind,   \
    864       revals, mapvalue)
     829      revals)
    865830
    866831    return
Note: See TracChangeset for help on using the changeset viewer.