Index: trunk/doc/release.2015/ps1.calibration/Makefile
===================================================================
--- trunk/doc/release.2015/ps1.calibration/Makefile	(revision 39865)
+++ trunk/doc/release.2015/ps1.calibration/Makefile	(revision 39868)
@@ -1,3 +1,6 @@
 # $Id: Makefile,v 1.16 2006-01-16 01:11:40 eugene Exp $
+
+DO_PDFLATEX = 0
+DO_BIBTEX = 1
 
 help:
@@ -5,15 +8,18 @@
 	@echo "  targets:  all calibration"
 
-all: calibration.pdf
-calibration: calibration.pdf
+all: pdf tgz 
+pdf: calibration.pdf
+tgz: calibration.tgz
 
-CALIBRATION = calibration.tex 
+FILES = \
+../inputs/astro.sty \
+../inputs/code.sty \
+../inputs/apj.bst \
+../inputs/lib.bib \
+calibration.tex \
+calibration.bbl
 
-#       pics/Metadata.ps 
-#       pics/earthrot.ps
-
-calibration.pdf: $(CALIBRATION)
-
-calibration.ps: $(CALIBRATION)
+calibration.pdf: $(FILES)
+calibration.tgz: $(FILES)
 
 include ../Makefile.Common
Index: trunk/doc/release.2015/ps1.calibration/calibration.tex
===================================================================
--- trunk/doc/release.2015/ps1.calibration/calibration.tex	(revision 39865)
+++ trunk/doc/release.2015/ps1.calibration/calibration.tex	(revision 39868)
@@ -1,7 +1,7 @@
-% \documentclass[iop,floatfix]{emulateapj}
+\documentclass[iop,floatfix]{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}
@@ -32,24 +32,41 @@
 % list and (2) re-order the list at the bottom (and comment-out as needed)
 \def\IfA{1}
-\def\CfA{2}
-\def\MPIA{3}
-\def\Princeton{3}
-\def\USNO{4}
-\def\JHU{1}
+\def\LBL{2}
+\def\Hubble{3}
+\def\ITC{4}
+\def\Harvard{5}
+\def\MPIA{6}
+\def\ARI{7}
+\def\Princeton{8}
+\def\DUR{9}
+\def\CfA{10}
 
 % This example has a first author from UH:
 \author{
-Eugene A. Magnier,\altaffilmark{\IfA}
-IPP Team,
-%PS Builder List
+Eugene. A. Magnier,\altaffilmark{\IfA}
+Edward. F. Schlafly,\altaffilmark{\LBL,\Hubble}
+Douglas P. Finkbeiner,\altaffilmark{\ITC,\Harvard}
+J.~L. Tonry,\altaffilmark{\IfA}
+B. Goldman,\altaffilmark{\MPIA}
+S. R\"oser,\altaffilmark{\ARI}
+E. Schilbach,\altaffilmark{\ARI}
+K.~C. Chambers,\altaffilmark{\IfA} 
+H.~A. Flewelling,\altaffilmark{\IfA}
+M. E. Huber,\altaffilmark{\IfA}
+P.~A. Price,\altaffilmark{\Princeton}
+W.~E. Sweeney,\altaffilmark{\IfA}
+C. Z. Waters,\altaffilmark{\IfA}
+% PS1 Builders
+L. Denneau,\altaffilmark{\IfA}
+P. Draper,\altaffilmark{\DUR}
+K. W. Hodapp,\altaffilmark{\IfA}
+R. Jedicke,\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} 
 % T. Grav,\altaffilmark{\IfA}
 % J. N. Heasley,\altaffilmark{\IfA}
-% K. W. Hodapp,\altaffilmark{\IfA}
-% R. Jedicke,\altaffilmark{\IfA}
-% H.~A. Flewelling,\altaffilmark{\IfA}
 % N. Kaiser,\altaffilmark{\IfA}
-% R.-P. Kudritzki,\altaffilmark{\IfA}
 % G. A. Luppino,\altaffilmark{\IfA}
 % R. H. Lupton,\altaffilmark{\Princeton}
@@ -57,37 +74,96 @@
 % J.~S. Morgan,\altaffilmark{\IfA}
 % P. M. Onaka,\altaffilmark{\IfA}
-% P.~A. Price,\altaffilmark{\Princeton}
-% W.~E. Sweeney,\altaffilmark{\IfA}
-% C.~W. Stubbs,\altaffilmark{\CfA}
-% J.~L. Tonry, \altaffilmark{\IfA}
-% R. J. Wainscoat,\altaffilmark{\IfA} and 
+R. J. Wainscoat\altaffilmark{\IfA}
 % M. F. Waterson,\altaffilmark{\IfA} 
 } % this bracket terminates author list
 
+\altaffiltext{\IfA}{Institute for Astronomy, University of Hawaii, 2680 Woodlawn Drive, Honolulu HI 96822}
+\altaffiltext{\LBL}{Lawrence Berkeley National Laboratory, One Cyclotron Road, Berkeley, CA 94720, USA}
+\altaffiltext{\Hubble}{Hubble Fellow}
+\altaffiltext{\ITC}{Institute for Theory and Computation, Harvard-Smithsonian Center for Astrophysics, 60 Garden Street, MS-51, Cambridge, MA 02138 USA}
+\altaffiltext{\Harvard}{Department of Physics, Harvard University, Cambridge, MA 02138 USA}
+\altaffiltext{\MPIA}{Max Planck Institute for Astronomy, K\"onigstuhl 17, D-69117 Heidelberg, Germany}
+\altaffiltext{\ARI}{Astronomisches Rechen-Institut, Zentrum f\"ur Astronomie der Universit\"at Heidelberg, M\"ochhofstrasse 12-14, D-69120 Heidelberg, Germany}
+\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}
+
 % 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{\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}
-% \altaffiltext{\MPIA}{Max Planck Institute for Astronomy, K\"onigstuhl 17, D-69117 Heidelberg, Germany}
+
+% \altaffiltext{\Strassborg}{
+
 \begin{abstract}
 
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum
-bibendum nisi id tristique posuere. Duis eu mollis nulla. Maecenas est
-turpis, mattis tempor urna vitae, placerat rhoncus sem. Lorem ipsum
-dolor sit amet, consectetur adipiscing elit. Sed quis velit
-nisl. Aliquam erat volutpat. Cras lacinia, nisl tristique auctor
-molestie, dolor nulla rhoncus purus, ac accumsan nunc nunc ac
-nibh. Maecenas vitae mollis mauris. Ut sollicitudin pulvinar purus,
-eget luctus lorem tincidunt vitae. Vestibulum eu mattis neque. Nulla
-in tortor id urna dapibus gravida a vel leo.
+The Pan-STARRS\,1 $3\pi$ survey has produced photometry and astrometry
+covering the \approx 30,000 square degrees $\delta > -30$\degrees.  
+This article describes the photometric and astrometric calibration of this survey.
 
 \end{abstract}
 
 % insert additional keywords as appropriate:
-%\keywords{Surveys:\PSONE }
+\keywords{Surveys:\PSONE }
 
 \section{Introduction}\label{sec:intro}
+
+This is the fifth in a series of seven papers describing the
+Pan-STARRS1 Surveys, the data reduction techiques and the resulting
+data products.  This paper (Paper V) describes the final calibration
+process, and the resulting photometric and astrometric quality.
+
+%Chambers et al. 2017 (Paper I)
+%The Pan-STARRS\,1 Surveys
+\citet[][Paper I]{chambers2017}
+provides an overview of the Pan-STARRS System, the design and
+execution of the Surveys, the resulting image and catalog data
+products, a discussion of the overall data quality and basic
+characteristics, and a brief summary of important results.
+
+%Magnier et al. 2017 (Paper II)
+%Pan-STARRS Data Processing Stages
+\citet[][Paper II]{magnier2017c}
+describes how the various data processing stages are organised and implemented
+in the Imaging Processing Pipeline (IPP), including details of the 
+the processing database which is a critical element in the IPP infrastructure . 
+
+%Waters et al. 2017 (Paper III) 
+%Pan-STARRS Pixel Processing : Detrending, Warping, Stacking
+\citet[][Paper III]{waters2017}
+describes the details of the pixel processing algorithms, including detrending, warping, and adding (to create stacked images) and subtracting (to create difference images) and resulting image products and their properties. 
+
+
+%Magnier et al. 2017 (Paper IV) 
+%Pan-STARRS Pixel Analysis : Source Detection 
+\citet[][Paper IV]{magnier2017a}
+describes the details of the source detection and photometry, including point-spread-function and extended source fitting models, and the techniques for ``forced" photometry measurements. 
+
+%Magnier et al. 2017 (Paper V) 
+%Pan-STARRS Photometric and Astrometric Calibration
+%\citet[][Paper V]{magnier2017b}
+%describes the final calibration process, and the resulting photometric and astrometric quality.  
+
+
+%Flewelling et al. 2017 (Paper VI)
+%Pan-STARRS 1 Database and Data Products
+\citet[][Paper VI]{flewelling2017}
+describes  the details of the resulting catalog data and its organization in the Pan-STARRS database. 
+%
+%
+\citet[][Paper VII]{huber2017}
+%Huber et al. 2017 (Paper VII)
+describes the Medium Deep Survey in detail, including the unique issues and data products specific to that survey. The Medium Deep Survey is not part of Data Release 1. (DR1) 
+
+%
+The Pan-STARRS1 filters and photometric system have already been
+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{Pan-STARRS\,1} 
@@ -103,17 +179,18 @@
 The wide-field \PSONE\ telescope consists of a 1.8~meter diameter
 $f$/4.4 primary mirror with an 0.9~m secondary, producing a 3.3 degree
-field of view \citep{PS1.optics}.  The optical design yields low
+field of view \citep{2004SPIE.5489..667H}.  The optical design yields low
 distortion and minimal vignetting even at the edges of the illuminated
 region.  The optics, in combination with the natural seeing, result in
-generally good image quality: 75\% of the images have full-width
-half-max values less than \note{(1.X, 1.X, 1.X, 1.X, 1.X), update}
-arcseconds for (\grizy), with a floor of $\sim 0.7$ \note{update}
-arcseconds.  The \PSONE\ camera \citep{PS1.GPCA} is a mosaic of 60
-edge-abutted $4800\times4800$ pixel back-illuminated \note{name} CCDs
-manufactured by Lincoln Laboratory.  The CCDs have 10~$\mu$m pixels
-subtending 0.258~arcsec and are \note{70um} thick.  The detectors are
-read out using a StarGrasp CCD controller, with a readout time of 7
-seconds for a full unbinned image \citep{PS1.GPCB}.  The active,
-usable pixels cover $\sim 80$\% of the FOV.
+generally good image quality: the median image quality for the 3$\pi$
+survey is FWHM = (1.31, 1.19, 1.11, 1.07, 1.02) arcseconds for
+(\grizy), with a floor of $\sim0.7$ arcseconds.  The \PSONE\ camera
+\citep{PS1.GPCA} is a mosaic of 60 edge-abutted $4800\times4800$ pixel
+back-illuminated CCID58 Orthogonal Transfer Arrays manufactured by
+Lincoln Laboratory \citep{2006amos.confE..47T,2008SPIE.7021E..05T}.
+The CCDs have 10~$\mu$m pixels subtending 0.258~arcsec and are
+70$\mu$m thick.  The detectors are read out using a StarGrasp CCD
+controller, with a readout time of 7 seconds for a full unbinned image
+\citep{2008SPIE.7014E..0DO}.  The active, usable pixels cover $\sim
+80$\% of the FOV.
 
 Nightly observations are conducted remotely from the Advanced
@@ -127,5 +204,5 @@
 
 Images obtained by \PSONE\ are automatically processed in real time by
-the \PSONE\ Image Processing Pipeline \citep[IPP,][]{PS1.IPP}.
+the \PSONE\ Image Processing Pipeline \citep[IPP,][]{magnier2017a}.
 Real-time analysis goals are aimed at feeding the discovery pipelines
 of the asteroid search and supernova search teams.  The data obtained
@@ -196,9 +273,12 @@
 \section{Astrometric Models} 
 
+% \note{include projection math?}  
+% \note{reference discussion somewhere on cell vs chip}
+
 Three somewhat distinct astrometric models are employed within the IPP
 at different stages.  The simplest model is defined independently for
 each chip: a simple TAN projection (Calabretta \& Griesen REF) is used
 to relate sky coordinates to a cartesian tangent-plane coordinate
-system.  \note{include projection math?}  A pair of low-order
+system.  A pair of low-order
 polynomials are used to relate the chip pixel coordinates to this
 tangent-plane coordinate system.  The transforming polynomials are of
@@ -209,11 +289,11 @@
 \end{eqnarray}
 where $P,Q$ are the tangent plane coordinates, $X_{\rm chip}, Y_{\rm
-  chip}$ are the coordinates on the 60 GPC1 chips (\note{see
-  discussion somewhere on cell vs chip}), and $C^P_{i,j}, C^Q_{i,j}$
+  chip}$ are the coordinates on the 60 GPC1 chips, and $C^P_{i,j}, C^Q_{i,j}$
 are the polynomial coefficients for each order.  In the \code{psastro}
 analysis, $i + j <= N_{\rm order}$ where the order of the fit, $N_{\rm
   order}$, may be 1 to 3, under the restriction that sufficient stars
-are needed to constraint the order \note{describe a bit better: this
-  is automatically selected based on the number of stars}.  
+are needed to constrain the order.  
+
+% \note{describe a bit better: this is automatically selected based on the number of stars}
 
 A second form of astrometry model which yields somewhat higher
@@ -234,7 +314,5 @@
 code restricts the exponents with the rule $i + j <= N_{\rm order}$
 where the order of the fit, $N_{\rm order}$, may be 1 to 3, under the
-restriction that sufficient stars are needed to constraint the order
-\note{describe a bit better: this is automatically selected based on
-  the number of stars}.
+restriction that sufficient stars are needed to constrain the order
 For each chip, a second set of polynomials describes the
 transformation from the chip coordinate systems to the focal
@@ -270,20 +348,23 @@
   Q & = & \sum_{i,j} C^Q_{i,j} (X_{\rm chip} - X_0)^i (Y_{\rm chip} - Y_0)^j 
 \end{eqnarray}
-\note{need to complete this discussion of the WCS keywords, both
-  standard and non-standard, used to represent these polynomial
-  transformations}
-
-\begin{verbatim}
-Here is a table of the keywords and the related terms from Eqns above:
-CTYPE1,2 : RA---WRP, DEC--WRP & RA---DIS, DEC--DIS
-CRVAL1,2 : C^{L,M}_{0,0}
-CRPIX1,2 : X_0, Y_0
-PC001001 : C^{L}_{1,0}
-PC001002 : C^{L}_{0,1}
-PC002001 : C^{M}_{1,0}
-PC002002 : C^{M}_{0,1}
-PCA1XiYj : C^{L}_{i,j}
-PCA2XiYj : C^{M}_{i,j}
-\end{verbatim}
+
+%% \note{need to complete this discussion of the WCS keywords, both
+%%   standard and non-standard, used to represent these polynomial
+%%   transformations}
+
+%% \begin{verbatim}
+%% Here is a list of the keywords 
+%% and the related terms from Eqns above:
+%% CTYPE1,2 : RA---WRP, DEC--WRP
+%% CTYPE1,2 : RA---DIS, DEC--DIS
+%% CRVAL1,2 : C^{L,M}_{0,0}
+%% CRPIX1,2 : X_0, Y_0
+%% PC001001 : C^{L}_{1,0}
+%% PC001002 : C^{L}_{0,1}
+%% PC002001 : C^{M}_{1,0}
+%% PC002002 : C^{M}_{0,1}
+%% PCA1XiYj : C^{L}_{i,j}
+%% PCA2XiYj : C^{M}_{i,j}
+%% \end{verbatim}
 
 \section{Real-time Calibration}
@@ -318,5 +399,7 @@
 reference catalog generated from internal re-calibration of the PV0
 analysis of PS1 photometry and astrometry was used for the reference
-catalog.  \note{discuss history of the different refcats?}  
+catalog.  
+
+% \note{discuss history of the different refcats?}  
 
 Coordinates and calibrated magnitudes of stars from the reference
@@ -326,5 +409,5 @@
 position angle reported by the header.  Reference stars are selected
 from the full field of view of the GPC1 camera, padded by an
-additional \note{25\%} to ensure a match can be determined even in the
+additional 25\% to ensure a match can be determined even in the
 presence of substantial errors in the boresite coordinates.  It is
 important to choose an appropriate set of reference stars: if too few
@@ -366,5 +449,5 @@
 \end{eqnarray}
 are generated.  The collection of $\Delta X, \Delta Y$ values are
-collected in a 2D histogram with sampling of \note{XXX} pixels and the
+collected in a 2D histogram with sampling of 50 pixels and the
 peak pixel is identified.  If the astrometry guess were perfect, this
 peak pixel would be expected to lie at (0,0) and contain all of the
@@ -391,6 +474,5 @@
 astrometry guess for the chip.
 
-\note{option to downweight based on photometric inconsistency : not
-  used in PS1 analysis}
+%% \note{option to downweight based on photometric inconsistency : not used in PS1 analysis}
 
 \subsection{Chip Polynomial Fits}
@@ -435,36 +517,41 @@
 desired for the distortion fit.  The coefficients of the gradient fit
 are then used to determine the coefficients for the polynomials
-representing the distortion.  \note{write out the math of the gradients}
+representing the distortion.  
+
+%% \note{write out the math of the gradients}
 
 Once the common distortion coming from the optics and atmosphere have
 been modeled, \code{psastro} determines polynomial transformations
 from the 60 chips to the focal plane coordinate system.  In this
-stage, \note{NN} iterations of the chip fits are performed.  Before
-each iteration, the reference stars and detected objects are matched
-using the current best set of transformations.  These fits start with
-low order (1) and large matching radius (\note{XX}).  As the
-iterations proceed, the radius is reduced and the order is allowed to
-increaes, up to 3rd order for the final iterations.  \note{quality of
-  the fits as a result of this stage}.
+stage, 5 iterations of the chip fits are performed.  Before each
+iteration, the reference stars and detected objects are matched using
+the current best set of transformations.  These fits start with low
+order (1) and large matching radius.  As the iterations proceed, the
+radius is reduced and the order is allowed to increaes, up to 3rd
+order for the final iterations.  
+
+%% \note{quality of the fits as a result of this stage}.
 
 \subsection{Real-time Photometric Calibration}
+
+%% \note{define / describe the robust median}
 
 After the astrometric calibration has finished, the photometric
 calibration is performed by \code{psastro}.  When the reference stars
 are loaded, the apparent magnitude in the filter of interest is also
-loaded.   Stars for which the reference magnitude is brighter than
+loaded.  Stars for which the reference magnitude is brighter than
 (\grizy) = (19, 19, 18.5, 18.5, 17.5) are used to determine the zero
 points by comparison with the instrumental magnitudes.  For the PV3
-analysis, the robust median \note{defined where?} is used to measure
-the zero point. For early versions of the analysis, when the reference
-catalog used synthetic magnitudes, it was necessary to search for the
-blue edge of the distribution: the synthetic magnitude poorly 
-predicted the magnitudes of stars in the presence of significant
-extinction or for the very red stars, making the blue edge somewhat
-more reliable.  Note that we do not include an airmass correction in
-this zero point analysis: the airmass correction is folded into the
-observed zero point.  The zero point may be measured separately for
-each chip or as a single value for the entire exposure; the latter
-option was used for the PV3 analysis.
+analysis, an outlier-rejecting median is used to measure the zero
+point. For early versions of the analysis, when the reference catalog
+used synthetic magnitudes, it was necessary to search for the blue
+edge of the distribution: the synthetic magnitude poorly predicted the
+magnitudes of stars in the presence of significant extinction or for
+the very red stars, making the blue edge somewhat more reliable.  Note
+that we do not include an airmass correction in this zero point
+analysis: the airmass correction is folded into the observed zero
+point.  The zero point may be measured separately for each chip or as
+a single value for the entire exposure; the latter option was used for
+the PV3 analysis.
 
 \subsection{Real-time outputs}
@@ -483,7 +570,6 @@
 chip-level keywords (e.g., \code{DATE-OBS}).  The astrometric
 transformation information for each chip is saved in the corresponding
-header using standard (and some non-standard) WCS keywords.
-\note{combine this discussion with the above?}.  For the two-level
-astrometric model, the PHU header carries the astrometric
+header using standard (and some non-standard) WCS keywords.  For the
+two-level astrometric model, the PHU header carries the astrometric
 transformation related to the projection and the camera-wide
 distortions.  Photometric calibrations are written as a set of
@@ -507,8 +593,8 @@
 \subsection{Ubercal Analysis}
 
-\note{clean up and re-word the pieces below}
+% \note{clean up and re-word the pieces below}
 
 The photometric calibration of the DVO database starts with the
-``ubercal'' analysis technique as described by \cite{PS1.ubercal}.
+``ubercal'' analysis technique as described by \cite{2012ApJ...756..158S}.
 This analysis is performed by the group at Harvard, loading data from
 the \code{smf} files into their instance of the Large Scale Database
@@ -517,15 +603,15 @@
 
 Photometric nights are selected and all other exposures are ignored.
-Each night \note{shorter time?} is allowed to have a single fitted
-zero point and a single fitted value for the airmass extinction
-coefficient per filter.  The zero points and extinction terms are
-determined as a least squares minimization process using the repeated
-measurements of the same stars from different nights to tie nights
-together.  Flat-field corrections are also determined as part of the
-minimization process.  In the original (PV1) ubercal analysis,
-\cite{PS1.ubercal} determined flat-field corrections for $2\times 2$
-sub-regions of each chip in the camera and four distinct time periods
-(``seasons'').  Later analysis (PV2) used an $8\times8$ grid of
-flat-field corrections to good effect.
+Each night is allowed to have a single fitted zero point and a single
+fitted value for the airmass extinction coefficient per filter.  The
+zero points and extinction terms are determined as a least squares
+minimization process using the repeated measurements of the same stars
+from different nights to tie nights together.  Flat-field corrections
+are also determined as part of the minimization process.  In the
+original (PV1) ubercal analysis, \cite{2012ApJ...756..158S} determined
+flat-field corrections for $2\times 2$ sub-regions of each chip in the
+camera and four distinct time periods (``seasons'').  Later analysis
+(PV2) used an $8\times8$ grid of flat-field corrections to good
+effect.
 
 The ubercal analysis was re-run for PV3 by the Harvard group.  For the
@@ -536,5 +622,7 @@
 was also included for PV3.  In retrospect, as we show below, the data
 from the latter part of the survey would probably benefit from
-additional flat-field seasons.  \note{something for PV4}.
+additional flat-field seasons. 
+
+%% \note{something for PV4}.
 
 By excluding non-photometric data and only fitting 2 parameters for
@@ -545,23 +633,27 @@
 every night, helping to tie down overall variations of the system
 throughput and acting as internal standard star fields.  The resulting
-photometric system is shown by \cite{PS1.ubercal} to have reliability
+photometric system is shown by \cite{2012ApJ...756..158S} to have reliability
 across the survey region at the level of (8.0, 7.0, 9.0, 10.7, 12.4)
 millimags in (\grizy).  As we discuss below, this conclusion is
-reinforced by our external comparison.  \note{do I have a measurement
-  of the bright end stability in PV3?  basically, what is the scatter
-  per star as a function of position in the camera and magnitude?}
+reinforced by our external comparison.  
+
+%% \note{do I have a measurement
+%% of the bright end stability in PV3?  basically, what is the scatter
+%% per star as a function of position in the camera and magnitude?}
 
 The overall zero point for each filter is not naturally determined by
 the Ubercal analysis; an external constraint on the overall
-photometric system is required for each filter.  \cite{PS1.ubercal}
-used photometry of the MD09 Medium Deep field to match the photometry
-measured by \cite{JTphoto} on the reference photometric night of MJD
-55744 (UT 02 July 2011).  \note{Scolnic et al REF} have re-examined
-the photometry of Calspec standards as observed by PS1.  They reject 2
-of the \note{XX} stars used by \cite{JTphoto} and add photometry of
-\note{XX} additional stars.  The calspec spectrophotometry values have
-also been re-examined by XX; using these new measurements, Scolnic et
-al determine new zero points for the PS1 system, which we have applied
-(see below).
+photometric system is required for each filter.
+\cite{2012ApJ...756..158S} used photometry of the MD09 Medium Deep
+field to match the photometry measured by \cite{2012ApJ...750...99T}
+on the reference photometric night of MJD 55744 (UT 02 July 2011).
+\cite{2015ApJ...815..117S} have re-examined the photometry of Calspec
+standards as observed by PS1.  They reject 2 of the 5 stars used by
+\cite{2012ApJ...750...99T} and add photometry of 2 additional stars.
+
+%% \note{The calspec spectrophotometry values have also been re-examined
+%%   by REF; using these new measurements, \cite{2015ApJ...815..117S}
+%%   determine new zero points for the PS1 system, which we have applied
+%%   (see below).}
 
 \subsection{Applying the Ubercal Zero Points : Setphot}
@@ -585,19 +677,19 @@
 each filter representing respectively the nominal zero point and the
 slope of the trend with respect to the airmass ($\zeta$) for each
-filter.  \note{the image zero point does not incorporate the airmass,
-  only the measurement zero point}.  These static values are listed in
-Table~\ref{tab:zpts}.  When \code{setphot} was run, these static zero
-points have been adjusted by the calspec offsets listed in
-Table~\ref{tab:zpts} based on the analysis of CALSPEC standards by
-Scolnic et al REF.  These offsets bring the photometric system defined
-by the ubercal analysis into alignment with the Scolnic analysis of
-the PS1 observations of XXX calspec standard stars.  The value
-$M_{cal}$ is the offset needed by each exposure to match the ubercal
-value, or to bring the non-ubercal exposures into agreement with the
-rest of the exposures, as discussed below.  The flat-field information
-is encoded in a table of flat-field offsets as a function of time,
-filter, and camera position.  Each image which is part of the ubercal
-subset is marked with a bit in the field \code{Image.flags}:
-\code{ID_IMAGE_PHOTOM_UBERCAL = 0x00000200}
+filter.  These static values are listed in Table~\ref{tab:zpts}.  When
+\code{setphot} was run, these static zero points have been adjusted by
+the calspec offsets listed in Table~\ref{tab:zpts} based on the
+analysis of CALSPEC standards by Scolnic et al REF.  These offsets
+bring the photometric system defined by the ubercal analysis into
+alignment with the Scolnic analysis of the PS1 observations of XXX
+calspec standard stars.  The value $M_{cal}$ is the offset needed by
+each exposure to match the ubercal value, or to bring the non-ubercal
+exposures into agreement with the rest of the exposures, as discussed
+below.  The flat-field information is encoded in a table of flat-field
+offsets as a function of time, filter, and camera position.  Each
+image which is part of the ubercal subset is marked with a bit in the
+field \code{Image.flags}: \code{ID_IMAGE_PHOTOM_UBERCAL = 0x00000200}
+
+%% \note{give airmass formula for completeness?}.
 
 When \code{setphot} applies the ubercal information to the image
@@ -611,11 +703,10 @@
 with the airmass for the measurement, calculated using the altitude of
 the individual detection as determined from the Right Ascension,
-Declination, the observatory latitude, and the sidereal time.
-\note{give formula for completeness?}.  For a camera with the field of
-view of the PS1 GPC1, the airmass may vary significantly within the
-field of view, especially at low elevations.  In the worst cases, at
-the celestial pole, the airmass range within a single exposure is XXX
-- XXX.  The complete calibrated (`relative') magnitude is determined
-from the stored database values as:
+Declination, the observatory latitude, and the sidereal time.  For a
+camera with the field of view of the PS1 GPC1, the airmass may vary
+significantly within the field of view, especially at low elevations.
+In the worst cases, at the celestial pole, the airmass range within a
+single exposure is XXX - XXX.  The complete calibrated (`relative')
+magnitude is determined from the stored database values as:
 \[
 M_{\rm rel} = M_{\rm inst} - 25.0 + zp_{\rm ref} + M_{\rm cal} + M_{\rm flat} + K_\lambda (sec \zeta - 1).
@@ -643,7 +734,8 @@
 \subsection{Relphot Analysis}
 
+%% \note{how many exposures are not in ubercal?}
+
 Relative photometry is used to determine the zero points of the
-exposures which were not included in the ubercal analysis \note{how
-  many?}.  The relative photometry analysis has been desribed in the
+exposures which were not included in the ubercal analysis.  The relative photometry analysis has been desribed in the
 past in Magnier et al 2013 REF.  We review that analysis here, along
 with specific updates for PV3.  
@@ -660,9 +752,11 @@
 \[ M_{ave} = \frac{\sum_i M_{rel,i} w_i}{\sum_i w_i} \]
 We find that the color difference of the different chips can be
-ignored \note{level of this effect?}, and set the value of $A$ to 0.0.
+ignored, and set the value of $A$ to 0.0.
 Note that we only use a single mean airmass extinction term for all
 exposures -- the difference between the mean and the specific value
 for a given night is taken up as an additional element of the
 atmospheric attenuation.
+
+%% \note{color-color terms between chips?}
 
 We write a global $\chi^2$ equation which we attempt to minimize by
@@ -681,10 +775,9 @@
 Only brighter, high quality measurements are used in the relative
 photometry analysis of the exposure zero points.  We use only the
-brighter objects \note{mag limit}, limiting the density to a maximum
-of \note{actual max density?} 2500 or 3000 objects per square degree
-(lower in areas where we have more observations).  When limiting the
-density, we prefer objects which are brighter (but not saturated), and
-those with the most measurements (to ensure better coverage over the
-available images).
+brighter objects, limiting the density to a maximum of 4000 objects
+per square degree (lower in areas where we have more observations).
+When limiting the density, we prefer objects which are brighter (but
+not saturated), and those with the most measurements (to ensure better
+coverage over the available images).
 
 There are a few classes of outliers which we need to be careful to
@@ -694,10 +787,11 @@
 We attempt to exclude these poor measurements in advance by rejecting
 measurements which the photometric analysis has flagged the result as
-suspcious.  \note{bad and poor psphot bits?}  We reject detections
-which are excessively masked ({\tt PSF\_QF} $<$ 0.85, see Magnier et
-al PSPHOT REF); these include detections which are too close to other
-bright objects, diffraction spikes, ghost images, or the detector
-edges.  However, these rejections do not catch all cases of bad
-measurements.  
+suspcious.  We reject detections which are excessively masked; these include
+detections which are too close to other bright objects, diffraction
+spikes, ghost images, or the detector edges.  However, these
+rejections do not catch all cases of bad measurements.
+
+%% \citep[\code{PSF_QF} $< 0.85$, see][]{magnier2017b}; 
+%% \note{refer to the PSPHOT bad and poor psphot bits?}  
 
 After the initial iterations, we also perform outlier rejections based
@@ -713,7 +807,8 @@
 with reduced $\chi^2$ values more than 20.0, or more than 2$\times$
 the median, whichever is larger.  We also exclude stars with standard
-deviation (of the measurements used for the mean) greater than
-\note{is this true?} 0.005 mags or 2$\times$ the median standard
-deviation, whichever is greater.  
+deviation (of the measurements used for the mean) greater than 0.005
+mags or 2$\times$ the median standard deviation, whichever is greater.
+
+%% \note{is this true?} 
 
 Similarly for images, we exclude those with more than 2 magnitudes of
@@ -734,6 +829,7 @@
 calculation of the formal error on the mean magnitudes propagates this
 additional weight, so that the errors on the Ubercal observations
-dominates where they are present. \note{do we drop this when
-  calculating the final mean mags?}
+dominates where they are present. 
+
+% \note{do we drop this when calculating the final mean mags?}
 % \note{do I need to present the math?}
 \[ \mu = \frac{\sum m_i w_i \sigma_i^{-2}}{\sum w_i \sigma_i^{-2}} \]
@@ -802,5 +898,5 @@
 analysis.
 
-\note{need to discuss the process of setting the final mean magnitudes}
+%% \note{need to discuss the process of setting the final mean magnitudes}
 
 For PV3, the relphot analysis was performed two times.  The first
@@ -812,10 +908,11 @@
 data in DVO after the initial relphot calibration to measure the
 flat-field residual with much finer resolution: 124 x 124 flat-field
-values for each GPC1 chip (40x40 pixels per point).  \note{show the
-  flat-field residual images, discuss the features?}.  We then used
+values for each GPC1 chip (40x40 pixels per point).  We then used
 \code{setphot} to apply this new flat-field correction, as well as the
 ubercal flat-field corrections, to the data in the database.  At this
 point, we re-ran the entire relphot analysis to determine zero points
 and to set the average magnitudes.
+
+%% \note{show the flat-field residual images, discuss the features?}.  
 
 For stacks and warps, the image calibrations were determined after the
@@ -831,5 +928,7 @@
 appropriate for a given warp.  This latter effect is one of several
 which degrade the warp photometry compared to the chip photometry at
-the bright end.  \note{recommendation}
+the bright end.  
+
+%% \note{recommendation}
 
 \subsection{Calculation of Object Photometry}
@@ -859,6 +958,5 @@
 the master DVO database.
 
-\note{need to describe the assignment of flags, etc, for the external
-  data sources}.
+%% \note{need to describe the assignment of flags, etc, for the external data sources}.
 
 \section{Astrometry Analysis}
@@ -915,10 +1013,11 @@
 contaminated by the effect.  
 
+% \note{was there is significant difference using a surface brightness version?}  
+
 We measured the Koppenh\"offer Effect by accumulating the residual
-astrometry statistics for \note{how many} stars.  For each chip, we
+astrometry statistics for stars in the database.  For each chip, we
 measured the mean X and Y displacements of the astrometric residuals
 as function of the instrumental magnitude of the star divided by the
-FWHM$^2$.  \note{was there is significant difference using a surface
-  brightness version?}  We measured the trend for all chips in a
+FWHM$^2$.  We measured the trend for all chips in a
 number of different time ranges and found the effect to be quite
 stable, in the period where it was present.  The effect only appeared
@@ -964,8 +1063,8 @@
 DCR trend for the 5 filters \grizy, as well as the measured
 displacement in the direction perpendicular to the parallactic angle.
-We represent the trend with a spline fitted to this dataset.  The DCR
-trend has an amplitude of \note{XXX - XXX} in the five filters.  
-
-\note{write down the DCR formalae for reference}.
+We represent the trend with a spline fitted to this dataset.  
+
+%% The DCR trend has an amplitude of \note{XXX - XXX} in the five filters.  
+%% \note{write down the DCR formalae for reference}.
 
 \subsubsection{Astrometric Flat-field}
@@ -1017,5 +1116,6 @@
 similar to the ``tree rings'' reported by the DES team and others
 (G. Berstein REF \& REFS).  We explore these tree rings in detail in
-\note{SECTION or REF?}.
+
+% \note{SECTION or REF?}.
 
 After the initial analysis to measure the KE corrections, DCR
@@ -1091,11 +1191,11 @@
 performed SED fitting for 800M stars in the 3$\pi$ region using PV2
 data.  The goal of this work was to determine the 3D structure of the
-dust in the galaxy.  By fitting model SEDs to \note{all?} stars
-meeting a basic data quality cut \note{(describe)}, they determined
-the best spectral type, and thus $T_{\rm eff}$, absolute $r$-band
-magnitude, distance modulus, and extinction $A_V$ (the desired output
-and used to determine the dust extinction as a function of distance
-throughout the galaxy).  We use the distance modulus determined in
-this analysis to predict the proper motions.  
+dust in the galaxy.  By fitting model SEDs to stars meeting a basic
+data quality cut, they determined the best spectral type, and thus
+$T_{\rm eff}$, absolute $r$-band magnitude, distance modulus, and
+extinction $A_V$ (the desired output and used to determine the dust
+extinction as a function of distance throughout the galaxy).  We use
+the distance modulus determined in this analysis to predict the proper
+motions.
 
 To convert the distances to proper motions, we use the Galactic
@@ -1112,5 +1212,6 @@
 \end{eqnarray}
 where $d$ is the distance and $l,b$ are the Galactic coordintes of the
-star. \note{some reference?}  Note that the proper motion induced by
+star. Note that the proper motion induced by
+%% \note{some reference for this?}  
 the Galactic rotation is independent of distance while the reflex
 motion induced by the solar motion decreases with increasing
@@ -1126,5 +1227,5 @@
 value of 500pc.  
 
-\note{plots to show how well this worked for PV3 pre Gaia}
+%% \note{plots to show how well this worked for PV3 pre Gaia}
 
 \subsection{Gaia Constraint}
@@ -1136,8 +1237,8 @@
 motion and parallax solutions are in general saturated in the PS1
 observations.  Thus, we are limited to using the Gaia mean positions
-reported for the fainter stars.  We extracted all Gaia sources
-\note{not marked as a duplicate} from \note{where?} and generated a
-DVO database from this dataset.  We then merged the Gaia DVO into the
-PV3 master DVO database.  We re-ran the complete relative astrometry
+reported for the fainter stars.  We extracted all Gaia sources not
+marked as a duplicate from the Gaia archive and generated a DVO
+database from this dataset.  We then merged the Gaia DVO into the PV3
+master DVO database.  We re-ran the complete relative astrometry
 analysis using Gaia as an additional measurement.  We applied the
 analysis described above, applying the estimated distances to
@@ -1154,5 +1255,5 @@
 even at a lower weight, helps to tile over those gaps.
 
-\note{Figures showing the Gaia residuals}
+%% \note{Figures showing the Gaia residuals}
 
 \subsection{Calculation of Object Astrometry}
@@ -1165,4 +1266,28 @@
 
 \section{Conclusion}
+
+\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{calibration.bbl}
+
+\end{document}
 
 \begin{verbatim}
@@ -1184,3 +1309,2 @@
 \end{verbatim}
 
-\end{document}
