% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/db_extract_subcatch.R
\name{db_extract_subcatch}
\alias{db_extract_subcatch}
\title{Extracts sub-catchment(s) for specific subbasin(s) from a database}
\usage{
db_extract_subcatch(dbname = NULL, sub_extract = NULL,
  dbname_new = NULL, verbose = T)
}
\arguments{
\item{dbname}{Name of the data source (DSN) registered at ODBC. See \code{Details} of
\code{\link[lumpR]{db_create}}.}

\item{sub_extract}{\code{vector} of type numeric with the 'pid'(s) of table
'subbasins' in database \code{dbname} for which the associated sub-catchments
shall be extracted.}

\item{dbname_new}{\code{vector} of type character with the names of the databases
containing the extracted sub-catchments. Database need to be registered for ODBC
(see \code{Details} of \code{\link[lumpR]{db_create}}).}

\item{verbose}{\code{logical}. Should detailed information during execution be
printed? Default: \code{TRUE}.}
}
\value{
Function returns nothing. Only the databases are processed.
}
\description{
This function extracts the sub-catchment(s) for selected subbasin(s) from an
existing and fully pre-processed WASA-SED parameter database.
}
\details{
The function first copies the original databse. Then the upstream subbasins
of the selected outlet subbasin are identified and the copied database is pruned
accordingly. The latter only affects the tables subbasins, landscape_units,
terrain_components, r_subbas_contains_lu, r_lu_contains_tc and r_tc_contains_svc.
Thus, the other tables may contain redundant information which are contained to
limit the processing time and retain the opportunity to (re-)include information
later on.
}
\author{
Tobias Pilz \email{tpilz@uni-potsdam.de}
}
