Plotting one continuous fields with shading and another discrete one with points with a time-axis
draw_2D_shad_contdisc_time(ncfiles, values)
ncfiles= [contfilen];[contvarn];[dimtvarn];[dimvvarn];[dimvals]@[discfilen];
[discvarn];[dimtvarn];[dimvvarn];[dimvals] files and variables to use
[contfilen]: name of the file with the continuous varible
[contvarn]: name of the continuos variable
[dimtvarn]: name of the variable with values for the time-dimension
[dimvvarn]: name of the variable with values for the variable-dimension
[dimvals]: ',' list of [dimname]|[value] values to slice the variable:
* [integer]: which value of the dimension
* -1: all along the dimension
* -9: last value of the dimension
* [beg]@[end]@[inc] slice from [beg] to [end] every [inc]
* NOTE, no dim name all the dimension size
[discfilen]: name of the file with the discrete varible
[discvarn]: name of the discrete variable
* NOTE: limits of the graph will be computed from the continuous variable
values=[vnamefs];[varaxis];[timevals];[dimvfmt];[colorbarvals];[sminv],[smaxv];
[discvals];[figt];[kindfig];[reverse];[mapv];[close]
[vnamefs]: Name in the figure of the variable to be shaded
[varaxis]: axis in the figure for the variable-axis ('x' or 'y')
[timevals]: [units]|[kind]|[tfmt]|[label] time labels characteristics
[units]: units string according to CF conventions ([tunits] since
[YYYY]-[MM]-[DD] [[HH]:[MI]:[SS]], '!' for spaces),
'auto' for minutes!since!1949-12-01!00:00:00
[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 (combination of 'C'-style values and LaTeX)
[label]: label at the graph ('!' for spaces, combination of 'C'-style
values and LaTeX)
[dimvfmt]=[[dvs],[dvf],[Ndv],[ordv]: format of the values at variable-axis
(or 'auto')
[dvs]: style of variable-axis ('auto' for 'pretty')
'Nfix', values computed at even 'Ndx'
'Vfix', values computed at even 'Ndx' increments
'pretty', values computed following aprox. 'Ndx' at 'pretty' intervals (2.,2.5,4,5,10)
[dvf]: format of the labels at the var-axis ('auto' for '%5g')
[Ndv]: Number of ticks at the var-axis ('auto' for 5)
[ordv]: angle of orientation of ticks at the var-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' ['auto'], 'horizontal')
* NOTE: single 'auto' for 'rainbow,%6g,vertical'
[smin/axv]: minimum and maximum values for the shading or string for each for:
'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)
[discvals]= [type],[size],[lwidth],[lcol] characteristics of the points for the discrete field
[type]: type of point. Any marker from matoplib must be filled !
[size]: size of point
[lwidth]: width of the line around the point
[lcol]: color of the line around the point
* 'auto': for [type]='o', [size]=5, [lwdith]=0.25, [lcol]='#000000'
[figt]: title of the figure ('!' for spaces)
[kindfig]: kind of figure output (ps, png, pdf)
[reverse]: Transformation of the values to plot
* 'transpose': reverse the axes (x-->y, y-->x)
* 'flip'@[x/y]: flip the axis x or y
[mapv]: map characteristics: [proj],[res]
see full documentation: http://matplotlib.org/basemap/
[proj]: projection
* 'cyl', cilindric
* 'lcc', lambert conformal
[res]: resolution of the coastaline data:
* 'c', crude
* 'l', low
* 'i', intermediate
* 'h', high
* 'f', full
[close]: Whether figure should be finished or not
$ python ${pyHOME}/drawing.py -o draw_2D_shad_contdisc_time -f 'simout_snddiags.nc;ta;time;pres;
time|-1,pres|-1@UWyoming_snd_87576.nc;ta;time;pres;time|-1,pres|-1' -S 'ta;y;auto|exct,12,h|%d$^{%H}$|
time!($[DD]^{[HH]}$);Vfix,auto,50.,auto;auto;Srange,Srange;auto;obs!&!sim!Ezeiza!airport!sounding;png;
flip@y;None;yes'