Index: trunk/doc/release.2015/ps1.analysis/Makefile
===================================================================
--- trunk/doc/release.2015/ps1.analysis/Makefile	(revision 39866)
+++ trunk/doc/release.2015/ps1.analysis/Makefile	(revision 39868)
@@ -1,19 +1,29 @@
 # $Id: Makefile,v 1.16 2006-01-16 01:11:40 eugene Exp $
+
+DO_PDFLATEX = 0
+DO_BIBTEX = 1
 
 help:
 	@echo "USAGE: make (target)"
-	@echo "  targets:  all analysis"
+	@echo "  targets:  all pdf tgz"
 
-all: analysis.pdf
-analysis: analysis.pdf
+all: pdf tgz 
+pdf: analysis.pdf
+tgz: analysis.tgz
 
-ANALYSIS = analysis.tex 
+FILES = \
+../inputs/astro.sty \
+../inputs/code.sty \
+../inputs/apj.bst \
+../inputs/lib.bib \
+peaks.ps \
+FWHM.smooth.trend.ps1.ps \
+moment.class.ps \
+radial.profiles.ps \
+analysis.tex \
+analysis.bbl
 
-#       pics/Metadata.ps 
-#       pics/earthrot.ps
-
-analysis.pdf: $(ANALYSIS)
-
-analysis.ps: $(ANALYSIS)
+analysis.pdf: $(FILES)
+analysis.tgz: $(FILES)
 
 include ../Makefile.Common
Index: trunk/doc/release.2015/ps1.analysis/analysis.tex
===================================================================
--- trunk/doc/release.2015/ps1.analysis/analysis.tex	(revision 39866)
+++ trunk/doc/release.2015/ps1.analysis/analysis.tex	(revision 39868)
@@ -1,11 +1,6 @@
 \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[manuscript]{aastex}
-%\documentclass[preprint2]{aastex}
-%\documentclass[preprint2,longabstract]{aastex}
 \RequirePackage{color}
 \RequirePackage{code}
@@ -18,4 +13,5 @@
 %\def\plotext{pdf}
 \def\plotext{ps}
+\def\plottype{eps}
 
 %\def\picdir{/home/eugene/chipresid.20140404}
@@ -33,14 +29,12 @@
 % list and (2) re-order the list at the bottom (and comment-out as needed)
 \def\IfA{1}
+\def\Princeton{2}
+\def\DUR{3}
 \def\CfA{2}
-\def\MPIA{3}
-\def\Princeton{2}
-\def\USNO{4}
-\def\JHU{1}
 
 % This example has a first author from UH:
 \author{
 Eugene A. Magnier,\altaffilmark{\IfA}
-R. H. Lupton,\altaffilmark{\Princeton}
+% R. H. Lupton,\altaffilmark{\Princeton}
 W.~E. Sweeney,\altaffilmark{\IfA}
 K.~C. Chambers,\altaffilmark{\IfA} 
@@ -49,36 +43,31 @@
 P.~A. Price,\altaffilmark{\Princeton}
 C. Z. Waters,\altaffilmark{\IfA}
-PS1 Builders
+% PS1 Builders
+L. Denneau,\altaffilmark{\IfA}
+P. Draper,\altaffilmark{\DUR}
+R. Jedicke,\altaffilmark{\IfA}
+K. W. Hodapp,\altaffilmark{\IfA}
+R.-P. Kudritzki,\altaffilmark{\IfA}
+N. Metcalfe,\altaffilmark{\DUR}
+C.~W. Stubbs,\altaffilmark{\CfA}
 % W.~S. Burgett,\altaffilmark{\IfA}
-% K.~C. Chambers,\altaffilmark{\IfA} 
-% L. Denneau,\altaffilmark{\IfA}
-% P. Draper,\altaffilmark{\DUR}
-% H.~A. Flewelling,\altaffilmark{\IfA}
 % T. Grav,\altaffilmark{\IfA}
 % J. N. Heasley,\altaffilmark{\IfA}
-% K. W. Hodapp,\altaffilmark{\IfA}
-% M. E. Huber,\altaffilmark{\IfA}
-% R. Jedicke,\altaffilmark{\IfA}
 % N. Kaiser,\altaffilmark{\IfA}
-% R.-P. Kudritzki,\altaffilmark{\IfA}
 % G. A. Luppino,\altaffilmark{\IfA}
 % R. H. Lupton,\altaffilmark{\Princeton}
 % E. A. Magnier,\altaffilmark{\IfA}
-% N. Metcalfe,\altaffilmark{\DUH}
 % D. G. Monet,\altaffilmark{\USNO}
 % J.~S. Morgan,\altaffilmark{\IfA}
 % P. M. Onaka,\altaffilmark{\IfA}
-% P.~A. Price,\altaffilmark{\Princeton}
-% C.~W. Stubbs,\altaffilmark{\CfA}
-% W.~E. Sweeney,\altaffilmark{\IfA}
 % J.~L. Tonry, \altaffilmark{\IfA}
-% R. J. Wainscoat,\altaffilmark{\IfA} and 
-% C. Z. Waters,\altaffilmark{\IfA}
+R. J. Wainscoat\altaffilmark{\IfA}
 } % this bracket terminates author list
 
 % The ordering here should be sequential, matching the sequence in the list of authors:
 \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{\DUR}{Department of Physics, Durham University, South Road, Durham DH1 3LE, UK}
+\altaffiltext{\CfA}{Harvard-Smithsonian Center for Astrophysics, 60 Garden Street, Cambridge, MA 02138}
 % \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}
@@ -157,4 +146,14 @@
 described in detail in \cite{2012ApJ...750...99T}.
 
+{\color{red} {\em Note: These papers are being placed on arXiv.org to
+    provide crucial support information at the time of the public
+    release of Data Release 1 (DR1). We expect the arXiv versions to
+    be updated prior to submission to the Astrophysical Journal in
+    January 2017. Feedback and suggestions for additional information
+    from early users of the data products are welcome during the
+    submission and refereeing process.}}
+
+\section{Background}
+
 The photometric and astrometric precision goals for the Pan-STARRS\,1
 surveys were quite stringent: photmetric accuracy of 10
@@ -183,6 +182,4 @@
 astrometry.
 
-\subsection{Comparable Programs}
-
 A variety of astronomical software packages perform the basic object
 detection, measurement, and classification tasks needed by the
@@ -198,25 +195,22 @@
   pro: well-tested, stable code.  con: limited range of models,
   algorithm converges slowly to a PSF model, limited tests of PSF
-  validity, inflexible code base, fortran (P. Schechter)
+  validity, inflexible code base, fortran \citep{1993PASP..105.1342S}.
 
 \item DAOPhot : Pixel-map PSF model with analytical component.  pro:
   well-tested, high-quality photometry.  con: Difficult to use in an
-  automated fashion, does it handle 2D variations well? (P. Stetson)
+  automated fashion, does it handle 2D variations well? \citep{1987PASP...99..191S}.
 
 \item Sextractor : pure aperture measurement with rudimentary object
   subtraction.  pro: fast, widely used, easy to automate.  con: poor
   object separation in crowded regions, PSF-modeling was only in beta,
-  not widely used at the time. (E. Bertin)
-
-\item apphot : IRAF-based aperture photometry.  pro: widely used.
-  con: IRAF-based, aperture photometry. (???)
+  not widely used at the time \citep{sextractor}.
 
 \item galfit : detailed galaxy modeling.  not a multi-object PSF
   analysis tool.  con: does not provide a PSF model, not easily
   automated.  very detailed results in very slow processing.  only a
-  galaxy analysis program. (C. Impey)
+  galaxy analysis program \citep{2002AJ....124..266P}.
 
 \item SDSS phot : con: tightly integrated into the SDSS software
-  environment.  (R. Lupton)
+  environment \citep{2001ASPC..238..269L}.
 
 \end{itemize}
@@ -425,6 +419,6 @@
 subtracted might be useful for detection or even analysis of brighter
 sources.  Table~\ref{tab:mask_values} lists the 16 bit values used for
-PS1 mask images, along with their description (see \note{Waters et
-  al. paper} for additional information).
+PS1 mask images, along with their description \citep[see][for
+  additional information]{waters2017}.
 
 \begin{table*}
@@ -495,5 +489,5 @@
 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}.
+\cite{waters2017}.
 
 \subsection{Initial Object Detection}
@@ -580,6 +574,8 @@
 \begin{figure}[htbp]
   \begin{center}
-  \includegraphics[width=\hsize,angle=0,clip]{peaks.ps}
-  \caption{Illustration of peak finding and culling peaks within a
+%  \includegraphics[type=\plottype,ext=.\plotext,width=3.5in,height=2.5in,viewport=60 60 560 310]{peaks}
+% \includegraphics[type=\plottype,ext=.\plotext,width=\hsize,height=1in,viewport=60 60 560 310,clip]{peaks}
+  \includegraphics[type=\plottype,ext=.\plotext,width=\hsize,height=0.5\hsize,viewport=60 60 560 310,clip]{peaks}
+  \caption{\label{fig:peaks} Illustration of peak finding and culling peaks within a
     footprint.  Insignificant peaks within the footprint of a brighter
     peak are ignored in further processing. }
@@ -608,18 +604,20 @@
 \code{FOOTPRINT_CULL_NSIGMA_DELTA} (4.0) sigmas below the peak of
 interest, the peak is considered to be {\em locally insignificant} and
-removed from the list of possible detections.  In the vicinity of a
-saturated star, the rule is somewhat more agressive as the flat-topped
-or structured saturated top of a bright star may appear as multiple
-peaks with highly significant cols between them.  However, this is an
-artifact of the proximity to saturation.  In this regime, we require
-the col to also be a fixed fraction (5\%) of the saturation below the
-peak to avoid being marked as locally insignificant.
+removed from the list of possible detections (see
+Figure~\ref{fig:peaks}).  In the vicinity of a saturated star, the
+rule is somewhat more agressive as the flat-topped or structured
+saturated top of a bright star may appear as multiple peaks with
+highly significant cols between them.  However, this is an artifact of
+the proximity to saturation.  In this regime, we require the col to
+also be a fixed fraction (5\%) of the saturation below the peak to
+avoid being marked as locally insignificant.
 
 \subsubsection{Centroid and higher-order Moments}
+\label{sec: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
+  \includegraphics[type=\plottype,ext=.\plotext,width=\hsize,height=2.0\hsize,viewport=60 60 413 760]{FWHM.smooth.trend.ps1}
+  \caption{\label{fig:moments.window} 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
@@ -656,5 +654,5 @@
 signal-to-noise of the object.  
 
-These effects are illustrated in Figure~\ref{fig:moment.window} using
+These effects are illustrated in Figure~\ref{fig:moments.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
@@ -736,15 +734,16 @@
 these moments. 
 
-The Kron radius is defined the be 2.5$\times$ the first radial moment.
-The Kron flux is the sum of (sky-subtracted) pixel fluxes within the
-Kron radius.  We also calculate the flux in two related annular
-apertures: the Kron inner flux is the sum of pixel values for the
-annulus $R_1 < r < 2.5 R_1$, while the Kron outer flux is the sum of
-pixel values for $2.5 R_1 < r < 4 R_1$.  The first radial moment is
-limited at the low and high ends by $R_{\rm min} < M_r < R_{\rm max}$
-where $R_{\rm min}$ is the first radial moment of the PSF stars, or
-0.75$\times$ \code{MOMENTS_GAUSS_SIGMA} if that cannot be
-determined.  $R_{\rm max}$ is set to \code{PSF_MOMENTS_RADIUS}, the
-size of the moments aperture.
+The Kron radius \citep{1980ApJS...43..305K} is defined the be
+2.5$\times$ the first radial moment.  The Kron flux is the sum of
+(sky-subtracted) pixel fluxes within the Kron radius.  We also
+calculate the flux in two related annular apertures: the Kron inner
+flux is the sum of pixel values for the annulus $R_1 < r < 2.5 R_1$,
+while the Kron outer flux is the sum of pixel values for $2.5 R_1 < r
+< 4 R_1$.  The first radial moment is limited at the low and high ends
+by $R_{\rm min} < M_r < R_{\rm max}$ where $R_{\rm min}$ is the first
+radial moment of the PSF stars, or 0.75$\times$
+\code{MOMENTS_GAUSS_SIGMA} if that cannot be determined.  $R_{\rm
+  max}$ is set to \code{PSF_MOMENTS_RADIUS}, the size of the moments
+aperture.
 
 \subsection{PSF Determination}
@@ -906,5 +905,5 @@
 \begin{figure}[htbp]
   \begin{center}
-  \includegraphics[width=\hsize,angle=0,clip]{moment.class.ps}
+  \includegraphics[type=\plottype,ext=.\plotext,width=\hsize,height=\hsize,viewport=60 60 560 560]{moment.class}
   \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}$
@@ -919,8 +918,10 @@
 \subsubsection{PSF Candidate Object Model Fits}
 
+% \note{link to psLibADD}
+
 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-Marquardt minimization technique
-\note{link to psLibADD} for the non-linear fitting.  Non-linear
+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
@@ -1012,14 +1013,14 @@
 \subsubsection{PSF Model applied to detected objects}
 
-\note{review the discussion below}
+% \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
-ratio (\note{KEYWORD}) with the PSF model.  For these fits, the
-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 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.
+ratio with the PSF model.  For these fits, the 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
+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 for an object, PSPhot attempts to
@@ -1108,4 +1109,5 @@
 
 \subsubsection{Source Size Assessment}
+\label{sec:source.size}
 
 After the PSF model has been fitted to all sources, and the Kron flux
@@ -1294,10 +1296,14 @@
 \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.
+\citep{1993PASP..105.1342S}.  The latter profiles are similar to the
+Moffat profile form \citep{1969AA.....3..455M,1983AA...126..278B},
+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.
+Figure~\ref{fig:radial.profiles} shows example radial profiles for
+moderately bright stars in fairly good (0.9 arcsec) and poor (2.2
+arcsec) seeing.  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
@@ -1306,6 +1312,6 @@
 \begin{figure}[htbp]
   \begin{center}
-  \includegraphics[width=\hsize,angle=0,clip]{radial.profiles.ps}
-  \caption{Radial profiles of stellar images from PS1.  These two
+  \includegraphics[type=\plottype,ext=.\plotext,width=\hsize,height=\hsize,viewport=60 60 560 560]{radial.profiles}
+  \caption{\label{fig:radial.profiles} 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
@@ -1372,15 +1378,15 @@
 \code{RMAX_NN}).
 
-\note{these profiles are not saved in PSPS}
+% \note{these profiles are not saved in PSPS}
 
 \subsection{Petrosian Radii and Magnitudes}
 
-Petrosian (REF) defined an adaptive aperture based on a ratio of
-surface brightnesses.  The motivation is to define an aperture which
-can be determined for galaxies without significant biases as a
-function of distance.  Since surface brightness in a resolved object
-is conserved, using a ratio of surface brightness to define a spatial
-scale results in a spatial scale which is constant regardless of
-galaxy distance.  
+\cite{1976ApJ...209L...1P} defined an adaptive aperture based on a
+ratio of surface brightnesses.  The motivation is to define an
+aperture which can be determined for galaxies without significant
+biases as a function of distance.  Since surface brightness in a
+resolved object is conserved, using a ratio of surface brightness to
+define a spatial scale results in a spatial scale which is constant
+regardless of galaxy distance.
 
 To measure the Petrosian radius and flux, we start by defining a
@@ -1428,30 +1434,30 @@
 median) flux in the annulus is within 1 $\sigma$ of the local sky
 level.  If this limit is not reached before the slope of the flux from
-one annulus to the next is less that \note{SOMETHING,
-  psphotRadialProfileWings.c}, then the annulus at which the slope
-reaches this limit is used to define the sky radius.  These values are
-saved in the output smf / cmf files, but not sent to the PSPS.  The
-sky radius value is used below in the calculation of the kron magnitude.
+one annulus to the next is less than a user-defined limit, then the
+annulus at which the slope reaches this limit is used to define the
+sky radius.  These values are saved in the output smf / cmf files, but
+not sent to the PSPS.  The sky radius value is used below in the
+calculation of the kron magnitude.
 
 \subsection{Kron Magnitudes}
 
-Preliminary Kron radius and flux values are calculated soon after
-sources are detected (\ref{sec:moments}).  However, these preliminary
-values are not accurate due to the window-functions applied.  After
-sources have been characterized and the PSF model is well-determined,
-the Kron parameters are re-calculated more carefully.  In this version
-of the calculation, the image is first smoothed by Gaussian kernel
-with $\sigma = 1.7$ pixels, corresponding to a FWHM of 1.0\arcsec in
-the PS1 stack images.  Next, the Kron radius is determined in an
-iterative process: the first radial moment is measured using the pixels in an
-aperture 6$\times$ the first radial moment from the previous
-iteration.  On the first iteration, the sky radius is used in place of
-the first radial moment.  By default, 2 iterations are performed.  The
-Kron radius is defined the be 2.5$\times$ the first radial moment.
-The Kron flux is the sum of pixel fluxes within the Kron radius.  We
-also calculate the flux in two related annular apertures: the Kron
-inner flux is the sum of pixel values for the annulus $R_1 < r < 2.5
-R_1$, while the Kron outer flux is the sum of pixel values for $2.5
-R_1 < r < 4 R_1$.  
+Preliminary Kron radius and flux values \citep{1980ApJS...43..305K}
+are calculated soon after sources are detected (Section~\ref{sec:moments}).
+However, these preliminary values are not accurate due to the
+window-functions applied.  After sources have been characterized and
+the PSF model is well-determined, the Kron parameters are
+re-calculated more carefully.  In this version of the calculation, the
+image is first smoothed by Gaussian kernel with $\sigma = 1.7$ pixels,
+corresponding to a FWHM of 1.0\arcsec\ in the PS1 stack images.  Next,
+the Kron radius is determined in an iterative process: the first
+radial moment is measured using the pixels in an aperture 6$\times$
+the first radial moment from the previous iteration.  On the first
+iteration, the sky radius is used in place of the first radial moment.
+By default, 2 iterations are performed.  The Kron radius is defined
+the be 2.5$\times$ the first radial moment.  The Kron flux is the sum
+of pixel fluxes within the Kron radius.  We also calculate the flux in
+two related annular apertures: the Kron inner flux is the sum of pixel
+values for the annulus $R_1 < r < 2.5 R_1$, while the Kron outer flux
+is the sum of pixel values for $2.5 R_1 < r < 4 R_1$.
 
 Two details in the calculation above should be noted.  First, for
@@ -1460,5 +1466,5 @@
 calculations.  The window used for the calculations is constrained to
 be at least the size of the aperture based on the PSF stars
-(\ref{sec:moments}).  At the other extreme, noise may make the radius
+(Section~\ref{sec:moments}).  At the other extreme, noise may make the radius
 grow excessively, resulting in an unrealistically low effective
 surface brightness.  The aperture is constrained to be less than a
@@ -1471,5 +1477,5 @@
 opposites sides of the central pixel are considered together.  The
 geometric mean of the two fluxes is used to replace the flux values.
-If the object has 180\degree symmetry, this operation has no impact.
+If the object has 180\degree\ symmetry, this operation has no impact.
 However, if one of the two pixels is unusually high, the value will be
 surpressed by the matched pixel on the other side.  This trick has the
@@ -1480,10 +1486,11 @@
 
 In the galaxy model fittting stage, sources which meet certain
-criteria are fitted with analytical models for galaxies.  The
-three models used for the PV3 analysis have similar form:
+criteria are fitted with analytical models for galaxies.  Three
+traditional analytical galaxy models are implemented in \code{psphot}
+and used in the PV3 analysis:
 \begin{itemize}
 \item Exponential profile : $f = I_0 e^{-\rho}$
-\item DeVaucouleur profile : $f = I_0 e^{-\rho^{1/4}}$
-\item Sersic : $f = I_0 e^{-\rho^{1/n}}$
+\item DeVaucouleur profile \citep{1948AnAp...11..247D}: $f = I_0 e^{-\rho^{1/4}}$
+\item Sersic \citep{1963BAAA....6...41S} : $f = I_0 e^{-\rho^{1/n}}$
 \end{itemize}
 where $\rho$ is a normalized radial term: $\rho =
@@ -1500,16 +1507,20 @@
 our best guess for the PSF model at the location of the galaxy.  For
 the PV3 analysis, all sources detected in the 'bright source' analysis
-step ($S/N > 20 ?$) were fitted with all three galaxy models, unless
-(a) the morphological test identified the source as a likely cosmic
-ray (\ref{CR}) or (b) the peak of the PSF profile was above the
-saturation limit for the chip \note{(link to the handling of
-  saturation in detrend paper)}.  Sources in the denser portions of
-the Galactic plane and bulge were not included in the analysis.  This
-restriction limited the total time spent on the galaxy modeling
-analysis at the expense of galaxy photometry in the plane (though Kron
-photometry is available for those objects).  The Galactic Plane region
-was defined by $|b| > b_{\rm min}$ where $b_{\rm min} = b_0 + r_b
-e^{\frac{-l^2}{2 \sigma_b^2}}$.  For the PV3 analysis, $b_0 = XX$,
-$r_b = XX$, $\sigma_b = XX$.
+step ($S/N > 20$) were fitted with all three galaxy models, unless (a)
+the morphological test identified the source as a likely cosmic ray
+(Section~\ref{sec:source.size}) or (b) the peak of the PSF profile was
+above the saturation limit for the chip \citep[see the discussion in
+][ regarding the masking of saturated pixels]{waters2017}.  Sources in
+the denser portions of the Galactic plane and bulge were not included
+in the analysis.  This restriction limited the total time spent on the
+galaxy modeling analysis at the expense of galaxy photometry in the
+plane (though Kron photometry is available for those objects).  The
+Galactic Plane region was defined by $|b| > b_{\rm min}$ where $b_{\rm
+  min} = b_0 + r_b e^{\frac{-l^2}{2 \sigma_b^2}}$.  For the PV3
+analysis, $b_0 = $20\degree, $r_b = $15\degree, $\sigma_b = $50\degree.
+
+%  \note{need a discussion of the detector saturation behavior
+
+% \note{more detail below?}  
 
 Before the non-linear fitting may be performed, it is necessary to
@@ -1521,5 +1532,5 @@
 ($R_{xx}$, $R_{yy}$ , $R_{xy}$) values; it was found that such a guess
 tended to be too small and resulted in more iterations rather than
-fewer. \note{more detail on that?}  The 1st radial moment (see
+fewer. The 1st radial moment (see
 \ref{sec:moments}) is used to estimate the effective radius of the
 model based on the results of Graham \& Driver (2005, Table 1).  They
@@ -1606,5 +1617,7 @@
 For the small size of the PSF model used to convolve the galaxy model
 images, it was found that this direct convolution was faster than
-using an FFT-based convolution \note{(examples?)}
+using an FFT-based convolution.
+
+% \note{(examples?)}
 
 For the Exponential and DeVaucouleur fits, all parameters are fitted
@@ -1656,5 +1669,8 @@
 for all 5 filters.  In this analysis, the best model for each object
 is subtracted from the image pixels for all objects excluding the
-object in consideration.  The 'best model' is \note{TBD}.  
+object in consideration.  The 'best model' is determined based on the
+minimum $\chi^2$ value for the model fits.
+
+% \note{more discussion of the selection of the best model}.  
 
 In addition to the raw radial apertures, the stack images are each
@@ -1667,5 +1683,29 @@
 procedure is then repeated with a target FWHM of 8\arcsec.  
 
-\note{is the first convolution done with the Alard-Lupton technique?}
+% \note{is the first convolution done with the Alard-Lupton technique?}
+
+\acknowledgments
+
+The Pan-STARRS1 Surveys (PS1) have been made possible through
+contributions of the Institute for Astronomy, the University of
+Hawaii, the Pan-STARRS Project Office, the Max-Planck Society and its
+participating institutes, the Max Planck Institute for Astronomy,
+Heidelberg and the Max Planck Institute for Extraterrestrial Physics,
+Garching, The Johns Hopkins University, Durham University, the
+University of Edinburgh, Queen's University Belfast, the
+Harvard-Smithsonian Center for Astrophysics, the Las Cumbres
+Observatory Global Telescope Network Incorporated, the National
+Central University of Taiwan, the Space Telescope Science Institute,
+the National Aeronautics and Space Administration under Grant
+No. NNX08AR22G issued through the Planetary Science Division of the
+NASA Science Mission Directorate, the National Science Foundation
+under Grant No. AST-1238877, the University of Maryland, and Eotvos
+Lorand University (ELTE) and the Los Alamos National Laboratory.
+
+\bibliographystyle{apj}
+% \bibliography{lib}{}
+\input{analysis.bbl}
+
+\end{document}
 
 \subsection{Forced Photometry : PSFs}
@@ -1675,7 +1715,7 @@
 \subsection{Output Options}
 
-\note{need to discuss tests}
-
-\note{need to discuss failings and holes}
+% \note{need to discuss tests}
+
+% \note{need to discuss failings and holes}
 
 \section{Alternative Scenarios}
@@ -1759,9 +1799,4 @@
 \end{verbatim}
 
-\bibliographystyle{apj}
-\bibliography{lib}{}
-
-\end{document}
-
 Figures Needed for this document:
 
@@ -1791,14 +1826,2 @@
 * 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}
-
