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 | 2D shadow map |
---|
11 | </DIV> |
---|
12 | <DIV CLASS="valimg"> |
---|
13 | Plotting a 2D maksed field with shading on top of a map |
---|
14 | <IMG WIDTH="100%" SRC="figs/shad-map_convini_Case6_era5_1a.png"></IMG> |
---|
15 | </DIV> |
---|
16 | <DIV CLASS="valhelp"> |
---|
17 | draw_2Dshad_map(ncfile, values, varn)<BR> |
---|
18 | plotting a shadow field with a background map<BR> |
---|
19 | ncfile= file to use<BR> |
---|
20 | values=[vnamemap];[vnamefs];[dimvals];[dimxvn];[dimyvn];[dimxyfmt];<BR> |
---|
21 | [colorbarvals];[sminv],[smaxv];[figt];[kindfig];[mapkind];[mapv];[close]<BR> |
---|
22 | [vnamemap]: Name of the variable to be used for map<BR> |
---|
23 | [vnamefs]: Name in the figure of the variable to be shaded<BR> |
---|
24 | [dimvals]: ',' list of [dimname]|[value] telling at which dimension of the<BR> |
---|
25 | variable a given value is required:<BR> |
---|
26 | * [integer]: which value of the dimension<BR> |
---|
27 | * -1: all along the dimension<BR> |
---|
28 | * -9: last value of the dimension<BR> |
---|
29 | * [beg]@[end]@[inc] slice from [beg] to [end] every [inc]<BR> |
---|
30 | * NOTE, no dim name all the dimension size<BR> |
---|
31 | [dimx/yvn]: name of the variables with the values of the final dimensions (x,y)<BR> |
---|
32 | [dimxyfmt]=[dxs],[dxf],[Ndx],[ordx],[dys],[dyf],[Ndy],[ordx]: format of the values at each axis (or 'auto')<BR> |
---|
33 | [dxs]: style of x-axis ('auto' for 'pretty')<BR> |
---|
34 | 'Nfix', values computed at even 'Ndx'<BR> |
---|
35 | 'Vfix', values computed at even 'Ndx' increments<BR> |
---|
36 | 'pretty', values computed following aprox. 'Ndx' at 'pretty' intervals (2.,2.5,4,5,10)<BR> |
---|
37 | [dxf]: format of the labels at the x-axis ('auto' for '%5g')<BR> |
---|
38 | [Ndx]: Number of ticks at the x-axis ('auto' for 5)<BR> |
---|
39 | [ordx]: angle of orientation of ticks at the x-axis ('auto' for horizontal)<BR> |
---|
40 | [dys]: style of y-axis ('auto' for 'pretty')<BR> |
---|
41 | [dyf]: format of the labels at the y-axis ('auto' for '%5g')<BR> |
---|
42 | [Ndy]: Number of ticks at the y-axis ('auto' for 5)<BR> |
---|
43 | [ordy]: angle of orientation of ticks at the y-axis ('auto' for horizontal)<BR> |
---|
44 | [colorbarvals]=[colbarn]#[fmtcolorbar]#[orientation]#[colorbarticks]<BR> |
---|
45 | [colorbarn]: name of the color bar for the values to plot<BR> |
---|
46 | [fmtcolorbar]: format of the numbers in the color bar 'C'-like ('auto' for %6g)<BR> |
---|
47 | [orientation]: orientation of the colorbar ('vertical' (default, by 'auto'), 'horizontal')<BR> |
---|
48 | [colorbarticks]: kind of colorbarticks<BR> |
---|
49 | 'direct': direct values<BR> |
---|
50 | 'time'@[units]|[kind]|[tfmt]|[label] time labels characteristics<BR> |
---|
51 | [units]: units string according to CF conventions ([tunits] since <BR> |
---|
52 | [YYYY]-[MM]-[DD] [[HH]:[MI]:[SS]], '!' for spaces), <BR> |
---|
53 | 'auto' for minutes!since!1949-12-01!00:00:00<BR> |
---|
54 | [kind]: kind of output<BR> |
---|
55 | 'Nval': according to a given number of values as 'Nval',[Nval]<BR> |
---|
56 | 'exct': according to an exact time unit as 'exct',[tunit]; <BR> |
---|
57 | tunit= [Nunits],[tu]; [tu]= 'c': centuries, 'y': year, 'm': month,<BR> |
---|
58 | 'w': week, 'd': day, 'h': hour, 'i': minute, 's': second, <BR> |
---|
59 | 'l': milisecond<BR> |
---|
60 | [tfmt]: desired format (combination of 'C'-style values and LaTeX)<BR> |
---|
61 | [label]: label at the graph ('!' for spaces, combination of 'C'-style <BR> |
---|
62 | values and LaTeX)<BR> |
---|
63 | [smin/axv]: minimum and maximum value for the shading or:<BR> |
---|
64 | 'Srange': for full range<BR> |
---|
65 | 'Saroundmean@val': for mean-xtrm,mean+xtrm where xtrm = np.min(mean-min@val,max@val-mean)<BR> |
---|
66 | 'Saroundminmax@val': for min*val,max*val<BR> |
---|
67 | 'Saroundpercentile@val': for median-xtrm,median+xtrm where xtrm = np.min(median-percentile_(val),<BR> |
---|
68 | percentile_(100-val)-median)<BR> |
---|
69 | 'Smean@val': for -xtrm,xtrm where xtrm = np.min(mean-min*@val,max*@val-mean)<BR> |
---|
70 | 'Smedian@val': for -xtrm,xtrm where xtrm = np.min(median-min@val,max@val-median)<BR> |
---|
71 | 'Spercentile@val': for -xtrm,xtrm where xtrm = np.min(median-percentile_(val),<BR> |
---|
72 | percentile_(100-val)-median)<BR> |
---|
73 | [figt]: title of the figure ('|' for spaces)<BR> |
---|
74 | [kindfig]: kind of file for the figure output (ps, eps, png, pdf, ...)<BR> |
---|
75 | [mapfmt] = [cbarmap]|[mapkind]|[lonlatbox] values for the map <BR> |
---|
76 | cbarmap: name of the colorbar for the map<BR> |
---|
77 | mapkind: kind of map to use in the plot<BR> |
---|
78 | 'direct': values are they come<BR> |
---|
79 | 'shadow',[pos],[enhance]: pseudo-shadding from a given location of the sun<BR> |
---|
80 | [pos]: 'N', 'NW'<BR> |
---|
81 | [enhance]: enhance factor for the shading ('auto' for 1./5.)<BR> |
---|
82 | lonlatbox: [lonSW],[latSW],[lonNE],[latNE] to plot only a lon,lat box<BR> |
---|
83 | 'full': for the whole domain<BR> |
---|
84 | [mapv]: map characteristics: [proj],[res]<BR> |
---|
85 | see full documentation: <A HREF="http://matplotlib.org/basemap/" CLASS="la" TARGET="_blank">http://matplotlib.org/basemap/</A><BR> |
---|
86 | [proj]: projection<BR> |
---|
87 | * 'cyl', cilindric<BR> |
---|
88 | * 'lcc', lambert conformal<BR> |
---|
89 | [res]: resolution:<BR> |
---|
90 | * 'c', crude<BR> |
---|
91 | * 'l', low<BR> |
---|
92 | * 'i', intermediate<BR> |
---|
93 | * 'h', high<BR> |
---|
94 | * 'f', full<BR> |
---|
95 | [close]: Whether figure should be finished or not<BR> |
---|
96 | varn= [varsn] name of the variable to plot with shading<BR> |
---|
97 | </DIV> |
---|
98 | <DIV CLASS="valins"> |
---|
99 | $ python ${pyHOME}/drawing.py -o draw_2Dshad_map -S 'orog;$conv^{ini}$;lat|-1,lon|-1;lon;lat;<BR> |
---|
100 | auto;rainbow#auto#auto#time@minutes!since!1949-12-01!00:00:00|exct,6,h|%d$^{%H}$|<BR> |
---|
101 | date!([DD]$^{[HH]}$);Srange,Srange;convini|Case6|era5_1a;png;binary|shadow,NW,auto|<BR> |
---|
102 | -70.,-36,-62.,-30.;cyl,c;yes' -v convini -f UBA_ERA5_1a_2D.nc |
---|
103 | </DIV> |
---|
104 | </BODY> |
---|
105 | </HTML> |
---|
106 | |
---|