source: lmdz_wrf/trunk/tools/documentation/plotting/cycle.html @ 2734

Last change on this file since 2734 was 1575, checked in by lfita, 8 years ago

Adding `draw_cycle:' Function to plot a variale with a circular cycle

File size: 9.0 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      cycle
11    </DIV>
12    <DIV CLASS="valimg">
13      Plotting a temporal circular cycle
14      <TABLE>
15        <TR><TD><IMG WIDTH="100%" SRC="figs/cycle_tair_CRUNCEP_spinup_SESA.png"></IMG></TD></TR>
16        <TR><TD><IMG WIDTH="100%" SRC="figs/cycle_tair_CRUNCEP_spinup_SACZ.png"></IMG></TD></TR>
17      </TABLE>
18    </DIV>
19    <DIV CLASS="valhelp">
20    draw_cycle(ncfile, values)<BR>
21    &nbsp;&nbsp;ncfile = '#' list of files [filen];[slice];[tvarn];[varn]<BR>
22    &nbsp;&nbsp;&nbsp;&nbsp;[filen]: name of the file<BR>
23    &nbsp;&nbsp;&nbsp;&nbsp;[dimslice]: '|' list of [dimn],[dimrange]<BR>
24    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dimn]: name of the dimension<BR>
25    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dimrange]: range for the slice<BR>
26    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* [integer]: which value of the dimension<BR>
27    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* -1: all along the dimension<BR>
28    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* -9: last value of the dimension<BR>
29    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* [beg]@[end]@[inc] slice from [beg] to [end] every [inc]<BR>
30    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* NOTE, no dim name all the dimension size<BR>
31    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[tvarn]: name of the variable time ('WRFtime', for times from WRF)<BR>
32    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[varn]: name of the variable to use for the values<BR>
33    &nbsp;&nbsp;values = [dimxyfmt];[valaxis];[axeskind];[axislab];[axisunits];[rangevals];[cyclevals];[figcyckind];<BR>
34    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cycticks];[timevals];[labels];[graphtit];[legvalues];[kindfig];[fign];[outfile];[close]<BR>
35    &nbsp;&nbsp;&nbsp;&nbsp;[dimxyfmt]=[dxs],[dxf],[Ndx],[ordx],[dys],[dyf],[Ndy],[ordy]: format of the values at each <BR>
36    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;axis (or single 'auto' for 'auto','auto')<BR>
37    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dxs]: style of x-axis ('auto' for 'pretty')<BR>
38    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Nfix', values computed at even 'Ndx'<BR>
39    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Stringlist', a given list of strings<BR>
40    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Vfix', values computed at even 'Ndx' increments<BR>
41    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'pretty', values computed following aprox. 'Ndx' at 'pretty' intervals (2.,2.5,4,5,10)<BR>
42    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dxf]: format of the labels at the x-axis<BR>
43    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Ndx]: Number of ticks at the x-axis (for 'Stringlist', '@' list of labels)<BR>
44    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ordx]: angle of orientation of ticks at the x-axis ('auto' for horizontal)<BR>
45    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dys]: style of y-axis ('auto' for 'pretty')<BR>
46    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[dyf]: format of the labels at the y-axis<BR>
47    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Ndy]: Number of ticks at the y-axis<BR>
48    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ordy]: angle of orientation of ticks at the y-axis ('auto' for horizontal)<BR>
49    &nbsp;&nbsp;&nbsp;&nbsp;[valaxis]: which axes should be used for the data<BR>
50    &nbsp;&nbsp;&nbsp;&nbsp;[axeskind]: type of axes to be plotted<BR>
51    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'centered': crossed at 0,0 at the center of the figure<BR>
52    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'box': around the figure<BR>
53    &nbsp;&nbsp;&nbsp;&nbsp;[axislab]: Label for the values-axis ('!' for spaces)<BR>
54    &nbsp;&nbsp;&nbsp;&nbsp;[axisunits]: units of the values-label<BR>
55    &nbsp;&nbsp;&nbsp;&nbsp;[rangevals]: Range of the axis with the values (single 'None' for 'auto','auto')<BR>
56    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[val1],[val2]: tacking the provided ',' separated list of desired [val1] and [val2]<BR>
57    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'auto': automatically set up range using minv and maxv<BR>
58    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'extremescentered': extremes automatically centered on zero by computing from data -absmax, absmax; <BR>
59    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;absmax=max(abs(minval),maxval)<BR>
60    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'meancentered': extremes automatically centered on mean by computing from data minv+meanv, maxv-meanv; <BR>
61    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;meanv=(minval + maxval)/2.<BR>
62    &nbsp;&nbsp;&nbsp;&nbsp;[cyclevals] = [cycle],[cycle0]<BR>
63    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cycle]= numbers of time steps to use for the cycle<BR>
64    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cycle0]= initial position of time steps whithin the cycle<BR>
65    &nbsp;&nbsp;&nbsp;&nbsp;[figcyckind]=[kindname],[valueskind] kind of cycle plot<BR>
66    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cloud',[color]: values as a cloud of points<BR>
67    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[color]: name of the colorbar to use changing after the end of each cycle ('auto' for 'rainbow')<BR>
68    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'lines',[color],[width],[type]: values a continuous line <BR>
69    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[color]: name of the colorbar to use changing after the end of each cycle ('auto' for 'rainbow')<BR>
70    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[width]: width of the line to use for all lines ('auto' for 0.5)<BR>
71    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[type]: type of the line to use for all lines ('auto' for '-')<BR>
72    &nbsp;&nbsp;&nbsp;&nbsp;[cycticks]= [cycpos]@[cyclab] characteristics of the ticks for the cycle<BR>
73    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cycpos]: ',' list of positions for the ticks (less than cycle/2)<BR>
74    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[cyclab]: ',' list of labels for the ticks (less than cycle/2)<BR>
75    &nbsp;&nbsp;&nbsp;&nbsp;[timevals]: [timen]|[units]|[kind]|[tfmt] time labels characteristics<BR>
76    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[timen]; name of the time variable<BR>
77    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[units]; units string according to CF conventions ([tunits] since <BR>
78    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[YYYY]-[MM]-[DD] [[HH]:[MI]:[SS]], '!' for spaces)<BR>
79    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[kind]; kind of output<BR>
80    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Nval': according to a given number of values as 'Nval',[Nval]<BR>
81    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'exct': according to an exact time unit as 'exct',[tunit]; <BR>
82    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tunit= [Nunits],[tu]; [tu]= 'c': centuries, 'y': year, 'm': month,<BR>
83    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'w': week, 'd': day, 'h': hour, 'i': minute, 's': second, <BR>
84    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'l': milisecond<BR>
85    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[tfmt]; desired format<BR>
86    &nbsp;&nbsp;&nbsp;&nbsp;[labels]: ',' list of labels for the legend ('None' for no-labels, '!' for spaces)<BR>
87    &nbsp;&nbsp;&nbsp;&nbsp;[graphtit]: title of the figure '!' for spaces<BR>
88    &nbsp;&nbsp;&nbsp;&nbsp;[legvalues]=[locleg]|[fontsize]: <BR>
89    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[locleg]: location of the legend (0, autmoatic)<BR>
90    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',<BR>
91    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center',<BR>
92    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9: 'upper center', 10: 'center'<BR>
93    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[fontsize]: font size for the legend (auto for 12)<BR>
94    &nbsp;&nbsp;&nbsp;&nbsp;[kindfig]: kind of output figure (png, pdf, ps)<BR>
95    &nbsp;&nbsp;&nbsp;&nbsp;[fign]: name of the figure (without extension)<BR>
96    &nbsp;&nbsp;&nbsp;&nbsp;[close]: whether figure should be close or not<BR>
97    </DIV>
98    <DIV CLASS="valins">
99      * Plotting using continuos lines <BR>
100      &nbsp;&nbsp;$ python ${pyHOME}/drawing.py -o draw_cycle -f 'Forcing_tairstats_OKstomate_CRUNCEP_spinup_SESA.nc;time_counter,-1|stats,2;time_centered;tair_stats' -S 'auto;y;centered;tair;K;None;12,3;lines,rainbow,horizontal,auto,-,2.;1,3,5@Sep/Nov,Jan/Jul,Mar/May;year|seconds!since!1958-01-01!00:00:00|exct,5,y|%Y;SESA;year-evolution!of!CRUNCEP!tair!forcing!at!SESA;0|10;png;cycle_tair_CRUNCEP_spinup_SESA;yes' <BR>
101      * Plotting using cloud of points <BR>
102      &nbsp;&nbsp;$ python ${pyHOME}/drawing.py -o draw_cycle -f 'Forcing_tairstats_OKstomate_CRUNCEP_spinup_SESA.nc;time_counter,-1|stats,2;time_centered;tair_stats' -S 'auto;y;box;tair;K;None;12,3;cloud,rainbow,horizontal,auto,x,2.;1,3,5@Sep/Nov,Jan/Jul,Mar/May;year|seconds!since!1958-01-01!00:00:00|exct,5,y|%Y;tas;year-evolution!of!CRUNCEP!tair!forcing!at!SACZ;0|10;png;cycle_tair_CRUNCEP_spinup_SACZ;yes'
103
104    </DIV>
105  </BODY>
106</HTML>
107
Note: See TracBrowser for help on using the repository browser.