Changeset 1259 in lmdz_wrf for trunk


Ignore:
Timestamp:
Nov 2, 2016, 9:01:59 PM (8 years ago)
Author:
lfita
Message:

Adding 'e.g.' for draw_topo_geogrid' and draw_topo_geogrid_boxes'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing.py

    r1250 r1259  
    2424## e.g. # drawing.py -o draw_2D_shad_line -f wrfout_d01_2001-11-11_00:00:00,wrfout_d01_2001-11-11_00:00:00 -S 'hus,hgt:west_east|-1,south_north|96,Time|2,bottom_top|-1:XLONG:ZNU:auto:rainbow,auto,horizontal:Srange,Srange:k,0.,4000.,auto,auto,auto,45.:vert.|sec.|hus|at|y=96|on|2001-11-11|02|UTC:png:flip@y:None:True' -v QVAPOR,HGT
    2525## e.g. # drawing.py -o draw_barbs -f wrfout_d01_2001-11-11_00:00:00 -S 'west_east|XLONG|-1,west_east_stag|XLONG|0@239@1,south_north|XLAT|15,bottom_top|ZNU|-1,bottom_top_stag|ZNW|0@39@1,Time|WRFtime|3:10@2,colormap@rainbow,7.:uw,ms-1:XLONG:ZNW:None:auto:flip@y:vertical|cross|section|wind|speed|at|y=15|on|2001-11-10|03|UTC:png:wind_barbs_2001111003_uw:True' -v U,W
     26## e.g. # drawing.py -f geo_em.d02.nc -o draw_topo_geogrid -S '0.,1500.:None:2km!domain!centered!at!SIRTA:png:cyl,i:True'
     27## e.g. # python ../drawing.py -f ~/etudes/domains/SIRTA/geo_em.d01.nc,/home/lluis/etudes/domains/SIRTA/geo_em.d02.nc -o draw_topo_geogrid_boxes -S '0.,1500.:None:WRF!domain!centered!at!SIRTA:png:cyl,i:d01$_{15k}$,d02$_{3k}$:0|10:True'
    2628## e.g. # drawing.py -f ~/etudes/domains/MEDCORDEX/geo_em.d01.nc -o draw_2D_shad_cont -S 'height,landmask:Time|0:Time|0:XLONG_M:XLAT_M:terrain:fixc,k:None:0.,3000.:0,1,10:MEDCORDEX height & landmask:pdf:False:lcc,i' -v HGT_M,LANDMASK
    2729## e.g. # drawing.py -o draw_2D_shad_line -f 'mean_dtcon-pluc-pres_lat.nc,mean_dtcon-pluc-pres_lat.nc' -S 'dtcon,prc:bottom_top|-1,south_north|-1:latmean:presmean:seismic,k:-5.,5.:monthly|dtcon|&|prc:pdf:flip@y:None:True' -v 'dtconmean,prcmean'
     
    18171819def draw_topo_geogrid_boxes(ncfiles, values):
    18181820    """ plotting different geo_em.d[nn].nc topography from WPS files
    1819     draw_topo_geogrid_boxes(ncfile, values)
     1821    draw_topo_geogrid_boxes(ncfiles, values)
    18201822      ncfiles= ',' list of geo_em.d[nn].nc files to use (fisrt as topographyc reference)
    1821       values= [minTopo],[maxTopo]:[lonlatL]:[title]:[graphic_kind]:[mapvalues]:[labels]:[legvals]
     1823      values= [minTopo],[maxTopo]:[lonlatL]:[title]:[graphic_kind]:[mapvalues]:[labels]:[legvals]:[close]
    18221824        [min/max]Topo: minimum and maximum values of topography to draw
    18231825        lonlatL: limits of longitudes and latitudes [lonmin, latmin, lonmax, latmax] or None
     
    18351837            * 'h', high
    18361838            * 'f', full
    1837         [legvals]=[locleg]|[fontsize]:
     1839        legvals: [locleg]|[fontsize]:
    18381840          [locleg]: location of the legend (0, autmoatic)
    18391841            1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',
     
    18411843            9: 'upper center', 10: 'center'
    18421844          [fontsize]: font size for the legend (auto for 12)
    1843         labels= labels to write in the graph
     1845        labels: labels to write in the graph ('!' for spaces)
     1846        close: Whether figure should be finished or not
    18441847    """
    18451848#    import matplotlib as mpl
     
    18531856        print draw_topo_geogrid_boxes.__doc__
    18541857        quit()
     1858
     1859    expectargs = '[minTopo],[maxTopo]:[lonlatL]:[title]:[graphic_kind]:[mapvalues]:'+\
     1860       '[labels]:[legvals]:[close]'
     1861    drw.check_arguments(fname,values,expectargs,':')
    18551862
    18561863    mintopo = np.float(values.split(':')[0].split(',')[0])
     
    18731880    mapvalues = values.split(':')[4]
    18741881    labels = values.split(':')[5]
    1875     legloc = int(values.split(':')[6])
     1882    legvals = values.split(':')[6]
     1883    close = gen.Str_Bool(values.split(':')[7])
    18761884
    18771885    ncfile = ncfiles.split(',')[0]
     
    19221930        objdomfi.close()
    19231931
     1932    # Legend
     1933    locleg, legfontsize = drw.legend_values(legvals,'|')
     1934
    19241935    drw.plot_topo_geogrid_boxes(topography, Xboxlines, Yboxlines, boxlabels,         \
    1925       objlon0, objlat0, mintopo, maxtopo, lonlatL, grtit, kindfig, mapvalues, legloc,\
    1926       True)
     1936      objlon0, objlat0, mintopo, maxtopo, lonlatL, grtit, kindfig, mapvalues, locleg,\
     1937      legfontsize, close)
    19271938
    19281939    objdomf.close()
Note: See TracChangeset for help on using the changeset viewer.