Plotting a 2D field with shading and another one with contour lines with one of the axes with temporal values
draw_2D_shad_cont_time(ncfile, values, varn)
ncfile= [ncfilevars],[ncfilevarc] files to use (one value, same file)
values=[vnamefs];[dimvals];[dimvalc];[dimxvn];[dimyvn];[dimxyf];[colorbarvals];[ckind];[clabfmt];[sminv],[smaxv];[sminc],[smaxv],[Nlev];[figt];[kindfig];[reverse];[timevals];[close]
[vnamefs],[vnamefc]: Name in the figure of the shaded and the contour variables
[dimvals/c]: list of [dimname]|[value] telling at which dimension of the
variable a given value is required (no dimension name, all the length)
[dimxvn]: name of the variables with the values of the dimension of the x-axis ('WRFtime' for WRF times)
[dimyvn]: name of the variables with the values of the dimension of the y-axis ('WRFtime' for WRF times)
[dimxyf]=[dxf],[Ndx],[dyf],[Ndy]: format of the values at each axis
[dxs]: style of x-axis ('auto' for 'pretty')
'Nfix', values computed at even 'Ndx' (unique map plotted with constant pixel size)
'Vfix', values computed at even 'Ndx' increments
'pretty', values computed following aprox. 'Ndx' at 'pretty' intervals (2.,2.5,4,5,10)
[dxf]: format of the labels at the x-axis
[Ndx]: Number of ticks at the x-axis
[ordx]: angle of orientation of ticks at the x-axis ('auto' for horizontal)
[dys]: style of y-axis ('auto' for 'pretty')
[dyf]: format of the labels at the y-axis
[Ndy]: Number of ticks at the y-axis
[ordy]: angle of orientation of ticks at the y-axis ('auto' for horizontal)
[colorbarvals]=[colbarn],[fmtcolorbar],[orientation]
[colorbarn]: name of the color bar
[fmtcolorbar]: format of the numbers in the color bar 'C'-like ('auto' for %6g)
[orientation]: orientation of the colorbar ('vertical' (default, by 'auto'), 'horizontal')
[ckind]: kind of contours
'cmap': as it gets from colorbar
'fixc,[colname]': fixed color [colname], all stright lines
'fixsigc,[colname]': fixed color [colname], >0 stright, <0 dashed line
[clabfmt]: format of the labels in the contour (None, also possible)
[smin/axv]: minimum and maximum value for the shading or:
'Srange': for full range
'Saroundmean@val': for mean-xtrm,mean+xtrm where xtrm = np.min(mean-min@val,max@val-mean)
'Saroundminmax@val': for min*val,max*val
'Saroundpercentile@val': for median-xtrm,median+xtrm where xtrm = np.min(median-percentile_(val),
percentile_(100-val)-median)
'Smean@val': for -xtrm,xtrm where xtrm = np.min(mean-min*@val,max*@val-mean)
'Smedian@val': for -xtrm,xtrm where xtrm = np.min(median-min@val,max@val-median)
'Spercentile@val': for -xtrm,xtrm where xtrm = np.min(median-percentile_(val),
percentile_(100-val)-median)
[sminc]:[smaxv]:[Nlev]: minimum, maximum and number of values for the contour
[figt]: title of the figure ('|' for spaces)
[kindfig]: kind of figure
[reverse]: modification to the dimensions:
'transposed': transpose matrices
'flip',[x/y]: flip only the dimension [x] or [y]
[timevals]: [timen]|[units]|[kind]|[tfmt]|[label] time labels characteristics
[timen]; name of the time variable ('WRFtime' for WRF times)
[units]; units string according to CF conventions ([tunits] since
[YYYY]-[MM]-[DD] [[HH]:[MI]:[SS]], '!' for spaces)
[kind]; kind of output
'Nval': according to a given number of values as 'Nval',[Nval]
'exct': according to an exact time unit as 'exct',[tunit];
tunit= [Nunits],[tu]; [tu]= 'c': centuries, 'y': year, 'm': month,
'w': week, 'd': day, 'h': hour, 'i': minute, 's': second,
'l': milisecond
[tfmt]; desired format
[label]; label at the graph ('!' for spaces)
[close]: Whether figure should be finished or not
varn= [varsn],[varcn] name of the variable to plot with shading variable with contour
$ python ${pyHOME}/drawing.py -o draw_2D_shad_cont_time -f wrfout_d01_2001-11-11_00:00:00 -S 'hfls,tas;west_east|-1,south_north|27,Time|-1;south_north|27;XLONG;WRFtime;auto;BuPu,auto,auto;fixc,y;%3g;Srange,Srange;260,300,9;huss|&|tas|evolution|at|south_north=27;png;None;WRFtime|hours!since!1949-12-01|exct,1,h|$%d^{%H}$|date!($[DD]^{[HH]}$);True' -v LH,T2