Index: trunk/doc/modules/ModulesSDRS.tex
===================================================================
--- trunk/doc/modules/ModulesSDRS.tex	(revision 5367)
+++ trunk/doc/modules/ModulesSDRS.tex	(revision 5369)
@@ -1,3 +1,3 @@
-%%% $Id: ModulesSDRS.tex,v 1.62 2005-10-18 20:15:05 eugene Exp $
+%%% $Id: ModulesSDRS.tex,v 1.63 2005-10-18 22:16:41 eugene Exp $
 \documentclass[panstarrs,spec]{panstarrs}
 
@@ -1205,5 +1205,45 @@
 \end{itemize}
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsection{Detrend Lookups}
+
+When it comes time to perform a detrend operation on an image, it is
+necessary to determine {\em which} detrend image should be used.  The
+Pan-STARRS Image Processing Pipeline uses the concept of a detrend
+image database table, or set of tables (part of the Metadata
+Database), to store the known master detrend images.  These tables can
+be accessed though the basic query functions specified for the master
+detrend database.  To simplify the interaction for the case of the
+detrend images, the following function allows the user to explicitly
+search the detrend database table or tables for detrend images which
+satisfy a set of characteristics.
+
+\begin{prototype}
+psArray *pmDetrendLookup (psMetadata *constraints, psMetadata *tableDefs);
+\end{prototype}
+This function accepts a metadata structure which restricts the
+selected detrend images.  This metadata structure may contain any of
+the following entries:
+\begin{verbatim}
+TYPE        type of detrend data (eg, flat, bias) 
+CAMERA      name of desired camera (eg, GPC, MEGACAM)
+CHIP        chip identifier (eg., ccd00)
+FILTERNAME  name of specific filter hardware (eg, r.GPC01)
+FILTERTYPE  conceptual name of filter (eg., r)
+TIME_MIN    lower bound on valid time range 
+TIME_MAX    upper bound on valid time range 
+LABEL       match the entry label
+RECIPE      recipe used to build detrend image
+EXPTIME     exposure time 
+AIRMASS     airmass 
+\end{verbatim}
+Any detrend images which match the provided constraints are returned
+as an array of \code{psMetadata} elements corresponding to the columns
+of the detrend database table.  The additional input parameter
+specifies additional information to define the detrend database
+tables.  This may include the access information (IP, Username,
+Password), as well as names for the table and the columns which
+correspond to the constraint names.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 \section{Detrend Creation}
