@BeginModule
@NewPage
@Name      = Seasstat
@Title     = Seasonal statistical values
@Section   = Statistical values
@Class     = Statistic
@Arguments = ifile ofile
@Operators = seasmin seasmax seassum seasmean seasavg seasstd seasstd1 seasvar seasvar1

@BeginDescription
This module computes statistical values over timesteps of the same season.
Depending on the chosen operator the minimum, maximum, sum, average, variance
or standard deviation of timesteps of the same season is written to @file{ofile}.
The time stamp in @file{ofile} is from the middle contributing timestep of @file{ifile}.
Be careful about the first and the last output timestep, they may be incorrect values 
if the seasons have incomplete timesteps.
@EndDescription
@EndModule


@BeginOperator_seasmin
@Title     = Seasonal minimum

@BeginDescription
@IfMan
For every adjacent sequence t_1, ...,t_n of timesteps of the same season 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 season it is: \\
@BeginMath
o(t,x) = \mbox{\bf min}\{i(t',x), t_1 < t' \le t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_seasmax
@Title     = Seasonal maximum

@BeginDescription
@IfMan
For every adjacent sequence t_1, ...,t_n of timesteps of the same season 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 season it is: \\
@BeginMath
o(t,x) = \mbox{\bf max}\{i(t',x), t_1 < t' \le t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_seassum
@Title     = Seasonal sum

@BeginDescription
@IfMan
For every adjacent sequence t_1, ...,t_n of timesteps of the same season 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 season it is: \\
@BeginMath
o(t,x) = \mbox{\bf sum}\{i(t',x), t_1 < t' \le t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_seasmean
@Title     = Seasonal mean

@BeginDescription
@IfMan
For every adjacent sequence t_1, ...,t_n of timesteps of the same season 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 season it is: \\
@BeginMath
o(t,x) = \mbox{\bf mean}\{i(t',x), t_1 < t' \le t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_seasavg
@Title     = Seasonal average

@BeginDescription
@IfMan
For every adjacent sequence t_1, ...,t_n of timesteps of the same season 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 season it is: \\
@BeginMath
o(t,x) = \mbox{\bf avg}\{i(t',x), t_1 < t' \le t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_seasvar
@Title     = Seasonal variance

@BeginDescription
@IfMan
Normalize by n. For every adjacent sequence t_1, ...,t_n of timesteps of the same season it is

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


@BeginOperator_seasvar1
@Title     = Seasonal variance (n-1)

@BeginDescription
@IfMan
Normalize by (n-1). For every adjacent sequence t_1, ...,t_n of timesteps of the same season it is

o(t,x) = var1{i(t',x), t1 < t' <= tn}
@EndifMan
@IfDoc
Normalize by (n-1). For every adjacent sequence \begin{math}t_1, ...,t_n\end{math} of timesteps of 
the same season it is: \\
@BeginMath
o(t,x) = \mbox{\bf var1}\{i(t',x), t_1 < t' \le t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_seasstd
@Title     = Seasonal standard deviation

@BeginDescription
@IfMan
Normalize by n. For every adjacent sequence t_1, ...,t_n of timesteps of the same season it is

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


@BeginOperator_seasstd1
@Title     = Seasonal standard deviation (n-1)

@BeginDescription
@IfMan
Normalize by (n-1). For every adjacent sequence t_1, ...,t_n of timesteps of the same season it is

o(t,x) = std1{i(t',x), t1 < t' <= tn}
@EndifMan
@IfDoc
Normalize by (n-1). For every adjacent sequence \begin{math}t_1, ...,t_n\end{math} of timesteps of 
the same season it is: \\
@BeginMath
o(t,x) = \mbox{\bf std1}\{i(t',x), t_1 < t' \le t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginExample
To compute the seasonal mean of a time series use:
@BeginVerbatim
   cdo seasmean ifile ofile
@EndVerbatim
@EndExample
