Index: /trunk/doc/psphot/psphot.tex
===================================================================
--- /trunk/doc/psphot/psphot.tex	(revision 30592)
+++ /trunk/doc/psphot/psphot.tex	(revision 30593)
@@ -159,4 +159,6 @@
 Python).
 
+\note{discuss the psphot program varients}
+
 \section{PSPhot Design Goals}
 
@@ -276,15 +278,15 @@
 \end{itemize}
 
-Note that a given run of PSPhot \note{should} allow the user to
-perform any of these stages as an option.  For example, the PSF model
-may already be available from external information, in which case the
-PSF modeling stage can be skipped.  Or, when used as a library
-function, the image may have already been loaded and the mask and
-weight images constructed.  In some implementations, it may be
-possible to skip the initial object detection stage because only
-supplied sources are measured.  These are only some of the possible
-configurations.  The use of these different configurations depends on
-the source of the image, the desired detail and speed of the
-processing, and the level of accuracy desired from the analysis.
+Note that a given run of PSPhot allows the user to perform many of
+these stages only if needed.  For example, the PSF model may already be
+available from external information, in which case the PSF modeling
+stage can be skipped.  Or, when used as a library function, the image
+may have already been loaded and the mask and weight images
+constructed.  In some implementations, it may be possible to skip the
+initial object detection stage because only supplied sources are
+measured.  These are only some of the possible configurations.  The
+use of these different configurations depends on the source of the
+image, the desired detail and speed of the processing, and the level
+of accuracy desired from the analysis.
 
 \subsection{Image Preparation}
@@ -292,8 +294,8 @@
 The first step is to prepare the image for detection of the
 astronomical objects.  We need three separate images: the measured
-flux, the corresponding noise level, and a mask defining which pixels
-are valid and which should be ignored.  For the stand-alone program,
-the input flux image is a required program argument.  When it is
-loaded, it is converted by default to 32-bit floating point
+flux, the corresponding variance image, and a mask defining which
+pixels are valid and which should be ignored.  For the stand-alone
+program, the input flux image is a required program argument.  When it
+is loaded, it is converted by default to 32-bit floating point
 representation.  In the function-call form of PSPhot, the image must
 be supplied by the user in 32-bit floating point format.  The noise
@@ -307,7 +309,10 @@
 automatically by PSPhot.
 
-For the mask, we use an 8-bit image in which a value of 0 represents a
-valid pixel.  We use each of the 8 bits to define different reasons a
-pixel should be ignored.  This allows use to optionally respect or
+\note{describe the use of the covariance image}
+\note{describe the difference between 'bad' and 'suspect' pixels}
+
+For the mask, we use a 16-bit image in which a value of 0 represents a
+valid pixel.  We use each of the 16 bits to define different reasons a
+pixel should be ignored.  This allows us to optionally respect or
 ignore the mask depending on the circumstance.  For example, in some
 cases, we ignore saturated pixels completely while in other
@@ -325,7 +330,5 @@
 \code{XMIN}, \code{XMAX}, \code{YMIN}, \code{YMAX}.
 
-\note{Mask values are currently hard-wired numbers.  We need a method
-  for user-defined mask values to be supplied.  PSLib needs to have a
-  mask registration system.}
+\note{discuss the mask.config file, in which the mask meanings are assigned to bit values}
 
 The noise image, if not supplied is constructed by default from the
@@ -337,5 +340,5 @@
 valid.  For example, if the input flux image is the result of an image
 stack with significantly variable number of input measurements per
-pixel, it will necessary to supply a noise image which accurately
+pixel, it will be necessary to supply a noise image which accurately
 represents the noise as a function of position in the image.
 
@@ -343,13 +346,13 @@
 
 The objects are initially detected by finding the location of local
-peaks in the image.  The flux image is smoothed with a very small
-circularly symmetric kernel using a two-pass 1D Gaussian.  At this
+peaks in the image.  The flux and variance images are smoothed with a
+small circularly symmetric kernel using a two-pass 1D Gaussian
+(\note{KEYWORD?}).  The smoothed flux and variance images are combined
+to generate a significance image in signal-to-noise units
+\note{including correction for the covariance, if known}. At this
 stage, the goal is only to detect the brighter sources, above a user
 defined S/N limit (configuration keyword: \code{PEAK_NSIGMA}).  The
 detection efficiency for the brighter sources is not strongly
 dependent on the form of this smoothing function.
-
-\note{Is this smoothing needed?  we could save time here by skipping
-it.}
 
 The local peaks in the smoothed image are found by first detecting
@@ -364,8 +367,15 @@
 the maximum $X$ and $Y$ corners of the region.
 
-\note{The current implementation ignores the S/N map in making the
-peak detection.  This code must be modified (a la Kaiser) to be used
-for a peak-detection pass in a difference image or to re-find peaks in
-the image after the modeled objects have been subtracted}.
+\subsection{Footprints}
+
+\note{need to describe the process of generating the source footprints
+  and then culling the insignificant peaks}
+
+\subsubsection{Moments and related}
+
+\note{disucss the Kron mags}
+
+\note{this section is wrong: we no longer use S/N clipping, but a
+  Gaussian window function, chosed based on the measured moment}
 
 Once a collection of peaks have been identified, basic properties of
@@ -391,4 +401,7 @@
 
 \subsubsection{Determination of the Peak Coordinates and Errors}
+
+\note{this section is wrong: it is a poor estimator of the source
+  position errors.  we gave up a reverted to using the FWHM / (S/N)}
 
 We use the 9 pixels which include the source peak to fit for the
@@ -605,8 +618,9 @@
 the minimization values.  PSPhot uses the first and second moments to
 make a good guess for the centroid and shape parameters for the PSF
-models.  In order to minimize the impact of close neighbors, the noise
-values used in the fit are enhanced by a fraction of the deviation of
-the particular pixel value from the model guess.  Any objects which
-fail to converge in the fit are flagged as invalid.
+models.  \note{still true? In order to minimize the impact of close
+  neighbors, the noise values used in the fit are enhanced by a
+  fraction of the deviation of the particular pixel value from the
+  model guess.}  Any objects which fail to converge in the fit are
+flagged as invalid.
 
 \note{does the noise enhancement introduce too much bias?}
@@ -1044,7 +1058,4 @@
 
 \subsection{Difference Images}
-
-\note{much of this discussion is theoretical: PSPhot can incorporate
-  these modifications, but it currently does not.}
 
 The noise map for a difference image must be generated from the two
