Index: trunk/doc/modules/ModulesSDRS.tex
===================================================================
--- trunk/doc/modules/ModulesSDRS.tex	(revision 1566)
+++ trunk/doc/modules/ModulesSDRS.tex	(revision 1805)
@@ -1,3 +1,3 @@
-%%% $Id: ModulesSDRS.tex,v 1.14 2004-08-17 03:31:05 eugene Exp $
+%%% $Id: ModulesSDRS.tex,v 1.15 2004-09-14 19:42:32 eugene Exp $
 \documentclass[panstarrs]{panstarrs}
 
@@ -10,5 +10,5 @@
 \project{Pan-STARRS Image Processing Pipeline}
 \organization{Institute for Astronomy}
-\version{00}
+\version{01}
 \docnumber{PSDC-430-008}
 % note the use of the docnumber & version number:
@@ -265,9 +265,9 @@
 \subsection{Flat-fielding}
 
-Given an input image and a flat-field image, \code{pmFlatField}
-shall divide the input image by the flat-field image.  The API shall
-be the following:
-\begin{verbatim}
-psReadout *pmFlatField(psReadout *in, const psReadout *flat);
+Given an input image and a flat-field image, \code{pmFlatField} shall
+divide the input image by the flat-field image and return it in place,
+updating the mask as appropriate.  The API shall be the following:
+\begin{verbatim}
+bool pmFlatField(psReadout *in, psReadout *mask, const psReadout *flat);
 \end{verbatim}
 
@@ -275,10 +275,15 @@
 \code{flat}, need not be the same size, since the input image may
 already have been trimmed (following overscan subtraction), but the
-function shall use the offsets in the image (\code{in->x0} and
-\code{in->y0}) to determine the appropriate offsets to obtain the
-correct pixel on the flat-field.  In the event that the \code{flat}
-image is too small (i.e., pixels on the input image refer to pixels
-outside the range of the \code{flat} image), the function shall
-generate an error.
+function shall use the offsets of the readout (\code{in->col0,
+in->row0}) and the image subarray (\code{in->image->x0,
+in->image->y0}) to determine the appropriate offsets to obtain the
+correct detector pixels in the flat-field image.  Note that the image
+offset is relative to its parent, so this offset must be followed to
+the top level image which is not a child of another image and the
+offsets summed.  The detector pixel coordinates of pixel \code{x,y} in
+a top-level image are thus \code{x + in->image->x0 + in->col0, y +
+in->image->y0 + in->row0}. In the event that the \code{flat} image is
+too small (i.e., pixels on the input image refer to pixels outside the
+range of the \code{flat} image), the function shall generate an error.
 
 Pixels which are negative or zero in the \code{flat} shall be masked
@@ -347,4 +352,7 @@
 input image refer to pixels outside the range of the \code{mask}
 image), the function shall generate an error.
+
+\section{Revision Change Log}
+\input{ChangeLogSDRS.tex}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
