- Timestamp:
- Nov 2, 2016, 9:01:59 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/drawing.py
r1250 r1259 24 24 ## 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 25 25 ## 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' 26 28 ## 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 27 29 ## 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' … … 1817 1819 def draw_topo_geogrid_boxes(ncfiles, values): 1818 1820 """ 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) 1820 1822 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] 1822 1824 [min/max]Topo: minimum and maximum values of topography to draw 1823 1825 lonlatL: limits of longitudes and latitudes [lonmin, latmin, lonmax, latmax] or None … … 1835 1837 * 'h', high 1836 1838 * 'f', full 1837 [legvals]=[locleg]|[fontsize]:1839 legvals: [locleg]|[fontsize]: 1838 1840 [locleg]: location of the legend (0, autmoatic) 1839 1841 1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right', … … 1841 1843 9: 'upper center', 10: 'center' 1842 1844 [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 1844 1847 """ 1845 1848 # import matplotlib as mpl … … 1853 1856 print draw_topo_geogrid_boxes.__doc__ 1854 1857 quit() 1858 1859 expectargs = '[minTopo],[maxTopo]:[lonlatL]:[title]:[graphic_kind]:[mapvalues]:'+\ 1860 '[labels]:[legvals]:[close]' 1861 drw.check_arguments(fname,values,expectargs,':') 1855 1862 1856 1863 mintopo = np.float(values.split(':')[0].split(',')[0]) … … 1873 1880 mapvalues = values.split(':')[4] 1874 1881 labels = values.split(':')[5] 1875 legloc = int(values.split(':')[6]) 1882 legvals = values.split(':')[6] 1883 close = gen.Str_Bool(values.split(':')[7]) 1876 1884 1877 1885 ncfile = ncfiles.split(',')[0] … … 1922 1930 objdomfi.close() 1923 1931 1932 # Legend 1933 locleg, legfontsize = drw.legend_values(legvals,'|') 1934 1924 1935 drw.plot_topo_geogrid_boxes(topography, Xboxlines, Yboxlines, boxlabels, \ 1925 objlon0, objlat0, mintopo, maxtopo, lonlatL, grtit, kindfig, mapvalues, l egloc,\1926 True)1936 objlon0, objlat0, mintopo, maxtopo, lonlatL, grtit, kindfig, mapvalues, locleg,\ 1937 legfontsize, close) 1927 1938 1928 1939 objdomf.close()
Note: See TracChangeset
for help on using the changeset viewer.