\renewcommand{\documentID}{}

\chapter{How-To}
\label{chap:HowTo}

\section{Software Requirements}
\begin{itemize}
	\item Python $\ge$ 2.7
    \item wxWidgets $\ge$ 2.8
	\item GNU Awk $\ge$ 3.1.0
	\item gen2shp $\ge$ 0.3.0 \newline
		  (\verb"http://intevation.de/~jan/gen2shp/")
	\item txt2dbf $\ge$ 1.0.2
	\item dbf2txt $\ge$ 0.5.2 \newline
		  (\verb"http://www.usf.uos.de/~fkoorman/software/dbftools.en.html")
	\item GNU textutils (sort, join, cut, paste) $\ge$ 2.0
	\item GNU fileutils (rm) $\ge$ 4.1
	\item GNU sed version $\ge$ 3.02
	\item GNU sh-utils (echo) $\ge$ 2.0.11
\end{itemize}

(If you've installed GREAT-ER with the Windows installer
all required Software was installed automatically
together with greater-pre-processing)

\section{Running the Data Preprocessing}
\begin{center}
{\textbf Warning GREAT-ER Preprocessing will modify files!
Keep a backup of your raw data!} \end{center}

On Windows a shortcut called "Catchment Preprocessing" should
have been installed in your Start Menu.
If you deselected installing this shortcut or on another operating
system you can start the Preprocessing wizard by running
"greater-pre-processing.py" from your installation directory.

Once started you will be asked to select a directory containing
the catchment you want to preprocess.

This folder must contain a file named catchment.desc.\\
(see section \ref{sec:catchment.desc} and \ref{sec:gisfilelist} for details).

In the GREAT-ER Windows installation an example dataset of the river Itter
is placed in the installation directory of GREAT-ER Preprocessing.
You can copy it to a location where you have write access and use it
as an example.

\begin{center}
\Fig{\includegraphics[scale=\imagescale]{images/gpp1.png}}{
     Catchment folder selection dialog}
\end{center}

Once a folder is selected the Wizard will start.

\begin{center}
\Fig{\includegraphics[scale=\imagescale]{images/gpp2.png}}{
     Wizard welcome screen}
\end{center}

The next page allows you to enter/modify more details with
regard to the catchment.
\begin{center}
\Fig{\includegraphics[scale=\imagescale]{images/gpp3.png}}{
     Catchment Configuration dialog}
\end{center}

A syntax check is then performed to see if all files are in
the correct format.
Clicking next in this dialog will start the Preprocessing.
\begin{center}
\Fig{\includegraphics[scale=\imagescale]{images/gpp4.png}}{
    Syntax Check}
\end{center}

During the Preprocessing a window will open in the background
containing more technical and detailed information about
the Preprocessing. It can be useful in case of errors.
\begin{center}
\Fig{\includegraphics[scale=\imagescale]{images/gpp5.png}}{
    Preprocessing Detailed Output}
\end{center}

When the preprocessing is completed you can close the Wizard
and upload the catchment into the database.

\section{Integrate a catchment into GREAT-ER}

This section describes how to upload a cachment
into the GREAT-ER Database.

Relevant values for the upload
(GISFILELIST, STRETCH\_TAB, DISCH\_TAB) should have been written into
catchment.desc by the GREAT-ER Preprocessing script

The upload process will perform the following steps:
\begin{itemize}
\item Create a new Catchment entry in the CATCH\_TAB.
\item Upload all stretch data into STRETCH\_TAB (including appropriate
      conversion).
\item Upload all discharge data into DISCH\_TAB (including appropriate
      conversion).
\item Upload all GIS data (shapefiles) and additional binary files.
\end{itemize}

To start the upload process either run "Upload Catchment" from the
Start Menu or execute upload-cachment.py from your greater-pre-processing
directory.

The wizard will first ask for the directory containing the catchment.desc
\begin{center}
\Fig{\includegraphics[scale=\imagescale]{images/upload1.png}}{
     Catchment folder selection dialog}
\end{center}

On the next page you will be asked to enter the database credentials.
In a default Microsoft Windows installation those are user greater
with password greater for the database greater.

\begin{center}
\Fig{\includegraphics[scale=\imagescale]{images/upload3.png}}{
     Database connection settings}
\end{center}

The upload confirmation checked some additional values to ensure
that your data is correctly prepared and ready to be uploaded.
Selecting "Next" in this dialog will start the upload.
\begin{center}
\Fig{\includegraphics[scale=\imagescale]{images/upload4.png}}{
     Upload confirmation}
\end{center}

After displaying the progress, the wizard is finished and the
new catchment has been added to the database.
