Plotting a 2D field with shading where one of the acis has temporal values
y-values following data | y-values fixed-pixel size |
| |
draw_2D_shad_time(ncfile, values, varn)
ncfile= file to use
values=[vnamefs]~[dimvals]~[dimxvn]~[dimyvn]~[dimvfmt]~[colorbarvals]~[sminv],[smaxv]~[gridkind]~[figt]~
[kindfig]~[reverse]~[timevals]~[close]
[vnamefs]: Name in the figure of the variable to be shaded
[dimvals]: ',' list of [dimname]|[value] telling at which dimension of the
variable a given value is required (-1, all the length, [beg]@[end] for an interval)
[dimx/yvn]: name of the variables with the values of the final dimensions (x,y) ('WRFtime' for WRF times)
[dimvfmt]=[dvs],[dvf],[Ndv],[ordv]: format of the values for the non-temporal axis (or 'auto')
[dvs]: style of non-temporal 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 x-axis ('auto' for '%5g')
[Ndv]: Number of ticks at the x-axis ('auto' for 5)
[ordv]: angle of orientation of ticks at the x-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')
[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)
[gridkind]= [gridxk],[gridyk] kind of grid along x and y axis
'data': size pixel along the given axis change according to the values along the axis
'fixpixel': size pixel along the given axis does not change
[figt]: title of the figure ('|' for spaces)
[kindfig]: kind of figure
[reverse]: '|' list of transformations to apply on the values
* 'transpose': reverse the axes (x-->y, y-->x)
* 'flip'@[x/y]: flip the axis x or y
[timevals]: [timen]|[units]|[kind]|[tfmt]|[label]|[timeaxis] 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]: should figure be closed (finished)
varn= [varsn] name of the variable to plot with shading
* Data-relative y-axis
python ${pyHOME}/drawing.py -o draw_2D_shad_time -f ERAI_pl201507_130.nc -S 'ta~lon|52,lat|30,time|76@100~lev~time~auto~rainbow,auto,vertical~200.,310.~data,data~ta|in|valley|from|ERA-Interim~png~transpose~time|hours!since!2015-07-01!00:00:00|exct,12,h|$%d^{%H}$|date!($[DD]^{[HH]}$)~True' -v t
* Fixel pixel size y-axis
python ${pyHOME}/drawing.py -o draw_2D_shad_time -f ERAI_pl201507_130.nc -S 'ta~lon|52,lat|30,time|76@100~lev~time~auto~rainbow,auto,vertical~200.,310.~data,fixpixel~ta|in|valley|from|ERA-Interim~png~transpose~time|hours!since!2015-07-01!00:00:00|exct,12,h|$%d^{%H}$|date!($[DD]^{[HH]}$)~True' -v t