Index: /trunk/doc/release.2015/ps1.calibration/Makefile
===================================================================
--- /trunk/doc/release.2015/ps1.calibration/Makefile	(revision 40721)
+++ /trunk/doc/release.2015/ps1.calibration/Makefile	(revision 40722)
@@ -4,5 +4,5 @@
 # remember to set \pdfoutput at the top
 
-DO_BIBTEX = 1
+DO_BIBTEX = 0
 # remember to change from \bibliography to \input{.bbl} at the bottom
 
@@ -13,12 +13,49 @@
 all: pdf tgz 
 pdf: calibration.pdf
-tgz: calibration.tgz
+
+journal: calibration.journal.tgz
+arxiv: calibration.arxiv.tgz
 
 quick: calibration.quick.pdf
 
+PNGPICS = \
+pics/gpc1.layout.pdf \
+pics/A1.pdf \
+pics/A4.pdf \
+pics/photflat.example.v1.png \
+pics/rings.v3.example.png \
+pics/allsky.photom.v2.png \
+pics/photom.pv3.3v4.png \
+pics/KHexample.png \
+pics/KHmap.png \
+pics/DCR.example.png \
+pics/astroflat.gri.v2.png \
+pics/astroflat.zy.v2.png \
+pics/allsky.astrom.pv3.3.png \
+pics/astroflat.repair.png \
+pics/allsky.histogram.astrom.compare.png \
+pics/gaia.photom.v1.png \
+pics/gaia.astrom.mean.png \
+pics/gaia.astrom.sigma.png
+
 PDFPICS = \
+pics/gpc1.layout.pdf \
 pics/A1.pdf \
-pics/A3.pdf \
-pics/A4.pdf
+pics/A4.pdf \
+pics/photflat.example.v1.pdf \
+pics/rings.v3.example.pdf \
+pics/allsky.photom.v2.pdf \
+pics/photom.pv3.3v4.pdf \
+pics/KHexample.pdf \
+pics/KHmap.pdf \
+pics/DCR.example.pdf \
+pics/astroflat.gri.v2.pdf \
+pics/astroflat.zy.v2.pdf \
+pics/allsky.astrom.pv3.3.pdf \
+pics/astroflat.repair.pdf \
+pics/allsky.histogram.astrom.compare.pdf \
+pics/gaia.photom.v1.pdf \
+pics/gaia.astrom.mean.pdf \
+pics/gaia.astrom.sigma.pdf
 
 FILES = \
@@ -26,18 +63,5 @@
 ../inputs/code.sty \
 ../inputs/apj.bst \
-pics/rings.v3.example.png \
-pics/KHexample.png \
-pics/KHmap.png \
-pics/dcr.r2.g.png \
-pics/allsky.astrom.sigma.png \
-pics/gaia.photom.png \
-pics/gaia.astrom.png \
-$(PDFPICS) \
 calibration.tex
-
-# pics/photflat.example.sm.png \
-# pics/allsky.photom.sigma.sm.png \
-# pics/astroflat.gri.sm.png \
-# pics/astroflat.zy.sm.png \
 
 pics/%.pdf : pics/%.ps
@@ -48,7 +72,11 @@
 	ps2pdf -dEPSCrop $< $@
 
-pdfpics: $(PDFPICS)
+# pdfpics: $(PDFPICS)
+
 calibration.pdf: $(FILES)
-calibration.tgz: $(FILES)
+
+calibration.journal.tgz: $(FILES) $(PDFPICS) calibration.bbl
+calibration..arxiv.tgz: $(FILES) $(PNGPICS) calibration.bbl
 
 include ../Makefile.Common
+
Index: /trunk/doc/release.2015/ps1.calibration/calibration.tex
===================================================================
--- /trunk/doc/release.2015/ps1.calibration/calibration.tex	(revision 40721)
+++ /trunk/doc/release.2015/ps1.calibration/calibration.tex	(revision 40722)
@@ -21,6 +21,6 @@
 %% NOTE: 2019 Feb versions of the figures are generated in /data/kukui.1/eugene/cal.paper.20190217
 
-%\def\picdir{/home/eugene/chipresid.20140404}
-\def\picdir{/data/pikake.2/eugene/chipresid.20140404}
+%\def\picdir{pics}
+\def\picdir{.}
 
 % Pick a terse version of the title here;
@@ -247,5 +247,5 @@
 \begin{figure}
   \centering
-  \includegraphics[width=0.9\hsize,angle=0,clip]{{pics/gpc1.layout}.pdf}
+  \includegraphics[width=0.9\hsize,angle=0,clip]{{\picdir/gpc1.layout}.pdf}
   \caption{Diagram illustrating layout of OTA devices in GPC1.  The
     blue dots mark the locations of the amplifiers for xy00 cells in
@@ -476,34 +476,4 @@
 \end{eqnarray}
 
-%% Include a description of the WCS keywords used to represent the fit elements?
-
-%% {\bf WCS Keywords} When this polynomial representation is written to
-%% the output files, a set of WCS keywords are used to define the
-%% astrometric transformation elements.  It is necessary to transform the
-%% simply polynomials above into an alternate form:
-%% \begin{eqnarray}
-%%   P & = & \sum_{i,j} C^P_{i,j} (X_{\rm chip} - X_0)^i (Y_{\rm chip} - Y_0)^j \\
-%%   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 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}
-
 \subsection{Cross-Correlation Search}
 
@@ -543,6 +513,4 @@
 astrometry guess for the chip.
 
-%% \note{option to downweight based on photometric inconsistency : not used in PS1 analysis}
-
 \subsection{Pipeline Astrometric Calibration}
 
@@ -586,6 +554,4 @@
 representing the distortion.  
 
-%% \note{write out the math of the gradients}
-
 Once the common distortion coming from the optics and atmosphere have
 been modeled, \ippprog{psastro} determines polynomial transformations
@@ -598,9 +564,5 @@
 order for the final iterations.  
 
-%% \note{quality of the fits as a result of this stage}.
-
 \subsection{Pipeline Photometric Calibration}
-
-%% \note{define / describe the robust median}
 
 After the astrometric calibration is determined, the photometric
@@ -671,7 +633,7 @@
 Section~\ref{sec:synthdb}) was merged in.  Next, the full Tycho
 database was added, followed by the AllWISE database.  After the Gaia
-release in August 2016 \citep{2016AA...595A...2G}, we generated a DVO
-database of the Gaia positional and photometric information and merged
-that into the master PV3 $3\pi$ DVO database.
+Data Release 1 (DR1) in August 2016 \citep{2016AA...595A...2G}, we
+generated a DVO database of the Gaia positional and photometric
+information and merged that into the master PV3 $3\pi$ DVO database.
 
 The master DVO database is used to perform the full photometric and
@@ -869,6 +831,4 @@
 \end{table*}
 
-%% \note{need to describe the assignment of flags, etc, for the external data sources}.
-
 \section{Photometry Calibration}
 
@@ -1033,6 +993,4 @@
 \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.  The
@@ -1059,6 +1017,4 @@
 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
 finding the best mean magnitudes for all objects and the best
@@ -1095,7 +1051,4 @@
 rejections do not catch all cases of bad measurements.
 
-%% \citep[\code{PSF_QF} $< 0.85$, see][]{magnier2017.analysis}; 
-%% \note{refer to the PSPHOT bad and poor psphot bits?}  
-
 After the initial iterations, we also perform outlier rejections based
 on the consistency of the measurements.  For each star, we use a two
@@ -1112,6 +1065,4 @@
 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
@@ -1134,6 +1085,4 @@
 dominates where they are present. 
 
-% \note{do we drop this when calculating the final mean mags?}
-% \note{do I need to present the math?}
 \begin{equation}
   \mu = \frac{\sum m_i w_i \sigma_i^{-2}}{\sum w_i \sigma_i^{-2}}
@@ -1175,8 +1124,10 @@
 % this is PV3.0 [pre-calibrations]
 
+% updated version at:
+% /data/kukui.1/eugene/cal.paper.images.20190217/flatplots.sh photflat.example
 \begin{figure*}[htbp]
  \begin{center}
   \begin{minipage}{0.85\linewidth}
-   \includegraphics[width=\textwidth,clip]{{pics/photflat.example.v1}.png}
+   \includegraphics[width=\textwidth,clip]{{\picdir/photflat.example.v1}.\plotext}
   \end{minipage}
   \hspace{-3.0in}
@@ -1592,9 +1543,9 @@
 
 % generate from :
-% /data/kukui.1/eugene/czw.paper.images.20181130 (see .dvo)
+% /data/kukui.1/eugene/cal.paper.images.20190217/rings.sh
 
 \begin{figure*}[htbp]
   \begin{center}
- \includegraphics[width=\hsize,clip]{{pics/rings.v3.example}.png}
+ \includegraphics[width=\hsize,clip]{{\picdir/rings.v3.example}.\plotext}
   \caption{\label{fig:rings.v3.example} Illustration of overlapping
     skycells and the identification of the ``primary'' detections.}
@@ -1828,8 +1779,9 @@
 \subsection{Photometry Calibration Quality}
 
+% /data/kukui.1/eugene/cal.paper.images.20190217/scatter.sh : allsky.scatter.photom
 \begin{figure*}[htbp]
   \begin{center}
 %width=\hsize
- \includegraphics[height=\vsize,clip]{{pics/allsky.photom.v2}.png}
+ \includegraphics[height=\vsize,clip]{{\picdir/allsky.photom.v2}.\plotext}
   \caption{\label{fig:allsky.photom.sigma} Consistency of photometry
     measurements across the sky.  Each panel shows a map of the
@@ -1876,7 +1828,8 @@
 18)$ millimagnitudes.
 
+% /data/kukui.1/eugene/cal.paper.images.20190217/kronrepair.sh : full.figure
 \begin{figure*}[htbp]
   \begin{center}
-  \includegraphics[width=\hsize,clip]{{pics/photom.pv3.3v4}.png}
+  \includegraphics[width=\hsize,clip]{{\picdir/photom.pv3.3v4}.\plotext}
   \caption{\label{fig:photom.pv3.3v4} Sample comparison of PV3.3 and
     PV3.4 photometry illustrating the impact of the issues identified
@@ -1919,8 +1872,10 @@
 
 \section{Astrometry Calibration}
-
+\label{sec:astrometry}
+
+% /data/kukui.3/eugene/pv3.stats.20161202/mana.sh
 \begin{figure*}[htbp]
   \begin{center}
- \includegraphics[width=\hsize,clip]{{pics/KHexample}.png}
+ \includegraphics[width=\hsize,clip]{{\picdir/KHexample}.\plotext}
   \caption{\label{fig:KHexample} Illustration of the Koppenh\"ofer Effect
     on OTA04.  {\bf Bottom left} X-direction before correction.  The solid line shows the measured
@@ -1933,9 +1888,8 @@
 \end{figure*}
 
-% from: /data/kukui.3/eugene/pv3.stats.20161202/
-
+% /data/kukui.3/eugene/pv3.stats.20161202/mana.sh
 \begin{figure}[htbp]
   \begin{center}
- \includegraphics[width=\hsize,clip]{{pics/KHmap}.png}
+ \includegraphics[width=\hsize,clip]{{\picdir/KHmap}.\plotext}
   \caption{\label{fig:KHmap} Map of the amplitude of the
     Koppenh\"ofer Effect on chips across the focal plane.  In the
@@ -2077,7 +2031,8 @@
 % /data/ipp094.0/eugene/pv3.cam.20150607/astrom.corrections/dcr.meas.20151203.0.fits
 
+% /data/kukui.3/eugene/dcr.20141205/dvo.dcr.sh : figure8
 \begin{figure}[htbp]
   \begin{center}
- \includegraphics[width=\hsize,clip]{{pics/dcr.r2.g}.png}
+ \includegraphics[width=\hsize,clip]{{\picdir/DCR.example}.\plotext}
   \caption{\label{fig:DCRexample} Example of the DCR trend in the
     g-band.  {\bf top:} DCR trend in the parallactic direction {\bf
@@ -2118,14 +2073,17 @@
 % /data/ipp105.0/eugene/astrom.20170225/astroflat.20170217/astroflat.20170217.med.cam.dX.g.fits
 
+% last version in :
+% /data/kukui.1/eugene/cal.paper.images.20190217/flatplots.sh astroflat.example
 \begin{figure*}[htbp]
  \begin{center}
- \includegraphics[width=0.85\textwidth,clip]{{pics/astroflat.gri.v2}.png}
+ \includegraphics[width=0.85\textwidth,clip]{{\picdir/astroflat.gri.v2}.\plotext}
  \caption{\label{fig:astroflat.gri} High-resolution astrometric flat-field correction images for $gri$.}
  \end{center}
 \end{figure*}
 
+% /data/kukui.1/eugene/cal.paper.images.20190217/flatplots.sh astroflat.example
 \begin{figure*}[htbp]
  \begin{center}
- \includegraphics[width=0.85\textwidth,clip]{{pics/astroflat.zy.v2}.png}
+ \includegraphics[width=0.85\textwidth,clip]{{\picdir/astroflat.zy.v2}.\plotext}
  \caption{\label{fig:astroflat.zy} High-resolution astrometric flat-field correction images for $zy$.}
  \end{center}
@@ -2325,14 +2283,14 @@
 
 For the initial PV3 analysis, we again used the 2MASS coordinates as
-an external astrometric reference.  After the DR1 object parameters
-were ingested into the PSPS database, the Gaia DR1 astrometry was
-released \citep{2016AA...595A...4L}.  This gave us the option to use
-the Gaia positions for the external astrometric reference.  We re-did
-the astrometric analysis and generated a Gaia-based astrometry table
-for the Pan-STARRS DR1.  For Pan-STARRS DR2, the average object
-coordinates are based on the analysis using the Gaia coordinates.  The
-Gaia DR1 coordinates used a fixed 2015 epoch.  Coordinates were
-propagated from that epoch to the epoch for each PS1 image as
-described above.
+an external astrometric reference.  After the Pan-STARRS DR1 object
+parameters were ingested into the PSPS database, the Gaia DR1
+astrometry was released \citep{2016AA...595A...4L}.  This gave us the
+option to use the Gaia positions for the external astrometric
+reference.  We re-did the astrometric analysis and generated a
+Gaia-based astrometry table for the Pan-STARRS DR1.  For Pan-STARRS
+DR2, the average object coordinates are based on the analysis using
+the Gaia DR1 coordinates.  The Gaia DR1 coordinates used a fixed 2015
+epoch.  Coordinates were propagated from that epoch to the epoch for
+each PS1 image as described above.
 
 \subsection{Object Astrometry}
@@ -2347,5 +2305,5 @@
 PS1 \ippstage{chip}-stage measurements were used for the astrometry
 measurement (no stack or forced-warp measurements).  If available, the
-2MASS and Gaia astrometry for an object was also used in the
+2MASS and Gaia DR1 astrometry for an object was also used in the
 calculation of the astrometry.  Measurements which were kept for the
 astrometric fit for an object were marked with the bit-flags
@@ -2355,5 +2313,5 @@
 the bit flag \code{ID_MEAS_POOR_ASTROM}.
 
-If 2MASS or Gaia astrometry measurements
+If 2MASS or Gaia DR1 astrometry measurements
 were available for an object, {\em all} measurements for that object
 are marked with the bit-flag \code{ID_MEAS_OBJECT_HAS_2MASS} or
@@ -2494,12 +2452,13 @@
 \subsection{Astrometry Calibration Quality}
 
+% /data/kukui.1/eugene/cal.paper.images.20190217/scatter.sh : allsky.scatter.astrom
 \begin{figure*}[htbp]
   \begin{center}
- \includegraphics[width=\hsize,clip]{{pics/allsky.astrom.pv3.3}.png}
+ \includegraphics[width=\hsize,clip]{{\picdir/allsky.astrom.pv3.3}.\plotext}
   \caption{\label{fig:allsky.astrom.sigma} Consistency of astrometry
     measurements across the sky.  Each panel shows a map of the
     standard deviation of astrometry residuals for stars in each
     pixel.  The median value of the standard deviations across the sky
-    is $(\sigma_\alpha, \sigma_\delta) = (22, 23)$ milliarcseconds.
+    is $(\sigma_\alpha, \sigma_\delta) = (16, 16)$ milliarcseconds.
     These values reflect the typical single-measurement errors for
     bright stars.  See discussion regarding the astrometric flat which
@@ -2508,7 +2467,8 @@
 \end{figure*}
 
+% /data/kukui.1/eugene/cal.paper.images.20190217/flatplots.sh : astroflat.repair
 \begin{figure*}[htbp]
   \begin{center}
-  \includegraphics[width=\hsize,clip]{{pics/astroflat.repair}.png}
+  \includegraphics[width=\hsize,clip]{{\picdir/astroflat.repair}.\plotext}
   \caption{\label{fig:astroflat.repair} Comparison of the
     high-resolution astrometric flat-field images used for PV3.2
@@ -2535,7 +2495,8 @@
 %% filter y : 42867074 stars
 
+% /data/kukui.1/eugene/cal.paper.images.20190217/scatter.sh : allsky.histogram.astrom.compare
 \begin{figure*}[htbp]
   \begin{center}
-  \includegraphics[width=\hsize,clip]{{pics/allsky.histogram.astrom.compare}.png}
+  \includegraphics[width=\hsize,clip]{{\picdir/allsky.histogram.astrom.compare}.\plotext}
   \caption{\label{fig:allsky.astro.histogram} Illustration of the
     impact of the astrometric flat-field correction used for PV3.2 vs
@@ -2577,5 +2538,5 @@
 photometry, we attribute this to failure of the PSF fitting due to
 crowding.  The celestial North pole regions have somewhat elevated
-errors in both R.A. and DEC, with some specifc structures.  Some of
+errors in both R.A.\ and DEC, with some specifc structures.  Some of
 these structures may be due to the larger typical seeing at these high
 airmass regions, but some are due to astrometric failures which stem
@@ -2583,6 +2544,6 @@
 Section~\ref{sec:pole.problems} for further details).  Several
 features can be seen which appear to be an effect of the tie to the
-Gaia astrometry: the stripes near the center of the DEC image and the
-right side of the R.A. image.  The mesh of circular outlines one the 2
+Gaia DR1 astrometry: the stripes near the center of the DEC image and the
+right side of the R.A.\ image.  The mesh of circular outlines one the 2
 degree scale is due to the outer edge of the focal plane where the
 astrometric calibration is poorly determined.  
@@ -2697,4 +2658,5 @@
 
 \subsection{Comparison to Gaia}
+\label{sec:gaia.tie}
 
 After the full relative astrometry analysis was performed for the PV3
@@ -2704,12 +2666,12 @@
 observations.  Gaia DR1 objects which are bright enough to have proper
 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 not
+observations.  Thus, we are limited to using the Gaia DR1 mean positions
+reported for the fainter stars.  We extracted all Gaia DR1 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
+database from this dataset.  We then merged the Gaia DR1 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 using Gaia DR1 as an additional measurement.  We applied the
 analysis described above, applying the estimated distances to
-determine preliminary proper motions.  The Gaia mean epoch is reported
+determine preliminary proper motions.  The Gaia DR1 mean epoch is reported
 as 2015.0, so all Gaia measurements were assigned this epoch.  We
 wanted to ensure the Gaia measurements dominated the astrometric
@@ -2723,14 +2685,16 @@
 even at a lower weight, helps to tile over those gaps.
 
+% /data/kukui.3/eugene/pv3.stats.20161022/plots.sh
+
 \begin{figure*}[htbp]
   \begin{center}
-  \includegraphics[width=\hsize,clip]{{pics/gaia.photom.v1}.png}
-  \caption{\label{fig:gaia.photom} Comparison with Gaia
-    photometry. {\bf Left} Mean of PS1 - Gaia, {\bf Right} Standard
-    deviation of PS1 - Gaia.  For pixels with $|b| > 30$ and $\delta >
-    -30$, the standard deviation of the PS1 - Gaia mean values is 6.9
+  \includegraphics[width=\hsize,clip]{{\picdir/gaia.photom.v1}.\plotext}
+  \caption{\label{fig:gaia.photom} Comparison with Gaia DR1 
+    photometry. {\bf Left} Mean of PS1 - Gaia DR1, {\bf Right} Standard
+    deviation of PS1 - Gaia DR1.  For pixels with $|b| > 30$ and $\delta >
+    -30$, the standard deviation of the PS1 - Gaia DR1 mean values is 6.9
     millimagnitudes, while the median of the standard deviations is 12.4
     millimagnitudes.  The former is a statement about the consistency
-    of the Gaia and Pan-STARRS\,1 photometry, while the latter
+    of the Gaia DR1 and Pan-STARRS\,1 photometry, while the latter
     reflects the combined bright-end errors for both systems.  }
   \end{center}
@@ -2738,5 +2702,5 @@
 
 Figure~\ref{fig:gaia.photom} shows a comparison between the Pan-STARRS
-photometry in $g,r,i$ and the Gaia photometry in the $G$-band.  To
+photometry in $g,r,i$ and the Gaia DR1 photometry in the $G$-band.  To
 compare the PS1 photometry to the very broadband Gaia G filter, we
 have determined a transformation based on a 3rd order polynomial fit
@@ -2779,9 +2743,9 @@
 \begin{figure*}[htbp]
   \begin{center}
-  \includegraphics[width=0.45\hsize,clip]{{pics/gaia.astrom.mean}.png}
-  \includegraphics[width=0.45\hsize,clip]{{pics/gaia.astrom.sigma}.png}
+  \includegraphics[width=0.48\hsize,clip]{{\picdir/gaia.astrom.mean}.\plotext}
+  \includegraphics[width=0.48\hsize,clip]{{\picdir/gaia.astrom.sigma}.\plotext}
   \caption{\label{fig:gaia.astrom} Comparison with Gaia
-    astrometry. {\bf Left} Mean of PS1 - Gaia, {\bf Right} Standard
-    deviation of PS1 - Gaia.  The median value of the standard
+    astrometry. {\bf Left} Mean of PS1 - Gaia DR1, {\bf Right} Standard
+    deviation of PS1 - Gaia DR1.  The median value of the standard
     deviations is $(\sigma_\alpha, \sigma_\delta) = (4.8, 3.1)$
     milliarcseconds. }
@@ -2790,16 +2754,16 @@
 
 Figure~\ref{fig:gaia.astrom} shows a comparison between the Pan-STARRS
-mean astrometry positions in $\alpha,\delta$ and the Gaia astrometry.
+mean astrometry positions in $\alpha,\delta$ and the Gaia DR1 astrometry.
 For this comparison, we have seleted all PS1 stars with Gaia
-measurements with $14 < i < 19$ and with at least 10 total
+measurements with $14 < \ips < 19$ and with at least 10 total
 measurements.  For Figure~\ref{fig:gaia.astrom}, we calculate the
-difference between the position predicted by PS1 at the Gaia epoch
+difference between the position predicted by PS1 at the Gaia DR1 epoch
 (using the proper motion and parallax fit) and the position reported
 by Gaia.  For each pixel, we determine the histogram of these
-differences in the R.A\. and DEC directions, and calculate the median
+differences in the R.A.\ and DEC directions, and calculate the median
 and the 68\%-ile range.  In Figure~\ref{fig:gaia.astrom}, these
 values are plotted as a color scale.
 
-There is good consistency between the PS1 and Gaia astrometry.  There
+There is good consistency between the PS1 and Gaia DR1 astrometry.  There
 are patterns from the Galactic plane (though not very strongly at the
 bulge).  There are also clear features due to the PS1 exposure
@@ -2810,14 +2774,16 @@
 statisics of the per-exposure measurement residuals
 (Figure~\ref{fig:allsky.astrom.sigma}.  The standard deviations of the
-median differences are ($\sigma_\alpha, \sigma_\delta) = (4, 3)$
+median differences are ($\sigma_\alpha, \sigma_\delta) = (4.8, 3.1)$
 milliarcseconds.
 
 For a future data release, we will recalibrate the Pan-STARRS $3\pi$
-astrometry using the Gaia DR2 release.  The addition of Gaia-measured
-proper motions will obviate the need to correct for the Galactic rotation.
+astrometry using the Gaia DR2 release \citep{2018AA...616A...1G}.  The
+addition of Gaia-measured proper motions will obviate the need to
+correct for the Galactic rotation.
 
 \section{Polar Astrometry Issues}
-
-Internal consistency testing of the PV3 stacks measurements indicated
+\label{sec:pole.problems}
+
+Internal consistency testing of the PV3 stack measurements indicated
 potential problems with the astrometric registration of the exposures
 in small areas near the North Pole.  These issues were originally
@@ -2827,13 +2793,13 @@
 these anomalous sources demonstrated the presence of significant
 misalignments between exposures; one of the worst cases is shown in
-Figure~\ref{fig:pole.issue.exampe}.  While such sources appeared to be
+Figure~\ref{fig:pole.issue.example}.  While such sources appeared to be
 rare, astrometric registration errors have the potential to affect
 several different source properties: morphology and photometry in
 addition to astrometry.  Therefore we carried out an astrometric
-regsitration test for all skycells North of $ \delta=+70\deg$.
+regsitration test for all skycells North of $\delta=+70\mathdegree$.
 
 \begin{figure*}[htbp]
   \begin{center}
-  \includegraphics[width=\hsize,clip]{{pics/A1}.pdf}
+  \includegraphics[width=\hsize,clip]{{\picdir/A1}.pdf}
   \caption{\label{fig:pole.issue.example} Example of a stack source badly affected by polar astrometry failures.  Source from multiple detections from skycell 2643.093.}
   \end{center}
@@ -2841,26 +2807,20 @@
 
 This test was based primarily on the ``original detection positions'',
-\ie, the positions of sources (detections) found in individual
-exposures as measured after each exposure's astrometric calibration,
-but before recalibration of the combined values to the Gaia reference
-frame (described in Section 7.3).  We started by collecting the
-original detection positions (as defined above) for each skycell.  To
-ensure good signal-to-noise ratios and minimize potential spurious
-detections, we used only the top quartile (in flux) of detections
-within each chip.  We grouped these detections on a filter-by-filter
-basis within a radius of $ 2\farcs5 $ (10 pixels), ensuring that each
-group contained only one source per exposure, and retaining only
-groups with at least five detections; we then recorded the 2-D
-position dispersion for each group.  The mean positions for each group
-were cross-correlated against the Gaia DR2 sources, showing that these
-were real sources and providing information on their absolute
-astrometry.
-
-\begin{figure*}[htbp]
-  \begin{center}
-%  \includegraphics[width=\hsize,clip]{{pics/A2}.pdf}
-  \caption{\label{fig:pole.issue.example} Example of a stack source badly affected by polar astrometry failures.}
-  \end{center}
-\end{figure*}
+\ie, the positions of detections found in individual exposures as
+measured after each exposure's astrometric calibration, but before
+recalibration of the combined values to the Gaia reference frame
+(described in Section~\ref{sec:gaia.tie}) since that step had the
+opportunity to repair any astrometric failures.  We started by
+collecting the original detection positions (as defined above) for
+each skycell.  To ensure good signal-to-noise ratios and minimize
+potential spurious detections, we used only the top quartile (in flux)
+of detections within each chip.  We grouped these detections on a
+filter-by-filter basis within a radius of $ 2\farcs5 $ (10 pixels),
+ensuring that each group contained only one source per exposure, and
+retaining only groups with at least five detections; we then recorded
+the 2-D position dispersion for each group.  The mean positions for
+each group were cross-correlated against the Gaia DR2 sources \citep{2018AA...616A...1G}, showing
+that these were real sources and providing information on their
+absolute astrometry.
 
 Overall, the vast majority of the detection groups thus defined have
@@ -2869,25 +2829,12 @@
 having an internal dispersion $ > 1 $ pixel, can result from spurious
 sources or other anomalies, and are generally rare (fewer than a few
-percent of al groups).  However, some skycells have a significant
+percent of all groups).  However, some skycells have a significant
 fraction ($ > 10\%$) of bad groups.  Direct inspection demonstrates
 that the incidence of bad groups is related to astrometric
-registration failures.  Figure~\ref{fig:pole.astrom.failures} shows an
-example of a good and of a bad group.
-
-%% [Note: the rest of this
-%%   paragraph, and Figure A3, may be too much information for this
-%%   paper.]  It also appears that registration problems, when present,
-%% are not uniform within a skycell; Figure (A3) shows the difference
-%% between mean group position and the position of individual detections
-%% for all G band exposures overlapping skycell 2637.088, which has one
-%% of the worst-case mismatches in the g band.
-
-% caption: Map of astrometric displacement for all g-band exposures
-%    overlapping skycell 2637.088, with one of the worst astrometric
-%    registration issues. [Optional]
+registration failures.
 
 \begin{figure*}[htbp]
   \begin{center}
-  \includegraphics[width=\hsize,clip]{{pics/A4}.pdf}
+  \includegraphics[width=\hsize,clip]{{\picdir/A4}.pdf}
   \caption{\label{fig:pole.bad.histogram} Histogram of the fraction of bad groups for each skycell (red line).}
   \end{center}
@@ -2895,8 +2842,8 @@
 
 Bad skycells, defined as those with more than 10\% bad groups, are
-essentially limited to the North polar cap ($ \delta > +80^{\degree}$).
+essentially limited to the North polar cap ($ \delta > +80\mathdegree$).
 Of the 2500 skycells in this region, 164, or 6.6\%, have more than 10\% 
 bad groups; 64 of these have more than 20\% bad groups.  By comparison,
-essentially no skycells between $ +70^\degree $ and $ +80^\degree $ have
+essentially no skycells between $+70\mathdegree$ and $+80\mathdegree$ have
 more than 10\% bad groups.  Figure~\ref{fig:pole.bad.histogram} shows a histogram
 of the fraction of bad groups for each skycell.
@@ -2904,5 +2851,5 @@
 In order to have an independent validation of the impact of this
 astrometric alignment issue, we also carried out a photometric test
-based on a comparison of stack to mean object photometry.  In the
+based on a comparison between stack and mean object photometry.  In the
 presence of modest registration errors, mean object photometry would
 not be affected, as individual detection woulds have the correct
@@ -2917,29 +2864,89 @@
 in poor stack photometry for the affected skycells.
 
-\note{discuss the cause of the failure due to the duplicates in the reference catalog, and the original polar astrometry failures}
-
-As a result of these tests, we decided to 1) exclude from the main DR2
-catalogs all sources in the skycells with more than 10\% bad groups,
-and 2) to reprocess all such skycells with an improved procedure.  The
-reprocessing was carried out in late 2018, and the astrometric
-registration test was repeated on the reprocessed exposures.  The
-reprocessing greatly ameliorated the registration issue, as shown
-Figure (A4).  Here the red line shows the histogram of the fraction of
-bad groups for each skycell {\sl before reprocessing}, while the black
-line refers to the results {\sl after reprocessing}.  The improvement
-is apparent.  After reprocessing, only 23 cells, instead of the
-original 164, exceed 10\% of bad groups, and even for these the
-fraction of bad groups is substantially reduced.  Sources in the
-previously bad, now fixed skycells will be included in an upcoming
-partial release.
-
-\note{the above is not quite accurate -- a test reprocess demonstrated
-  partial improvement, but did not use a totally repaired ref catalog.
-  we are running a new analysis based on a DR2-tied catalog with
-  pristine source set.}
+Further investigaion revealed that the cause of these failures was an
+error in the internal reference catalog used for the PV3 analysis (see
+Section~\ref{sec:synthdb}).  This reference catalog used PS1
+observations to generate a catalog of \grizy\ photometry tied to the
+2MASS astrometric system.  The astrometry used for this catalog was
+generated using the analysis discussed in Section~\ref{sec:astrometry}
+to define a collection of reference stars with a coordinate system
+tied to 2MASS but with the higher accuracy of the Pan-STARRS
+measurements on small spatial scales.  Unfortunately, in the vicinity
+of the celestial north pole, this reference catalogs was contaminated
+by a number of poor measurements.  In this portion of the sky, the
+astrometric registration of the exposures is more challanging due to
+the degeneracy between boresite position errors and field rotation.
+In addition, the PS1 telescope suffers from larger pointing errors
+near the celestial north pole, largely for the same reason.  Because
+of these two factors, a number of exposures near the celestial pole
+were included in the reference database with invalid astrometry,
+injecting apparently good reference stars in the database with
+positions displaced from the true position by 1-2 arcseconds.
+Sometimes a chip processed in this region would find an astrometric
+solution using only good reference stars.  Sometimes the solution
+would use only bad reference stars, resulting in a chip apparently
+displaced from the truth position by 1-2 arcseconds.
+
+To correct the astrometry failures that caused the original errors in
+the reference catalog, we extended the field rotation search range for
+the polar exposures.  We also added tests to the analysis of the
+exposures to ensure they would not fail in a marginal way and
+introduce poor solutions into the calibration database.  We then ran a
+test to confirm that we could generate good astrometry in this region
+with an acceptable reference catalog.
+
+We first used the PV3 mean astrometry and photometry to define a new
+reference catalog in the assumption that the bulk of the failures
+would be eliminated by the astrometric recalibration.  We reprocesed a
+section of the polar cap data using this PV3-based reference catalog
+and re-ran the astrometric registration test was repeated on the
+reprocessed exposures.  The reprocessing greatly ameliorated the
+registration issue, as shown in Figure~\ref{fig:pole.bad.histogram}.
+Here the red line shows the histogram of the fraction of bad groups
+for each skycell {\sl before reprocessing}, while the black line
+refers to the results {\sl after reprocessing}.  The improvement is
+apparent.  After reprocessing, only 23 cells, instead of the original
+164, exceed 10\% of bad groups, and even for these the fraction of bad
+groups is substantially reduced.
+
+To further improve the astrometric calibration reliability in this
+region, we have generated a new reference catalog combining the PS1
+PV3 photometry with astrometry from Gaia DR2 \citep{2018AA...616A...1G}.  We are reprocessing all
+images from the region North of $+70\mathdegree$ and will provide a
+complete Polar Region release using the same data as used for DR2.
+This updated release is expected to be available from MAST near the
+end of summer 2019.
+
+We consider skycells with more than 10\% bad groups to have been
+adversely affected by this problem.  Uses of DR2 should be aware that
+the affected skycells have poor astrometry and effective image
+quality.  However, as these images may be useful to the community,
+they are available from the MAST cutout server.  Users who attempt to
+download these problem skycells will see a warning message and should
+avoid using the skycell images for quantitative measurements without
+extreme caution.  Since stack measurements from these skycells are
+significantly damaged, the DR2 release has set the measured stack
+properties of these objects to a null value.  Again, users should
+exercise caution with sources from the affected skycells.  
 
 \section{Conclusion}
 
-\note{WRITE THIS}
+The Pan-STARRS Data Release 2 provides astromtry and photometry of
+roughly 3 billion astronomical objects across the $3\pi$ survey
+region.  The photometry system has been shown to be reliable across
+the sky at the level of (8.0, 7.0, 9.0, 10.7, 12.4) millimags in
+(\grizy).  The median value of the measure standard deviations for
+stars across the sky is $(\sigma_g, \sigma_r, \sigma_i, \sigma_z,
+\sigma_y) = (14, 14, 15, 15, 18)$ millimags, reflecting the systematic
+floor on the accuracy of individual measurements of bright stars.  The
+astrometric calibration is tied to the Gaia DR1 frame with a
+systematic error floor of ($\sigma_\alpha, \sigma_\delta) = (4.8,
+3.1)$ milliarcseconds.  The median residual astrometric scatter for
+bright objects across the sky is 16 milliarcseconds in both R.A.\ and
+DEC.  Caution should be used for 164 skycells in the celestial north
+pole regions where the reference catalog was contaminated with
+astrometric failures.  The Pan-STARRS DR2 photometry and astrometry
+will be a valuable resource for many years for the astronomical
+community.
 
 \acknowledgments
@@ -2963,10 +2970,12 @@
 \ref{fig:allsky.photom.sigma}, \ref{fig:photom.pv3.3v4},
 \ref{fig:astroflat.gri}, \ref{fig:astroflat.zy},
-\ref{fig:allsky.astrom.sigma}, and \ref{fig:astroflat.repair} from
-Peter Kovesi \citep[Good Colour Maps: How to Design Them.][]{2015arXiv150903700K}.
+\ref{fig:allsky.astrom.sigma}, and \ref{fig:astroflat.repair} are
+based on the matplotlib ``magma'' colormap with additional guidance
+from Peter Kovesi's work \citep[Good Colour Maps: How to Design
+  Them.][]{2015arXiv150903700K}.
 
 \bibliographystyle{apj}
-\bibliography{lib}{}
-% \input{calibration.bbl}
+% \bibliography{lib}{}
+\input{calibration.bbl}
 
 \end{document}
