@BeginModule
@NewPage
@Name      = Timselstat
@Title     = Time range statistical values
@Section   = Statistical values
@Class     = Statistic
@Arguments = ifile ofile
@Operators = timselmin timselmax timselsum timselmean timselavg timselvar timselstd

@BeginDescription
This module computes statistical values for a selected number of timesteps.
According to the chosen operator the minimum, maximum, sum, average,
variance or standard deviation of the selected timesteps is written to @file{ofile}.
The date information of a timestep in @file{ofile} is the date of the last 
contributing timestep in @file{ifile}.
@EndDescription
@EndModule


@BeginOperator_timselmin
@Title     = Time range minimum
@Parameter = nsets [noffset] [nskip]

@BeginDescription
@IfMan
For every adjacent sequence t1, ...., tn of timesteps of the same 
selected time range it is

o(t,x) = min{i(t',x), t1 < t' <= tn}
@EndifMan
@IfDoc
For every adjacent sequence \begin{math}t_1, ...,t_n\end{math} of timesteps of the same 
selected time range it is: \\
@BeginMath
o(t,x) = \mbox{\bf min}\{i(t',x), t_1 < t' \le t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_timselmax
@Title     = Time range maximum
@Parameter = nsets [noffset] [nskip]

@BeginDescription
@IfMan
For every adjacent sequence t1, ...., tn of timesteps of the same 
selected time range it is

o(t,x) = max{i(t',x), t1 < t' <= tn}
@EndifMan
@IfDoc
For every adjacent sequence \begin{math}t_1, ...,t_n\end{math} of timesteps of the same 
selected time range it is: \\
@BeginMath
o(t,x) = \mbox{\bf max}\{i(t',x), t_1 < t' \le t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_timselsum
@Title     = Time range sum
@Parameter = nsets [noffset] [nskip]

@BeginDescription
@IfMan
For every adjacent sequence t1, ...., tn of timesteps of the same 
selected time range it is

o(t,x) = sum{i(t',x), t1 < t' <= tn}
@EndifMan
@IfDoc
For every adjacent sequence \begin{math}t_1, ...,t_n\end{math} of timesteps of the same 
selected time range it is: \\
@BeginMath
o(t,x) = \mbox{\bf sum}\{i(t',x), t_1 < t' \le t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_timselmean
@Title     = Time range mean
@Parameter = nsets [noffset] [nskip]

@BeginDescription
@IfMan
For every adjacent sequence t1, ...., tn of timesteps of the same 
selected time range it is

o(t,x) = mean{i(t',x), t1 < t' <= tn}
@EndifMan
@IfDoc
For every adjacent sequence \begin{math}t_1, ...,t_n\end{math} of timesteps of the same 
selected time range it is: \\
@BeginMath
o(t,x) = \mbox{\bf mean}\{i(t',x), t_1 < t' \le t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_timselavg
@Title     = Time range average
@Parameter = nsets [noffset] [nskip]

@BeginDescription
@IfMan
For every adjacent sequence t1, ...., tn of timesteps of the same 
selected time range it is

o(t,x) = avg{i(t',x), t1 < t' <= tn}
@EndifMan
@IfDoc
For every adjacent sequence \begin{math}t_1, ...,t_n\end{math} of timesteps of the same 
selected time range it is: \\
@BeginMath
o(t,x) = \mbox{\bf avg}\{i(t',x), t_1 < t' \le t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_timselvar
@Title     = Time range variance
@Parameter = nsets [noffset] [nskip]

@BeginDescription
@IfMan
For every adjacent sequence t1, ...., tn of timesteps of the same 
selected time range it is

o(t,x) = var{i(t',x), t1 < t' <= tn}
@EndifMan
@IfDoc
For every adjacent sequence \begin{math}t_1, ...,t_n\end{math} of timesteps of the same 
selected time range it is: \\
@BeginMath
o(t,x) = \mbox{\bf var}\{i(t',x), t_1 < t' \le t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_timselstd
@Title     = Time range standard deviation
@Parameter = nsets [noffset] [nskip]

@BeginDescription
@IfMan
For every adjacent sequence t1, ...., tn of timesteps of the same 
selected time range it is

o(t,x) = std{i(t',x), t1 < t' <= tn}
@EndifMan
@IfDoc
For every adjacent sequence \begin{math}t_1, ...,t_n\end{math} of timesteps of the same 
selected time range it is: \\
@BeginMath
o(t,x) = \mbox{\bf std}\{i(t',x), t_1 < t' \le t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginParameter noffset
@Item = nsets
INTEGER  Number of input timesteps for each output timestep 
@Item = noffset
INTEGER  Number of input timesteps skipped before the first timestep range (optional)
@Item = nskip
INTEGER  Number of input timesteps skipped between timestep ranges (optional)
@EndParameter


@BeginExample
Assume an input dataset has monthly means over several years.
To compute seasonal means from monthly means the first two
month have to be skipped:
@BeginVerbatim
   cdo timselmean,3,2 ifile ofile
@EndVerbatim
@EndExample
