source: lmdz_wrf/trunk/tools/documentation/plotting/time_lag.html @ 1559

Last change on this file since 1559 was 1553, checked in by lfita, 8 years ago

Adding `draw_time_lag': Function to plot a time-lag figure with multiple sources (x, previous values; y, future values)

File size: 12.4 KB
Line 
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      time-lag figure
11    </DIV>
12    <DIV CLASS="valimg">
13      Plot a time-lag figure with multiple sources (x, previous values; y, future values)
14      <TABLE>
15        <TD><TR><IMG WIDTH="100%" SRC="figs/mon1_timelag_pr-evap_SACZ.png"></IMG></TR></TD>
16        <TD><TR><IMG WIDTH="100%" SRC="figs/mon6_timelag_pr-evap_SACZ_shadline.png"></IMG></TR></TD>
17        <TD><TR><IMG WIDTH="100%" SRC="figs/mon1_timelag_pr-evap_SACZ_repeatPeriod.png"></IMG></TR></TD>
18      </TABLE>
19    </DIV>
20    <DIV CLASS="valhelp">
21    draw_time_lag(ncfile, values)<BR>
22    &nbsp;&nbsp;ncfile = ':' list of couples ('%' formed) [prefilen];[predslice];[pretvarn];[prevarn]%[futfilen];<BR>
23    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[futdslice];[futtvarn];[futvarn]<BR>
24    &nbsp;&nbsp;&nbsp;&nbsp;'pre': values to act as previous values<BR>
25    &nbsp;&nbsp;&nbsp;&nbsp;'fut': values to act as future values<BR>
26    <BR>
27    &nbsp;&nbsp;&nbsp;&nbsp;[filen]: name of the file<BR>
28    &nbsp;&nbsp;&nbsp;&nbsp;[dimslice]: '|' list of [dimn],[dimrange]<BR>
29    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dimn]: name of the dimension<BR>
30    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dimrange]: range for the slice<BR>
31    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* [integer]: which value of the dimension<BR>
32    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* -1: all along the dimension<BR>
33    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* -9: last value of the dimension<BR>
34    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* [beg]@[end]@[inc] slice from [beg] to [end] every [inc]<BR>
35    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* NOTE, no dim name all the dimension size<BR>
36    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[tvarn]: name of the variable time<BR>
37    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[yvarn]: name of the variable to use for the values<BR>
38    &nbsp;&nbsp;values = [dimxyfmt];[axeskind];[preaxislab];[preunits];[futaxislab];[futunits];[prerangevals];<BR>
39    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[futrangevals];[timevals];[labels];[figlagkind];[graphtit];[legvalues];[kindfig];[fign];[close]<BR>
40    &nbsp;&nbsp;&nbsp;&nbsp;[dimxyfmt]=[dxs],[dxf],[Ndx],[ordx],[dys],[dyf],[Ndy],[ordy]: format of the values at each <BR>
41    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;axis (or single 'auto' for 'auto','auto')<BR>
42    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dxs]: style of x-axis ('auto' for 'pretty')<BR>
43    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Nfix', values computed at even 'Ndx'<BR>
44    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Stringlist', a given list of strings<BR>
45    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Vfix', values computed at even 'Ndx' increments<BR>
46    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'pretty', values computed following aprox. 'Ndx' at 'pretty' intervals (2.,2.5,4,5,10)<BR>
47    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dxf]: format of the labels at the x-axis<BR>
48    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Ndx]: Number of ticks at the x-axis (for 'Stringlist', '@' list of labels)<BR>
49    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ordx]: angle of orientation of ticks at the x-axis ('auto' for horizontal)<BR>
50    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dys]: style of y-axis ('auto' for 'pretty')<BR>
51    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dyf]: format of the labels at the y-axis<BR>
52    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Ndy]: Number of ticks at the y-axis<BR>
53    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ordy]: angle of orientation of ticks at the y-axis ('auto' for horizontal)<BR>
54    &nbsp;&nbsp;&nbsp;&nbsp;[axeskind]: type of axes to be plotted<BR>
55    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'centered': crossed at 0,0 at the center of the figure<BR>
56    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'box': around the figure<BR>
57    &nbsp;&nbsp;&nbsp;&nbsp;[preaxislab]: Label for the future-axis ('!' for spaces)<BR>
58    &nbsp;&nbsp;&nbsp;&nbsp;[preunits]: units of the future-label<BR>
59    &nbsp;&nbsp;&nbsp;&nbsp;[futaxislab]: Label for the future-axis ('!' for spaces)<BR>
60    &nbsp;&nbsp;&nbsp;&nbsp;[futunits]: units of the future-label<BR>
61    &nbsp;&nbsp;&nbsp;&nbsp;[prerangevals]: Range of the previous axis with the values (single 'None' for 'auto','auto')<BR>
62    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[vmin],[vmax]: minimum and maximum values<BR>
63    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'auto': the computed minimumm or maximum of the values  <BR>
64    &nbsp;&nbsp;&nbsp;&nbsp;[futrangevals]: Range of the future axis with the values (single 'None' for 'auto','auto')<BR>
65    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[vmin],[vmax]: minimum and maximum values<BR>
66    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'auto': the computed minimumm or maximum of the values  <BR>
67    &nbsp;&nbsp;&nbsp;&nbsp;[timevals]: [timen]|[units]|[kind]|[tfmt] time labels characteristics<BR>
68    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[timen]; name of the time variable<BR>
69    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[units]; units string according to CF conventions ([tunits] since <BR>
70    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[YYYY]-[MM]-[DD] [[HH]:[MI]:[SS]], '!' for spaces)<BR>
71    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[kind]; kind of output<BR>
72    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Nval': according to a given number of values as 'Nval',[Nval]<BR>
73    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'exct': according to an exact time unit as 'exct',[tunit]; <BR>
74    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tunit= [Nunits],[tu]; [tu]= 'c': centuries, 'y': year, 'm': month,<BR>
75    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'w': week, 'd': day, 'h': hour, 'i': minute, 's': second, <BR>
76    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'l': milisecond<BR>
77    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[tfmt]; desired format<BR>
78    &nbsp;&nbsp;&nbsp;&nbsp;[labels]: ',' list of labels for the legend ('None' for no-labels, '!' for spaces)<BR>
79    &nbsp;&nbsp;&nbsp;&nbsp;[figlagkind]=[kindname],[valueskind] kind of time-lag plot<BR>
80    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'repeatPeriod',[Nlag],[period],[colorbar],[cbarfmt],[cbaror],[ltype],[lwidth],[mtype],[msize<BR>]:
81    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;time-lag for a given repeating sub-period, Line-conected points following a colorbar and time-values<BR>
82    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Nlag]: number of time steps as lag<BR>
83    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[period]: period to be repeated allover the time-data<BR>
84    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[colorbar]: name of the color bar to use ('auto' for rainbow)<BR>
85    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cbarfmt]: format of the numbers in the colorbar<BR>
86    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cbaror]: orientation of the colorbar ('auto' for vertical)<BR>
87    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ltype]: type of the lines (single value for the same, or 'auto')<BR>
88    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[lsize]: width of the lines (single value for the same, or 'auto')<BR>
89    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mtype]: type of the markers (single value for the same, or 'auto')<BR>
90    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[msize]: size of the markers (single value for the same, or 'auto')<BR>
91    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'shadTline',[Nlag],[colorbar],[cbarfmt],[cbaror],[ltype],[lwidth],[mtype],[msize]: Line-conected <BR>
92    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;points following a colorbar and time-values<BR>
93    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Nlag]: number of time steps as lag<BR>
94    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[colorbar]: name of the color bar to use ('auto' for rainbow)<BR>
95    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cbarfmt]: format of the numbers in the colorbar<BR>
96    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cbaror]: orientation of the colorbar ('auto' for vertical)<BR>
97    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ltype]: type of the lines (single value for the same, or 'auto')<BR>
98    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[lsize]: width of the lines (single value for the same, or 'auto')<BR>
99    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mtype]: type of the markers (single value for the same, or 'auto')<BR>
100    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[msize]: size of the markers (single value for the same, or 'auto')<BR>
101    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'simplepts',[Nlag],[col],[type],[size]: Simple points assuming that values have all the same times<BR>
102    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Nlag]: number of time steps as lag<BR>
103    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[col]: '@' list of colors of the points (single value for the same, or 'auto')<BR>
104    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[type]:types of the points (single value for the same, or 'auto')<BR>
105    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[size]: sizes of the points kind of lag-time figure (single value for the same, or 'auto')<BR>
106    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;labels= list of labels for legend (None for no legend, and 'None' for no specific label)<BR>
107    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[graphtit]: title of the figure '!' for spaces<BR>
108    &nbsp;&nbsp;&nbsp;&nbsp;[legvalues]=[locleg]|[fontsize]: <BR>
109    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[locleg]: location of the legend (0, autmoatic)<BR>
110    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',<BR>
111    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center',<BR>
112    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9: 'upper center', 10: 'center'<BR>
113    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[fontsize]: font size for the legend (auto for 12)<BR>
114    &nbsp;&nbsp;&nbsp;&nbsp;[kindfig]: kind of output figure (png, pdf, ps)<BR>
115    &nbsp;&nbsp;&nbsp;&nbsp;[fign]: name of the figure (without extension)<BR>
116    &nbsp;&nbsp;&nbsp;&nbsp;[close]: whether figure should be close or not<BR>
117    </DIV>
118    <DIV CLASS="valins">
119      $ python ${pyHOME}/drawing.py -o draw_time_lag -f 'Forcing_rainstats_OKstomate_SESA_norm_meanstd_stat2.nc;time_centered,-1;time_counter;rainnorm%DiPolo_evapstats_SESA_norm_meanstd_OKstomate.nc;time_counter,-1|stats,2;time_counter;evapnorm:Forcing_rainstats_OKstomate_SACZ_norm_meanstd_stat2.nc;time_centered,-1;time_counter;rainnorm%DiPolo_evapstats_SACZ_norm_meanstd_OKstomate.nc;time_counter,-1|stats,2;time_counter;evapnorm' -S 'auto;centered;pr;1;evap;1;-5,5;-2,2;year|seconds!since!1958-01-01!00:00:00|exct,5,y|%Y;SESA,SACZ;simplepts,1,#AA0000@#0000AA,x,2.;1-month!time-lag!at!SACZ!between!pr!&!evap!normalized!by!mean/stddev;0|12;png;mon1_timelag_pr-evap_SACZ;yes'
120      $ python ${pyHOME}/drawing.py -o draw_time_lag -f 'Forcing_rainstats_OKstomate_SESA_norm_meanstd_stat2.nc;time_centered,-1;time_counter;rainnorm%DiPolo_evapstats_SESA_norm_meanstd_OKstomate.nc;time_counter,-1|stats,2;time_counter;evapnorm:Forcing_rainstats_OKstomate_SACZ_norm_meanstd_stat2.nc;time_centered,-1;time_counter;rainnorm%DiPolo_evapstats_SACZ_norm_meanstd_OKstomate.nc;time_counter,-1|stats,2;time_counter;evapnorm' -S 'auto;centered;pr;1;evap;1;-5,5;-2,2;year|seconds!since!1958-01-01!00:00:00|exct,5,y|%Y;SESA,SACZ;shadTline,1,spectral,%s,horizontal,-@-.,2.,x,2.;6-month!time-lag!at!SACZ!between!pr!&!evap!normalized!by!mean/stddev;0|12;png;mon6_timelag_pr-evap_SACZ_shadline;yes'
121      $ python ${pyHOME}/drawing.py -o draw_time_lag -f 'Forcing_rainstats_OKstomate_SESA_norm_meanstd_stat2.nc;time_counter,0@63@1;time_counter;rainnorm%DiPolo_evapstats_SESA_norm_meanstd_OKstomate.nc;time_counter,0@63@1|stats,2;time_counter;evapnorm:Forcing_rainstats_OKstomate_SACZ_norm_meanstd_stat2.nc;time_counter,0@63@1;time_counter;rainnorm%DiPolo_evapstats_SACZ_norm_meanstd_OKstomate.nc;time_counter,0@63@1|stats,2;time_counter;evapnorm' -S 'auto;centered;pr;1;evap;1;-2.2,5;-2,2;year|seconds!since!1958-01-01!00:00:00|exct,1,y|%Y;SESA,SACZ;repeatPeriod,1,12,spectral,%s,horizontal,-@-.,2.,x,2.;1-month!time-lag!at!SACZ!between!pr!&!evap!normalized!by!mean/stddev;0|12;png;mon1_timelag_pr-evap_SACZ_repeatPeriod;yes'
122    </DIV>
123  </BODY>
124</HTML>
125
Note: See TracBrowser for help on using the repository browser.