\chapter{Batch calculations}
 \label{sec:batch}


%
% Document history, format:
%  \starthistory
%    date1 & text .... \\
%    date2 & text .... \\
%    ....
%  \stophistory
%
\starthistory
  040916 & Created by Patrick Eriksson.\\
\stophistory

In many occasions you want to repeat the calculations with only a few
variables changed. Examples on such cases are to perform 1D
calculations for a number of atmospheric states taken from some
atmospheric model, generate a set of spectra to create a training
database for regression based inversions or perform a numeric
inversion error analysis. For such calculations it is inefficient to
perform the calculations by calling ARTS repeatedly.or example, as
data must be imported for each call even if the data are identical
between the cases. Cases such as the ones described above are here
denoted commonly as batch calculations.

It is impossible to put all possible batch calculations inside a
simple framework and the task of organising, or creating, the input
data is left to more flexible programming environments, such as
Matlab (where you of course use Atmlab) and Python. Instead, a general
core functionality has been created that should hopefully be useful
for a large range of tasks. This functionality consists mainly of the
four batch agendas.


\section{Workspace variables and methods}
%
The calculation flow is described be setting four agendas:
  \indent \wsvindex{batch\_pre\_agenda} \\
  \indent \wsvindex{batch\_update\_agenda} \\
  \indent \wsvindex{batch\_calc\_agenda} \\
  \indent \wsvindex{batch\_post\_agenda} \\
Beside these agendas, the user must set the variable \wsvindex{ybatch\_n},
and that inside \artsstyle{batch\_pre\_agenda}. This variable is the number
of defined batch cases. Or in fact, how many batch cases that shall be 
considered. If the agendas can provide more than \artsstyle{ybatch\_n} cases,
the remaining cases are just ignored.

There are few formal requirements on the involved agendas. As
mentioned, \artsstyle{batch\_pre\_agenda} must set
\artsstyle{ybatch\_n}. Beside this, execution of
\artsstyle{batch\_calc\_agenda} must result in new spectrum vector,
\artsstyle{y}, most likely by a call of \artsstyle{RteCalc}. 

%The agenda \artsstyle{batch\_post\_agenda}


%%% Local Variables: 
%%% mode: latex 
%%% TeX-master: "uguide" 
%%% End:

