1 | <HTML> |
---|
2 | <HEAD> |
---|
3 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8"/> |
---|
4 | <LINK REL="stylesheet" TYPE="text/css" HREF="../PyNCplot.css"/> |
---|
5 | </HEAD> |
---|
6 | |
---|
7 | </HEAD> |
---|
8 | <BODY> |
---|
9 | <DIV CLASS="valheader"> |
---|
10 | vector |
---|
11 | </DIV> |
---|
12 | <DIV CLASS="valimg"> |
---|
13 | Plotting a vector field |
---|
14 | <TABLE> |
---|
15 | <TR><TD><IMG WIDTH="100%" SRC="figs/winds.png"></IMG></TD> |
---|
16 | <TD><IMG WIDTH="100%" SRC="figs/winds_3dvar.png"></IMG></TD></TR> |
---|
17 | <TR><TD COLSPAN="2"><IMG WIDTH="50%" SRC="figs/winds_singlecol.png"></IMG></TD></TR> |
---|
18 | </TABLE> |
---|
19 | </DIV> |
---|
20 | <DIV CLASS="valhelp"> |
---|
21 | draw_vector(ncfile, values, varn)<BR> |
---|
22 | Function to plot wind vectors<BR> |
---|
23 | ncfile= file to use<BR> |
---|
24 | values= [dimname]|[vardimname]|[value]:[dimxyfmt]:[vecvals]:[windlabs]:[mapvalues]:[gtit]:[kindfig]:[figuren]:<BR> |
---|
25 | [closefig]<BR> |
---|
26 | 'X/Y/Z/T'|[dimname]|[vardimname]|[value]: ',', list for each basic dimension '|' separated of:<BR> |
---|
27 | [dimname]: name of the dimension in the file<BR> |
---|
28 | [vardimname]: name of the variable with the values for the dimension in the file<BR> |
---|
29 | [value]: which value of the given dimension is required:<BR> |
---|
30 | * [integer]: which value of the dimension<BR> |
---|
31 | * -1: all along the dimension<BR> |
---|
32 | * -9: last value of the dimension<BR> |
---|
33 | * [beg]:[end] slice from [beg] to [end]<BR> |
---|
34 | * NOTE, no dim name all the dimension size<BR> |
---|
35 | No value takes all the range of the dimension<BR> |
---|
36 | [dimxyfmt]=[dxs],[dxf],[Ndx],[ordx],[dys],[dyf],[Ndy],[ordy]: format of the values at each axis ('auto', for <BR> |
---|
37 | 'pretty' at both axes)<BR> |
---|
38 | [dxs]: style of x-axis ('auto' for 'pretty')<BR> |
---|
39 | 'Nfix', values computed at even 'Ndx'<BR> |
---|
40 | 'Vfix', values computed at even 'Ndx' increments<BR> |
---|
41 | 'pretty', values computed following aprox. 'Ndx' at 'pretty' intervals 2.,2.5,4,5,10)<BR> |
---|
42 | [dxf]: format of the labels at the x-axis<BR> |
---|
43 | [Ndx]: Number of ticks at the x-axis<BR> |
---|
44 | [ordx]: angle of orientation of ticks at the x-axis ('auto' for horizontal)<BR> |
---|
45 | [dys]: style of y-axis ('auto' for 'pretty')<BR> |
---|
46 | [dyf]: format of the labels at the y-axis<BR> |
---|
47 | [Ndy]: Number of ticks at the y-axis<BR> |
---|
48 | [ordy]: angle of orientation of ticks at the y-axis ('auto' for horizontal)<BR> |
---|
49 | [vecvals]= [frequency],[color],[length]<BR> |
---|
50 | [frequency]: [xfreq]@[yfreq] frequency of values allong each axis ('None', all grid points; <BR> |
---|
51 | 'auto', computed automatically to have 20 vectors along each axis)<BR> |
---|
52 | [color]: color of the vectors<BR> |
---|
53 | 'singlecol'@[colorn]: all the vectors same color ('auto': for 'red') and lengths according to wind's module<BR> |
---|
54 | 'wind'@[colorbar]@[sminv]|[smaxv]: color of the vectors according to wind speed sqrt(u^2+v^2) <BR> |
---|
55 | and given [colorbar] all vectors the same length<BR> |
---|
56 | [smin/axv]: minimum and maximum value for the shading or:<BR> |
---|
57 | 'Srange': for full range<BR> |
---|
58 | 'Saroundmean@val': for mean-xtrm,mean+xtrm where xtrm = np.min(mean-min@val,max@val-mean)<BR> |
---|
59 | 'Saroundminmax@val': for min*val,max*val<BR> |
---|
60 | 'Saroundpercentile@val': for median-xtrm,median+xtrm where xtrm = np.min(median-percentile_(val),<BR> |
---|
61 | percentile_(100-val)-median)<BR> |
---|
62 | 'Smean@val': for -xtrm,xtrm where xtrm = np.min(mean-min*@val,max*@val-mean)<BR> |
---|
63 | 'Smedian@val': for -xtrm,xtrm where xtrm = np.min(median-min@val,max@val-median)<BR> |
---|
64 | 'Spercentile@val': for -xtrm,xtrm where xtrm = np.min(median-percentile_(val),<BR> |
---|
65 | percentile_(100-val)-median) <BR> |
---|
66 | '3rdvar'@[colorbar]@[varn]@[units]@[sminv]|[smaxv]: color of the vectors according to a 3rd variable <BR> |
---|
67 | (to be added at -v) and given [colorbar] all vectors the same length<BR> |
---|
68 | [colorbar]: name of the colornbar to use<BR> |
---|
69 | [varn]: name of the variable to pick up values<BR> |
---|
70 | [units]: units of the variable<BR> |
---|
71 | [sminv]|[smaxv]: minimum and maximum value for the shading or:<BR> |
---|
72 | 'Srange': for full range<BR> |
---|
73 | 'Saroundmean@val': for mean-xtrm,mean+xtrm where xtrm = np.min(mean-min@val,max@val-mean)<BR> |
---|
74 | 'Saroundminmax@val': for min*val,max*val<BR> |
---|
75 | 'Saroundpercentile@val': for median-xtrm,median+xtrm where xtrm = np.min(median-percentile_(val),<BR> |
---|
76 | percentile_(100-val)-median)<BR> |
---|
77 | 'Smean@val': for -xtrm,xtrm where xtrm = np.min(mean-min*@val,max*@val-mean)<BR> |
---|
78 | 'Smedian@val': for -xtrm,xtrm where xtrm = np.min(median-min@val,max@val-median)<BR> |
---|
79 | 'Spercentile@val': for -xtrm,xtrm where xtrm = np.min(median-percentile_(val),<BR> |
---|
80 | percentile_(100-val)-median)<BR> |
---|
81 | [length]: length of the wind vectors ('auto', for 9)<BR> |
---|
82 | [windlabs]= [windname],[windunits]<BR> |
---|
83 | [windname]: name of the wind variable in the graph<BR> |
---|
84 | [windunits]: units of the wind variable in the graph ('None', for the value in the file)<BR> |
---|
85 | [mapvalues]= map characteristics: [proj],[res]<BR> |
---|
86 | see full documentation: http://matplotlib.org/basemap/<BR> |
---|
87 | [proj]: projection<BR> |
---|
88 | * 'cyl', cilindric<BR> |
---|
89 | * 'lcc', lambert conformal<BR> |
---|
90 | [res]: resolution:<BR> |
---|
91 | * 'c', crude<BR> |
---|
92 | * 'l', low<BR> |
---|
93 | * 'i', intermediate<BR> |
---|
94 | * 'h', high<BR> |
---|
95 | * 'f', full<BR> |
---|
96 | gtit= title of the graph ('!', for spaces)<BR> |
---|
97 | kindfig= kind of figure<BR> |
---|
98 | figuren= name of the figure<BR> |
---|
99 | closefig= whether the figure should be closed<BR> |
---|
100 | ncfile= file to use<BR> |
---|
101 | varns= [uwind],[ywind] ',' list of the name of the variables with the u-wind,y-wind component<BR> |
---|
102 | </DIV> |
---|
103 | <DIV CLASS="valins"> |
---|
104 | $ python ${pyHOME}/drawing.py -o draw_vectors -f ~/PY/wrfout_d01_1995-01-01_00:00:00 -S 'T|Time|Times|2,Y|south_north|XLAT|-1,X|west_east|XLONG|-1:auto:3@3,wind@rainbow@Srange|Srange,9:10m wind,ms-1:cyl,l:WRF!10!m!winds!on!Dec.!1st!1995!06!UTC:png:winds:yes' -v U10,V10<BR> |
---|
105 | $ python ${pyHOME}/drawing.py -o draw_vectors -f ~/PY/wrfout_d01_1995-01-01_00:00:00 -S 'T|Time|Times|2,Y|south_north|XLAT|-1,X|west_east|XLONG|-1:auto:3@3,singlecol@red,9:10m wind,ms-1:cyl,l:WRF!10!m!winds!on!Dec.!1st!1995!06!UTC:png:winds:yes' -v U10,V10<BR> |
---|
106 | $ python ${pyHOME}/drawing.py -o draw_vectors -f ~/PY/wrfout_d01_1995-01-01_00:00:00 -S 'T|Time|Times|2,Y|south_north|XLAT|-1,X|west_east|XLONG|-1:auto:3@3,3rdvar@BuPu@huss@kgkg-1@0.|0.02,9:10m wind,ms-1:cyl,l:WRF!10!m!winds!&!huss!on!Dec.!1st!1995!06!UTC:png:winds:yes' -v U10,V10,Q2<BR> |
---|
107 | </DIV> |
---|
108 | </BODY> |
---|
109 | </HTML> |
---|
110 | |
---|