Index: trunk/doc/release.2015/ps1.analysis/analysis.tex
===================================================================
--- trunk/doc/release.2015/ps1.analysis/analysis.tex	(revision 39864)
+++ trunk/doc/release.2015/ps1.analysis/analysis.tex	(revision 39865)
@@ -1,8 +1,8 @@
-% \documentclass[iop,floatfix]{emulateapj}
+\documentclass[iop,floatfix]{emulateapj}
 % \documentclass[iop,floatfix,onecolumn]{emulateapj}
 % \pdfoutput=1
 
 % see latex.readme.txt for notes on using the PS1 template
-\documentclass[12pt,preprint]{aastex}
+%\documentclass[12pt,preprint]{aastex}
 %\documentclass[manuscript]{aastex}
 %\documentclass[preprint2]{aastex}
@@ -35,5 +35,5 @@
 \def\CfA{2}
 \def\MPIA{3}
-\def\Princeton{3}
+\def\Princeton{2}
 \def\USNO{4}
 \def\JHU{1}
@@ -42,6 +42,12 @@
 \author{
 Eugene A. Magnier,\altaffilmark{\IfA}
-IPP Team,
-%PS Builder List
+R. H. Lupton,\altaffilmark{\Princeton}
+W.~E. Sweeney,\altaffilmark{\IfA}
+K.~C. Chambers,\altaffilmark{\IfA} 
+H.~A. Flewelling,\altaffilmark{\IfA}
+M. E. Huber,\altaffilmark{\IfA}
+P.~A. Price,\altaffilmark{\Princeton}
+C. Z. Waters,\altaffilmark{\IfA}
+PS1 Builders
 % W.~S. Burgett,\altaffilmark{\IfA}
 % K.~C. Chambers,\altaffilmark{\IfA} 
@@ -74,5 +80,5 @@
 \altaffiltext{\IfA}{Institute for Astronomy, University of Hawaii, 2680 Woodlawn Drive, Honolulu HI 96822}
 % \altaffiltext{\CfA}{Harvard-Smithsonian Center for Astrophysics, 60 Garden Street, Cambridge, MA 02138}
-% \altaffiltext{\Princeton}{Department of Astrophysical Sciences, Princeton University, Princeton, NJ 08544, USA}
+\altaffiltext{\Princeton}{Department of Astrophysical Sciences, Princeton University, Princeton, NJ 08544, USA}
 % \altaffiltext{\USNO}{US Naval Observatory, Flagstaff Station, Flagstaff, AZ 86001, USA}
 % \altaffiltext{\JHU}{Department of Physics and Astronomy, Johns Hopkins University, 3400 North Charles Street, Baltimore, MD 21218, USA}
@@ -299,5 +305,5 @@
 The PSPhot analysis is divided into several major stages:
 
-\begin{itemize}
+\begin{enumerate}
 \item {\bf Image preparation} Load data, characterize the image
   background, load or construct variance and mask images.
@@ -324,5 +330,5 @@
 \item {\bf Output} Write out objects in selected format, write out
   difference image, variance image, etc, as selected.
-\end{itemize}
+\end{enumerate}
 
 PSPhot is highly configurable.  Users may choose via the configuration
@@ -378,5 +384,5 @@
   al. paper} for additional information).
 
-\begin{table}
+\begin{table*}
 \caption{\label{tab:mask_values} PSPhot / GPC1 Mask Image Pixel Values}\vspace{-0.5cm}
 \begin{center}
@@ -406,5 +412,5 @@
 \end{tabular}
 \end{center}
-\end{table}
+\end{table*}
 
 The variance image, if not supplied is constructed by default from the
@@ -437,12 +443,13 @@
 pixels are used to measure the local background for each background
 grid point, thus over-sampling the background spatial variations by a
-factor of 2.  In the interest of speed, 10,000 randomly selected
-{\em unmasked} pixels in these regions are sampled to determine the
-background.  \note{flesh out the details here}.  Bilinear
-interpolation is used to generate a full-resolution image from the grid of
-background points, and this image is then subtracted from the science
-image.  The background image and the background standard deviation
-image are kept in memory from which the values of \code{SKY} and
-\code{SKY_SIGMA} are calculated for each object in the output catalog.
+factor of 2.  In the interest of speed, 10,000 randomly selected {\em
+  unmasked} pixels in these regions are sampled to determine the
+background.  Bilinear interpolation is used to generate a
+full-resolution image from the grid of background points, and this
+image is then subtracted from the science image.  The background image
+and the background standard deviation image are kept in memory from
+which the values of \code{SKY} and \code{SKY_SIGMA} are calculated for
+each object in the output catalog.  See also the discussion in
+\note{Waters et al REF}.
 
 \subsection{Initial Object Detection}
@@ -527,4 +534,13 @@
 \end{eqnarray}
 
+\begin{figure}[htbp]
+  \begin{center}
+  \includegraphics[width=\hsize,angle=0,clip]{peaks.ps}
+  \caption{Illustration of peak finding and culling peaks within a
+    footprint.  Insignificant peaks within the footprint of a brighter
+    peak are ignored in further processing. }
+  \end{center}
+\end{figure}
+
 \subsubsection{Footprints}
 
@@ -558,4 +574,21 @@
 \subsubsection{Centroid and higher-order Moments}
 
+\begin{figure}[htbp]
+  \begin{center}
+  \includegraphics[width=\hsize,angle=0,clip]{FWHM.smooth.trend.ps1.ps}
+  \caption{Example of the biases encountered when measuring the second
+    moments.  A simulated image was generated using the PS1 PSF
+    profile.  Each panel corresponds to a different value of
+    $\sigma_w$, as marked.  The solid red line is the true FWHM of the
+    PSF used to generate the stars.  The blue solid line is the FWHM
+    of the window function ($2.35\sigma_w$).  The gray dots are the
+    FWHM derived from the measured second moments for stars in the
+    image.  The dotted blue line is the target (65\% of the window
+    function).  In this example, we would choose $\sigma_w$ between
+    0.5 and 0.8 arcseconds so the dotted blue line would match the
+    bright end of the gray dots.}
+  \end{center}
+\end{figure}
+
 Once a collection of peaks has been identified, a number of basic
 properties of the objects related to the first and second moments are
@@ -566,23 +599,51 @@
 appropriate aperture in which the moments are measured.  We also apply
 a ``window function'', down-weighting the pixels by a Gaussian of size
-$\sigma_W$ which is chosen to be large compared to the PSF size.  The
-choice of the window function $\sigma_W$ and the aperture is an
+$\sigma_W$ which is chosen to be large compared to the PSF size,
+$\sigma_{\rm PSF}$.  This
+window function reduces the noise of the measurement of the first and
+second moments by suppressing the noisy pixels at high radial distance
+as well as by reducing the contaminating effects of neighboring stars.
+The choice of the window function $\sigma_W$ and the aperture is an
 iterative process: for a given value of $\sigma_W$, the PSF stars will
-have a measured value of $\sigma$ which is smaller than the true value
-due to the window function.  \note{generate examples to illustrate
-  this}.
+have a measured value of $\sigma_{\rm PSF}$ which is modified by the effect of
+the window function.  In addition, depending on the size of the window
+function compared to the true PSF size, the measured value of the PSF
+size, $\sigma_{\rm PSF}$, will be biased high or low depending on the
+signal-to-noise of the object.  
+
+These effects are illustrated in Figure~\ref{fig:moment.window} using
+simulated data.  An image was generated with a PSF model matching the
+radial profile of the PS1 PSF model with a FWHM of 1.4 arcseconds.  As
+the window function $\sigma_W$ is increased, the measured FWHM for the
+bright simulated stars rises to meet the truth value.  For small
+values of $\sigma_W$, fainter stars are biased to low measured values
+of the FWHM.  For large values of $\sigma_W$, the faint stars are
+biased to higher values and the scatter increases.
+
+In a real image, we do not know the true value of the PSF size.  If we
+simply choose a very large window function and rely on bright stars,
+our estimate of the PSF size will be quite noisy.  Compounding this
+problem are the two additional facts that (1) we do not know which are
+the real stars (as opposed to bright galaxies or possible image
+artifacts) and (2) the brighter stars are themselves subject to
+additional biases due to saturation and other non-linear effects
+(c.f., ``the Brighter-Fatter'' effect, REF).  To make a robust
+choice for the window function $sigma_w$, we choose a value
+such that the measured value of $\sigma_{\rm PSF}$ is 65\% of
+$\sigma_w$.  The resulting second moment values are biased somewhat
+low (\approx 75\% of the truth value for the PS1 PSF profile), but are
+relatively unbiased as a function of brightness.
 
 To choose the value of $\sigma_W$, we try values of (1, 2, 3, 4.5, 6,
-9, 12, 18) pixels \note{list arcseconds}.  For each of these values,
-we then select candidate PSF stars based on the distribution of the
-measured $\sigma_{x,x}, \sigma_{y,y}$ values.  For each test value of
-$\sigma_w$, determine the ratio $f = \frac{\sigma_{x,x} +
-  \sigma{y,y}}{2 \sigma_w}$, i.e., the ratio of the window size to the
-observed PSF size.  We interpolate to find a value of $\sigma_W$ for
-which $f$ is expected to be 0.65.  \note{what is the expected ratio of
-  $\sigma_x$ to the true value?}.  We call this value the
-\code{MOMENTS_GAUSS_SIGMA}.  We use an aperture with a radius of
-\code{PSF_MOMENTS_RADIUS} = 4$\times$ \code{MOMENTS_GAUSS_SIGMA} to
-select the pixels for the measurement.
+9, 12, 18) pixels $\approx$ (0.26, 0.51, 0.77, 1.15, 1.54, 2.3, 3.1,
+4.6) arcseconds.  For each of these values, we then select candidate
+PSF stars based on the distribution of the measured $\sigma_{x,x},
+\sigma_{y,y}$ values.  For each test value of $\sigma_w$, we determine
+the ratio $f = \frac{\sigma_{x,x} + \sigma{y,y}}{2 \sigma_w}$, i.e.,
+the ratio of the window size to the observed PSF size.  We interpolate
+to find a value of $\sigma_W$ for which $f$ is expected to be 0.65.
+We call this value the \code{MOMENTS_GAUSS_SIGMA}.  We use an aperture
+with a radius of \code{PSF_MOMENTS_RADIUS} = 4$\times$
+\code{MOMENTS_GAUSS_SIGMA} to select the pixels for the measurement.
 
 Once \code{PSF_MOMENTS_SIGMA} has been determined, moments are
@@ -656,8 +717,8 @@
 for example, a 2-D elliptical Gaussian:
 \begin{eqnarray}
-f(x,y) & = & I_o exp (-z) + S  \\
+f(x,y) & = & I_o e^{-z} + S  \\
     z  & = & \frac{x^2}{2\sigma_x^2} + \frac{y^2}{2\sigma_y^2} + \sigma_{\rm xy} x y \\
     x  & = & x_{\rm ccd} - x_o \\
-    y  & = & y_{\rm ccd} - y_o \\
+    y  & = & y_{\rm ccd} - y_o 
 \end{eqnarray}
 The object model will have a variety of model parameters, in this case
@@ -680,8 +741,5 @@
 \sigma_{\rm xy}$) while the independent parameters would be the
 centroid, normalization and local sky values ($x_o, y_o, I_o, S$).
-PSPhot uses a 2-D polynomial to specify the variation in the PSF
-parameters as a function of position in the image \note{or an
-  interpolated map}.  In the case of the elliptical Gaussian, this
-implies that the parameters are each a function of the object centroid
+Thus these parameters are each a function of the object centroid
 coordinates:
 \begin{eqnarray}
@@ -690,7 +748,23 @@
 \sigma_{xy} & = & f_3(x,y) \\
 \end{eqnarray}
-
-\note{PV3 config values: we used 6x6 map not 3x3 (PV2) or 3rd order
-  polynomial (PV1)}
+PSPhot represents the variation in the PSF parameters as a function of
+position in the image in two possible ways, specified by the
+configuration.  The first option is to use a 2-D polynomial which is
+fitted to the measured parameter values across the image.  The second
+option is to use a grid of values which are measured for objects
+within a subregion of the image.  In the latter case, the value at a
+specific coordinate in the image is determined by interpolation
+between the nearest grid points.  The order of the polynomial or the
+sampling size of the grid is dynamically determined depending on the
+number of available of PSF stars.  In the case of the PV3 analysis,
+the grid of values was used, with a maximum of $6\times 6$ samples per
+GPC1 chip image.  For the earlier PV2 analysis, the maximum grid
+sampling was $3\times 3$ per GPC1 chip image.  For the PV1 analysis,
+the polynomial representation was used, with up to 3rd order terms.
+The higher order representation was used for PV3 in order to follow
+some of the observed PSF variations in the images
+
+% XXX specify the rule for the polynomial order and grid scale
+% XXX discuss the improvements in the astrometric modeling PV1 - PV3
 
 PSPhot uses a single structure to represent the object model and
@@ -760,20 +834,21 @@
 their peaks, as well as an approximate signal-to-noise ratio.  All
 objects with a S/N ratio greater than a user-defined parameter
-(\code{PSF_SHAPE_NSIGMA} ???) are selected by PSPhot, though objects
-which have more than a certain number of saturated pixels are excluded
-at this stage.  PSPhot then examines the 2-D plane of $\sigma_x,
-\sigma_y$ in search of a concentrated clump of objects.  To do this,
-it constructs an artificial image with pixels representing the value
-of $\sigma_x, \sigma_y$, using a user-defined scale for the size of a
-pixel in this artificial image (note that the units of the $\sigma_x,
-\sigma_y$ plane are the size of the second-moment in pixels in the
-original image).  A typical value for the bin size is approximately
-0.1 image pixels.  The binned $\sigma_x, \sigma_y$ plane is then
-examined to find a peak which has a significance greater than XXX.
-Unless the image is extremely sparse, such a peak will be well-defined
-and should represent the objects which are all very similar in shape.
-Other objects in the image will tend to land in very different
-locations, failing to produce a single peak.  To avoid detecting a
-peak from the unresolved cosmic rays, objects which have
+(\code{PSF_SHAPE_NSIGMA} = 20.0) are selected by PSPhot, though
+objects which have more than a certain number of saturated pixels are
+excluded at this stage.  PSPhot then examines the 2-D plane of
+$\sigma_x, \sigma_y$ in search of a concentrated clump of objects (see
+Figure~\ref{fig:moment.class}).  To
+do this, it constructs an artificial image with pixels representing
+the value of $\sigma_x, \sigma_y$, using a user-defined scale for the
+size of a pixel in this artificial image (note that the units of the
+$\sigma_x, \sigma_y$ plane are the size of the second-moment in pixels
+in the original image).  A typical value for the bin size is
+approximately 0.1 image pixels.  The binned $\sigma_x, \sigma_y$ plane
+is then examined to find a peak which has a significance greater than
+XXX.  Unless the image is extremely sparse, such a peak will be
+well-defined and should represent the objects which are all very
+similar in shape.  Other objects in the image will tend to land in
+very different locations, failing to produce a single peak.  To avoid
+detecting a peak from the unresolved cosmic rays, objects which have
 second-moments very close to 0 are ignored.  The only danger is if the
 PSF is very small and too many of these objects are rejected as cosmic
@@ -785,13 +860,26 @@
 the image.  
 
+\begin{figure}[htbp]
+  \begin{center}
+  \includegraphics[width=\hsize,angle=0,clip]{moment.class.ps}
+  \caption{\label{fig:moment.class} Illustration of PSF star selection using the FWHM derived
+    from the second moments in $X_{\rm ccd}$ and $Y_{\rm ccd}$
+    directions.  The dominant clump is located in this diagram.
+    Galaxies tend to have a range of sizes and thus spread out above
+    the stars.  Cosmic rays also have a range of sizes, with one
+    dimension smaller than the PSF.  The red circle represents the PSF
+    star candidates. }
+  \end{center}
+\end{figure}
+
 \subsubsection{PSF Candidate Object Model Fits}
 
 All candidate PSF objects are then fitted with the selected object
 model, allowing all of the parameters (PSF and independent) to vary in
-the fit.  PSPhot uses the Levenberg-Marqardt method \note{REF, link to
-  psLibADD} for the non-linear fitting.  Non-linear fitting can be
-very computationally intensive, particularly for if the starting
-parameters are far from the minimization values.  PSPhot uses the
-first and second moments to make a good guess for the centroid and
+the fit.  PSPhot uses the Levenberg-Marquardt minimization technique
+\note{link to psLibADD} for the non-linear fitting.  Non-linear
+fitting can be very computationally intensive, particularly for if the
+starting parameters are far from 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.  Any objects which fail to
 converge in the fit are flagged as invalid.
@@ -830,11 +918,10 @@
 \subsection{Bright Source Analysis}
 
-\subsubsection{Very Bright Stars}
-\note{flesh out}
-
-The PSF modeling code fails to fit the wings of highly saturated stars
-if the core of the star is too contaminated by saturated pixels. For
-stars with estimated instrumental magnitudes brighter than XXX, we fit
-and subtract a radial profile modeled with a spline (?).
+%% \subsubsection{Very Bright Stars}
+%% 
+%% The PSF modeling code fails to fit the wings of highly saturated stars
+%% if the core of the star is too contaminated by saturated pixels. For
+%% stars with estimated instrumental magnitudes brighter than XXX, we fit
+%% and subtract a radial profile modeled with a spline (?).
 
 \subsubsection{Fast Ensemble PSF Fitting}
@@ -881,4 +968,6 @@
 \subsubsection{PSF Model applied to detected objects}
 
+\note{review the discussion below}
+
 Once a PSF model has been selected for an image, PSPhot attempts to
 fit all of the detected objects, above a user-defined signal-to-noise
@@ -886,13 +975,13 @@
 dependent parameters are fixed by the PSF model and only the 4
 independent object model parameters are allowed to vary in the fit.
-PSPhot again uses the Levenberg-Marqardt process for the non-linear
+PSPhot again uses Levenberg-Marquardt minimization for the non-linear
 fitting.  The objects are fitted in their S/N order, starting with the
 brightest and working down to the user-specified limit.
 
-Once a solution has been achieved, PSPhot attempts to judge the
-quality of the PSF model as a representation of the object shape.  To
-do this, it calculates the next step of the minimization {\em allowing
-  the shape parameters to vary}.  This step, essentially the
-Gauss-Newton minimization distance from the current local minimum,
+Once a solution has been achieved for an object, PSPhot attempts to
+judge the quality of the PSF model as a representation of the object
+shape.  To do this, it calculates the next step of the minimization
+{\em allowing the shape parameters to vary}.  This step, essentially
+the Gauss-Newton minimization distance from the current local minimum,
 should be very small if the object is well represented by the PSF, but
 large if the PSF is not a good representation of the object flux.  The
@@ -952,6 +1041,4 @@
 represented and may have larger residual significance. 
 
-\note{I am not sure the above discussion is still (PV3) true.  To be reviewed.}
-
 \subsubsection{Blended Sources}
 
@@ -1044,8 +1131,4 @@
 not modified.  
 
-\note{we have no code yet to select the best of several models for a
-  given objects.  The relative value of the Chi-Square is the obvious
-  test in this case}.
-
 \subsection{Faint Sources}
 
@@ -1060,10 +1143,9 @@
 
 The objects which are measured in this faint-object stage are clearly
-low significance detections.  A typical threshold for the bright
-object analysis would S/N of 5 - 10.  \note{PV3 value is 20.0?}  The
-lower limit cutoff for the faint object analysis would typically be
-S/N of 2 - 4.  \note{PV3 value is 5.0?}  Objects detected in the faint
-object stage are fitted with the PSF model using the linear, ensemble
-fitting process.
+low significance detections.  The PV3 threshold for the bright object
+analysis is a signal-to-noise of 20.  The lower limit cutoff for the
+faint object analysis in PV3 is a signal-to-noise of 5.0.  Objects
+detected in the faint object stage are fitted with the PSF model using
+the linear, ensemble fitting process.
 
 \subsection{Aperture Correction Measurement}
@@ -1114,5 +1196,7 @@
 number of very bright stars is limited in any image, and of course the
 brighter stars are more likely to suffer from non-linearity or
-saturation.  
+saturation.  PSPhot measures the aperture correction ({\em ApResid})
+for every PSF candidate object and applies this correction to the PSF
+model photometry.
 
 % How important is this effect?  Consider a typical bright object with a
@@ -1130,18 +1214,18 @@
 % magnitude}.
 
-PSPhot measures the aperture correction ({\em ApResid}) for every PSF
-candidate object, then calculates the trend of this correction as a
-function of the magnitude.  This trend is fitted with a line.  The
-resulting function can be used to determine the effective aperture
-correction for an infinite flux object and the average bias inherent
-in the sky measurement for the image.  The scatter of the
-PSF-candidate object measurements about this trend is a measure of how
-well we can measure photometry from the image by applying the specific
-PSF model.  The slope of this trend is a measure of the bias in the
-local sky measurment for each object.  In principal, the measured sky
-levels could be modified by this bias.  More generally, the measured
-bias in a collection of images could be used to improve the model
-fitting or sky fitting portion of the software the remove the bias
-term.
+%%% PSPhot measures the aperture correction ({\em ApResid}) for every PSF
+%%% candidate object, then calculates the trend of this correction as a
+%%% function of the magnitude.  This trend is fitted with a line.  The
+%%% resulting function can be used to determine the effective aperture
+%%% correction for an infinite flux object and the average bias inherent
+%%% in the sky measurement for the image.  The scatter of the
+%%% PSF-candidate object measurements about this trend is a measure of how
+%%% well we can measure photometry from the image by applying the specific
+%%% PSF model.  The slope of this trend is a measure of the bias in the
+%%% local sky measurment for each object.  In principal, the measured sky
+%%% levels could be modified by this bias.  More generally, the measured
+%%% bias in a collection of images could be used to improve the model
+%%% fitting or sky fitting portion of the software the remove the bias
+%%% term.
 
 PSPhot allows a collection of PSF model functions to be tried on all
@@ -1154,4 +1238,35 @@
 \code{PSF_MODEL_N - 1} specify the names of the models which should be
 tested.
+
+Several likely PSF model classes are available within \code{psphot}:
+\begin{itemize}
+\item Gaussian : $f = I_0 e^{-z}$
+\item Pseudo-Gaussian : $f = I_0 (1 + z + \frac{1}{2} z^2 + \frac{1}{6} z^3)^{-1}$ \code{[PGAUSS]}
+\item Variable Power-Law : $f = I_0 (1 + z + z^{\alpha})^{-1}$ \code{[RGAUSS]}
+\item Steep Power-Law : $f = I_0 (1 + \kappa z + z^{2.25})^{-1}$ \code{[QGAUSS]}
+\item PS1 Power-Law : $f = I_0 (1 + \kappa z + z^{1.67})^{-1}$ \code{[PS1_V1]}
+\end{itemize}
+where $z \propto r^2$ ($z = \frac{x^2}{2\sigma_x^2} +
+\frac{y^2}{2\sigma_y^2} + \sigma_{\rm xy} x y $).  The Pseudo-Gaussian
+is a Taylor expansion of the Gaussian and is used by Dophot
+\citep{dophot}.  The latter profiles are similar to the Moffat profile
+form \citep{moffat,buonanno}, with small differences.  For the PS1
+GPC1 analysis, we used the \code{PS1_V1} model, which we found by
+experimentation to match well to the observed profiles generated by
+PS1.  Using a fixed power-law exponent results in somewhat faster
+profile fitting compared to the variable power-law exponent model.
+
+% moffat : 1969A&A.....3..455M
+% buonanno : 1983A&AS...51...83B
+
+\begin{figure}[htbp]
+  \begin{center}
+  \includegraphics[width=\hsize,angle=0,clip]{radial.profiles.ps}
+  \caption{Radial profiles of stellar images from PS1.  These two
+    profiles illustrate the radial trend of the PS1 PSFs for a star
+    with FWHM 0.9 arcsec (red) and 2.2 arcsec (blue).  The black line
+    shows the PSF model with radial trend of the form $(1 + \kappa r^2 + r^{3.33})^{-1}$.}
+  \end{center}
+\end{figure}
 
 \subsection{Radial Profiles}
@@ -1380,5 +1495,5 @@
 
 The PSF-convolved galaxy model fitting analysys uses the
-Levenberg-Marquardt method to determine the best fit.  In this
+Levenberg-Marquardt minimization method to determine the best fit.  In this
 process, the $\chi^2$ value to be minimized is:
 \[
@@ -1604,29 +1719,18 @@
 Figures Needed for this document:
 
-* illustration of peak & col for footprint
-* measured moments vs gauss window size for PS1 profile
-* PS1 PSF profiles (good and bad seeing)
-* Mxx vs Myy plane for selecting PSF stars (etc)
-* example of a very bright star, subtracted?
-* CR masking example?
 * aperture - PSF model example
-* make of the sky with galaxy region illustrated?
-
+* map of the sky with galaxy region illustrated?
 * plots showing the quality of the data?
 
 Tables needed:
 
-* table of mask image bit values
 * table of models?
 
 Work still needed:
 
-* Figures
 * Tables
 * refereces for other programs
 
-* moments & gauss sigma issue
-* words on the 2d maps
-* PS1 PSF profile discussion
+* authors
 * PSF residual map
 * section 3.5.3 Model applied to detected objects needs to be reviewed
@@ -1639,2 +1743,15 @@
 * reduce coding description?
 * put engineering docs (psLib, psModules) on public website 
+
+% example of 2 image figure:
+\begin{figure}
+  \centering
+  \begin{minipage}{0.45\hsize}
+    \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0123o_XY11_bt_trail.png}
+  \end{minipage}%
+  \begin{minipage}{0.45\hsize}
+    \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0124o_XY11_bt_trail.png}
+  \end{minipage}
+  \caption{Example of a profile cut along the y-axis through a bright star on exposure o5677g0123o OTA11 in cell xy60 (left panel) and on the subsequent exposure o5677g0124o (right panel).  In both figures, the green points show the image corrected with all appropriate detrending steps, but without burntool applied, illustrating the amplitude of the persistence trails.  The red points show the same data after the burntool correction, which reduces the impact of these features.  Both exposures are in the \gps{} filter with exposure times of 43s}
+\end{figure}
+
Index: trunk/doc/release.2015/ps1.analysis/plots.sh
===================================================================
--- trunk/doc/release.2015/ps1.analysis/plots.sh	(revision 39864)
+++ trunk/doc/release.2015/ps1.analysis/plots.sh	(revision 39865)
@@ -1,4 +1,17 @@
+
+macro choose.seed
+
+  for i 0 100
+    rndseed $i
+    peak.and.col 
+    echo $i
+    cursor
+  end
+end
 
 macro peak.and.col
+
+  # using 3 gives a pretty look
+  rndseed 3
 
   $scale = 50.0
@@ -6,5 +19,5 @@
   $Ia = 500; $Xa = 100
   $Ib = 100 ; $Xb = 50
-  $Ic = 30  ; $Xc = 180
+  $Ic = 20  ; $Xc = 180
 
   create x 0 200
@@ -22,9 +35,13 @@
   
   clear -s
-  section a 0.0 0.5 1.0 0.5
-  lim x yo; box; plot x yo -x hist
+  resize 1200 600
+  label -fn helvetica 24
+  section a 0.0 0.5 1.0 0.45
+  lim x yo; box -lw 2 -xpad 0.5 -labels 0100 -ticks 1100; plot x yo -x hist -lw 2
+  label -y "Raw Counts"
 
-  section b 0.0 0.0 1.0 0.5
-  lim x yo; box; plot x ym -x hist
+  section b 0.0 0.0 1.0 0.55
+  lim x yo; box -lw 2 +xpad 0.5 -xpad 3.5 -labelpadx 3.0 -ticks 1100; plot x ym -x hist
+  label -y "Smoothed Counts" -x "Pixel Coordinate"
 
   set yd = 500 - ym
@@ -32,18 +49,21 @@
   $dX = 5
   peak x ym {$Xa - $dX} {$Xa + $dX}
-  line -c red $peakpos {$peakval + 10} to $peakpos $YMAX
+  line -c red $peakpos {$peakval - 10} to $peakpos 400; textline 90 350 "Primary Peak"
 
   peak x ym {$Xb - $dX} {$Xb + $dX}
-  line -c red $peakpos {$peakval + 10} to $peakpos $YMAX
+  line -c red $peakpos {$peakval + 10} to $peakpos 350; textline 30 400 "Significant Peak"
 
   peak x ym {$Xc - $dX} {$Xc + $dX}
-  line -c red $peakpos {$peakval + 10} to $peakpos $YMAX
+  line -c red $peakpos {$peakval + 10} to $peakpos 250; textline 160 300 "Insignificant Peak"
 
   $dX = 5
   peak x yd $Xb {$Xb + 2*$dX}
-  line -c blue $peakpos {ym[$peakpos] - 10} to $peakpos $YMIN
+  line -c blue $peakpos {ym[$peakpos] - 10} to $peakpos 150; textline 50 100 "Col"
 
   peak x yd {$Xc - 2*$dX} $Xc 
-  line -c blue $peakpos {ym[$peakpos] - 10} to $peakpos $YMIN
+  line -c blue $peakpos {ym[$peakpos] + 10} to $peakpos 150; textline 170 190 "Col"
+
+  png -name peaks.png
+  ps  -name peaks.ps
 
 end
Index: trunk/doc/release.2015/ps1.calibration/calibration.tex
===================================================================
--- trunk/doc/release.2015/ps1.calibration/calibration.tex	(revision 39864)
+++ trunk/doc/release.2015/ps1.calibration/calibration.tex	(revision 39865)
@@ -1180,4 +1180,6 @@
 * bright-end photometry residuals [running cdhist code, but is the density too low?]
 
+* careful discussion of calibration wrt scolnic et al
+
 \end{verbatim}
 
Index: trunk/doc/release.2015/ps1.datasystem/datasystem.tex
===================================================================
--- trunk/doc/release.2015/ps1.datasystem/datasystem.tex	(revision 39864)
+++ trunk/doc/release.2015/ps1.datasystem/datasystem.tex	(revision 39865)
@@ -853,2 +853,6 @@
 
 \end{document}
+
+Figures needed for this document:
+
+* 
