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

@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 time stamp in @file{ofile} is from the middle contributing timestep of @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
Divisor is n. 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
Divisor is n. 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_timselvar1
@Title     = Time range variance
@Parameter = nsets [noffset] [nskip]

@BeginDescription
@IfMan
Divisor is (n-1). For every adjacent sequence t1, ...., tn of timesteps of the same 
selected time range it is

o(t,x) = var1{i(t',x), t1 < t' <= tn}
@EndifMan
@IfDoc
Divisor is (n-1). 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 var1}\{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
Divisor is n. 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
Divisor is n. 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


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

@BeginDescription
@IfMan
Divisor is (n-1). For every adjacent sequence t1, ...., tn of timesteps of the same 
selected time range it is

o(t,x) = std1{i(t',x), t1 < t' <= tn}
@EndifMan
@IfDoc
Divisor is (n-1). 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 std1}\{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
