source: lmdz_wrf/trunk/tools/documentation/plotting/2Dshad_time.html @ 1948

Last change on this file since 1948 was 1589, checked in by lfita, 8 years ago

Adding new functionality of grid-reshape in `draw_2D_shad_time'

File size: 6.4 KB
Line 
1<HTML>
2  <HEAD>
3    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8"/>
4    <TITLE>PyNCplot: plotting 2D shadow_time</TITLE>
5    <LINK REL="stylesheet" TYPE="text/css" HREF="../PyNCplot.css"/>
6  </HEAD>
7
8  </HEAD>
9  <BODY>
10    <DIV CLASS="valheader">
11      2D shadow time plot
12    </DIV>
13    <DIV CLASS="valimg">
14      Plotting a 2D field with shading where one of the acis has temporal values
15      <TABLE>
16        <TR><TD>y-values following data</TD><TD>y-values fixed-pixel size</TD></TR>
17        <TR><TD><IMG WIDTH="100%" SRC="figs/ta_valley_data-grid.png"></IMG></TD><TD><IMG WIDTH="100%" SRC="figs/ta_valley_fixpixel-grid.png"></IMG></TD></TR>
18      </TABLE>
19    </DIV>
20    <DIV CLASS="valhelp">
21    draw_2D_shad_time(ncfile, values, varn)<BR>
22    &nbsp;&nbsp;ncfile= file to use<BR>
23    &nbsp;&nbsp;values=[vnamefs]~[dimvals]~[dimxvn]~[dimyvn]~[dimvfmt]~[colorbarvals]~[sminv],[smaxv]~[gridkind]~[figt]~<BR>
24    &nbsp;&nbsp;[kindfig]~[reverse]~[timevals]~[close]<BR>
25    &nbsp;&nbsp;&nbsp;&nbsp;[vnamefs]: Name in the figure of the variable to be shaded<BR>
26    &nbsp;&nbsp;&nbsp;&nbsp;[dimvals]: ',' list of [dimname]|[value] telling at which dimension of the <BR>
27    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;variable a given value is required (-1, all the length, [beg]@[end] for an interval)<BR>
28    &nbsp;&nbsp;&nbsp;&nbsp;[dimx/yvn]: name of the variables with the values of the final dimensions (x,y)  ('WRFtime' for WRF times)<BR>
29    &nbsp;&nbsp;&nbsp;&nbsp;[dimvfmt]=[dvs],[dvf],[Ndv],[ordv]: format of the values for the non-temporal axis (or 'auto')<BR>
30    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dvs]: style of non-temporal axis ('auto' for 'pretty')<BR>
31    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Nfix', values computed at even 'Ndx'<BR>
32    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Vfix', values computed at even 'Ndx' increments<BR>
33    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'pretty', values computed following aprox. 'Ndx' at 'pretty' intervals (2.,2.5,4,5,10)<BR>
34    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dvf]: format of the labels at the x-axis ('auto' for '%5g')<BR>
35    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Ndv]: Number of ticks at the x-axis ('auto' for 5)<BR>
36    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ordv]: angle of orientation of ticks at the x-axis ('auto' for horizontal)<BR>
37    &nbsp;&nbsp;&nbsp;&nbsp;[colorbarvals]=[colbarn],[fmtcolorbar],[orientation]<BR>
38    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[colorbarn]: name of the color bar<BR>
39    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[fmtcolorbar]: format of the numbers in the color bar 'C'-like ('auto' for %6g)<BR>
40    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[orientation]: orientation of the colorbar ('vertical' (default, by 'auto'), 'horizontal')<BR>
41    &nbsp;&nbsp;&nbsp;&nbsp;[smin/axv]: minimum and maximum value for the shading or:<BR>
42    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Srange': for full range<BR>
43    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Saroundmean@val': for mean-xtrm,mean+xtrm where xtrm = np.min(mean-min@val,max@val-mean)<BR>
44    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Saroundminmax@val': for min*val,max*val<BR>
45    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Saroundpercentile@val': for median-xtrm,median+xtrm where xtrm = np.min(median-percentile_(val),<BR>
46    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;percentile_(100-val)-median)<BR>
47    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Smean@val': for -xtrm,xtrm where xtrm = np.min(mean-min*@val,max*@val-mean)<BR>
48    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Smedian@val': for -xtrm,xtrm where xtrm = np.min(median-min@val,max@val-median)<BR>
49    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Spercentile@val': for -xtrm,xtrm where xtrm = np.min(median-percentile_(val),<BR>
50    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;percentile_(100-val)-median)<BR>
51    &nbsp;&nbsp;&nbsp;&nbsp;[gridkind]= [gridxk],[gridyk] kind of grid along x and y axis<BR>
52    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'data': size pixel along the given axis change according to the values along the axis<BR>
53    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'fixpixel': size pixel along the given axis does not change <BR>
54    &nbsp;&nbsp;&nbsp;&nbsp;[figt]: title of the figure ('|' for spaces)<BR>
55    &nbsp;&nbsp;&nbsp;&nbsp;[kindfig]: kind of figure<BR>
56    &nbsp;&nbsp;&nbsp;&nbsp;[reverse]: '|' list of transformations to apply on the values<BR>
57    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 'transpose': reverse the axes (x-->y, y-->x)<BR>
58    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 'flip'@[x/y]: flip the axis x or y<BR>
59    &nbsp;&nbsp;&nbsp;&nbsp;[timevals]: [timen]|[units]|[kind]|[tfmt]|[label]|[timeaxis] time labels characteristics<BR>
60    &nbsp;&nbsp;&nbsp;&nbsp;[timen]; name of the time variable ('WRFtime' for WRF times)<BR>
61    &nbsp;&nbsp;&nbsp;&nbsp;[units]; units string according to CF conventions ([tunits] since <BR>
62    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[YYYY]-[MM]-[DD] [[HH]:[MI]:[SS]], '!' for spaces)<BR>
63    &nbsp;&nbsp;&nbsp;&nbsp;[kind]; kind of output<BR>
64    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Nval': according to a given number of values as 'Nval',[Nval]<BR>
65    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'exct': according to an exact time unit as 'exct',[tunit]; <BR>
66    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tunit= [Nunits],[tu]; [tu]= 'c': centuries, 'y': year, 'm': month,<BR>
67    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'w': week, 'd': day, 'h': hour, 'i': minute, 's': second, <BR>
68    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'l': milisecond<BR>
69    &nbsp;&nbsp;&nbsp;&nbsp;[tfmt]; desired format<BR>
70    &nbsp;&nbsp;&nbsp;&nbsp;[label]; label at the graph ('!' for spaces)<BR>
71    &nbsp;&nbsp;&nbsp;&nbsp;[close]: should figure be closed (finished)<BR>
72    &nbsp;&nbsp;varn= [varsn] name of the variable to plot with shading<BR>
73    </DIV>
74    <DIV CLASS="valins">
75      * Data-relative y-axis <BR>
76      &nbsp;&nbsp;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<BR>
77      * Fixel pixel size y-axis <BR>
78      &nbsp;&nbsp;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<BR>
79    </DIV>
80  </BODY>
81</HTML>
82
Note: See TracBrowser for help on using the repository browser.