IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 6, 2017, 11:15:00 AM (10 years ago)
Author:
eugene
Message:

merge changes from trunk (updates to the papers)

Location:
branches/czw_branch/20160809/doc/release.2015/ps1.calibration
Files:
2 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20160809/doc/release.2015/ps1.calibration

    • Property svn:ignore set to
      calibration.aux
      calibration.dvi
      calibration.log
      calibration.pdf
      calibration.ps
      calibration.bbl
      calibration.blg
      calibrationNotes.bib
  • branches/czw_branch/20160809/doc/release.2015/ps1.calibration/calibration.tex

    r39567 r39920  
    88%\documentclass[preprint2,longabstract]{aastex}
    99\RequirePackage{color}
    10 % \input{astro.sty}
     10\RequirePackage{code}
     11\input{astro.sty}
    1112
    1213% online version may use color, but print version needs b/w
     
    1415%\def\plotmode{bw}
    1516
    16 %\def\plotext{pdf}
    17 \def\plotext{ps}
     17\def\plotext{pdf}
     18%\def\plotext{ps}
    1819
    1920%\def\picdir{/home/eugene/chipresid.20140404}
     
    2122
    2223% Pick a terse version of the title here;
    23 \shorttitle{Pixel Analysis in PS1}
     24\shorttitle{PS1 Calibration}
    2425\shortauthors{E.A. Magnier et al}
    2526\begin{document}
    26 \title{Pan-STARRS Pixel Analysis : Source Detection \& Characterization}
     27\title{Pan-STARRS Photometric and Astrometric Calibration}
    2728
    2829% this is a crude trick to get the order of affiliations right.  These
     
    3132% list and (2) re-order the list at the bottom (and comment-out as needed)
    3233\def\IfA{1}
    33 \def\CfA{2}
    34 \def\MPIA{3}
    35 \def\Princeton{3}
    36 \def\USNO{4}
    37 \def\JHU{1}
     34\def\LBL{2}
     35\def\Hubble{3}
     36\def\ITC{4}
     37\def\Harvard{5}
     38\def\MPIA{6}
     39\def\ARI{7}
     40\def\Princeton{8}
     41\def\DUR{9}
     42\def\CfA{10}
    3843
    3944% This example has a first author from UH:
    4045\author{
    41 Eugene A. Magnier,\altaffilmark{\IfA}
    42 IPP Team,
    43 %PS Builder List
     46Eugene. A. Magnier,\altaffilmark{\IfA}
     47Edward. F. Schlafly,\altaffilmark{\LBL,\Hubble}
     48Douglas P. Finkbeiner,\altaffilmark{\ITC,\Harvard}
     49J.~L. Tonry,\altaffilmark{\IfA}
     50B. Goldman,\altaffilmark{\MPIA}
     51S. R\"oser,\altaffilmark{\ARI}
     52E. Schilbach,\altaffilmark{\ARI}
     53K.~C. Chambers,\altaffilmark{\IfA}
     54H.~A. Flewelling,\altaffilmark{\IfA}
     55M. E. Huber,\altaffilmark{\IfA}
     56P.~A. Price,\altaffilmark{\Princeton}
     57W.~E. Sweeney,\altaffilmark{\IfA}
     58C. Z. Waters,\altaffilmark{\IfA}
     59% PS1 Builders
     60L. Denneau,\altaffilmark{\IfA}
     61P. Draper,\altaffilmark{\DUR}
     62K. W. Hodapp,\altaffilmark{\IfA}
     63R. Jedicke,\altaffilmark{\IfA}
     64N. Kaiser,\altaffilmark{\IfA}
     65R.-P. Kudritzki,\altaffilmark{\IfA}
     66N. Metcalfe,\altaffilmark{\DUR}
     67C.~W. Stubbs,\altaffilmark{\CfA}
    4468% W.~S. Burgett,\altaffilmark{\IfA}
    45 % K.~C. Chambers,\altaffilmark{\IfA}
    4669% T. Grav,\altaffilmark{\IfA}
    4770% J. N. Heasley,\altaffilmark{\IfA}
    48 % K. W. Hodapp,\altaffilmark{\IfA}
    49 % R. Jedicke,\altaffilmark{\IfA}
    50 % H.~A. Flewelling,\altaffilmark{\IfA}
    51 % N. Kaiser,\altaffilmark{\IfA}
    52 % R.-P. Kudritzki,\altaffilmark{\IfA}
    5371% G. A. Luppino,\altaffilmark{\IfA}
    5472% R. H. Lupton,\altaffilmark{\Princeton}
     
    5674% J.~S. Morgan,\altaffilmark{\IfA}
    5775% P. M. Onaka,\altaffilmark{\IfA}
    58 % P.~A. Price,\altaffilmark{\Princeton}
    59 % W.~E. Sweeney,\altaffilmark{\IfA}
    60 % C.~W. Stubbs,\altaffilmark{\CfA}
    61 % J.~L. Tonry, \altaffilmark{\IfA}
    62 % R. J. Wainscoat,\altaffilmark{\IfA} and
     76R. J. Wainscoat\altaffilmark{\IfA}
    6377% M. F. Waterson,\altaffilmark{\IfA}
    6478} % this bracket terminates author list
    6579
     80\altaffiltext{\IfA}{Institute for Astronomy, University of Hawaii, 2680 Woodlawn Drive, Honolulu HI 96822}
     81\altaffiltext{\LBL}{Lawrence Berkeley National Laboratory, One Cyclotron Road, Berkeley, CA 94720, USA}
     82\altaffiltext{\Hubble}{Hubble Fellow}
     83\altaffiltext{\ITC}{Institute for Theory and Computation, Harvard-Smithsonian Center for Astrophysics, 60 Garden Street, MS-51, Cambridge, MA 02138 USA}
     84\altaffiltext{\Harvard}{Department of Physics, Harvard University, Cambridge, MA 02138 USA}
     85\altaffiltext{\MPIA}{Max Planck Institute for Astronomy, K\"onigstuhl 17, D-69117 Heidelberg, Germany}
     86\altaffiltext{\ARI}{Astronomisches Rechen-Institut, Zentrum f\"ur Astronomie der Universit\"at Heidelberg, M\"ochhofstrasse 12-14, D-69120 Heidelberg, Germany}
     87\altaffiltext{\Princeton}{Department of Astrophysical Sciences, Princeton University, Princeton, NJ 08544, USA}
     88\altaffiltext{\DUR}{Department of Physics, Durham University, South Road, Durham DH1 3LE, UK}
     89\altaffiltext{\CfA}{Harvard-Smithsonian Center for Astrophysics, 60 Garden Street, Cambridge, MA 02138}
     90
    6691% The ordering here should be sequential, matching the sequence in the list of authors:
    67 \altaffiltext{\IfA}{Institute for Astronomy, University of Hawaii, 2680 Woodlawn Drive, Honolulu HI 96822}
    68 % \altaffiltext{\CfA}{Harvard-Smithsonian Center for Astrophysics, 60 Garden Street, Cambridge, MA 02138}
    69 % \altaffiltext{\Princeton}{Department of Astrophysical Sciences, Princeton University, Princeton, NJ 08544, USA}
    7092% \altaffiltext{\USNO}{US Naval Observatory, Flagstaff Station, Flagstaff, AZ 86001, USA}
    7193% \altaffiltext{\JHU}{Department of Physics and Astronomy, Johns Hopkins University, 3400 North Charles Street, Baltimore, MD 21218, USA}
    72 % \altaffiltext{\MPIA}{Max Planck Institute for Astronomy, K\"onigstuhl 17, D-69117 Heidelberg, Germany}
     94
     95% \altaffiltext{\Strassborg}{
     96
    7397\begin{abstract}
    7498
    75 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum
    76 bibendum nisi id tristique posuere. Duis eu mollis nulla. Maecenas est
    77 turpis, mattis tempor urna vitae, placerat rhoncus sem. Lorem ipsum
    78 dolor sit amet, consectetur adipiscing elit. Sed quis velit
    79 nisl. Aliquam erat volutpat. Cras lacinia, nisl tristique auctor
    80 molestie, dolor nulla rhoncus purus, ac accumsan nunc nunc ac
    81 nibh. Maecenas vitae mollis mauris. Ut sollicitudin pulvinar purus,
    82 eget luctus lorem tincidunt vitae. Vestibulum eu mattis neque. Nulla
    83 in tortor id urna dapibus gravida a vel leo.
     99The Pan-STARRS\,1 $3\pi$ survey has produced photometry and astrometry
     100covering the \approx 30,000 square degrees $\delta > -30$\degrees. 
     101This article describes the photometric and astrometric calibration of this survey.
    84102
    85103\end{abstract}
     
    88106\keywords{Surveys:\PSONE }
    89107
     108\section{Introduction}\label{sec:intro}
     109
     110This is the fifth in a series of seven papers describing the
     111Pan-STARRS1 Surveys, the data reduction techiques and the resulting
     112data products.  This paper (Paper V) describes the final calibration
     113process, and the resulting photometric and astrometric quality.
     114
     115%Chambers et al. 2017 (Paper I)
     116%The Pan-STARRS\,1 Surveys
     117\citet[][Paper I]{chambers2017}
     118provides an overview of the Pan-STARRS System, the design and
     119execution of the Surveys, the resulting image and catalog data
     120products, a discussion of the overall data quality and basic
     121characteristics, and a brief summary of important results.
     122
     123%Magnier et al. 2017 (Paper II)
     124%Pan-STARRS Data Processing Stages
     125\citet[][Paper II]{magnier2017c}
     126describes how the various data processing stages are organised and implemented
     127in the Imaging Processing Pipeline (IPP), including details of the
     128the processing database which is a critical element in the IPP infrastructure .
     129
     130%Waters et al. 2017 (Paper III)
     131%Pan-STARRS Pixel Processing : Detrending, Warping, Stacking
     132\citet[][Paper III]{waters2017}
     133describes 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.
     134
     135
     136%Magnier et al. 2017 (Paper IV)
     137%Pan-STARRS Pixel Analysis : Source Detection
     138\citet[][Paper IV]{magnier2017a}
     139describes the details of the source detection and photometry, including point-spread-function and extended source fitting models, and the techniques for ``forced" photometry measurements.
     140
     141%Magnier et al. 2017 (Paper V)
     142%Pan-STARRS Photometric and Astrometric Calibration
     143%\citet[][Paper V]{magnier2017b}
     144%describes the final calibration process, and the resulting photometric and astrometric quality. 
     145
     146
     147%Flewelling et al. 2017 (Paper VI)
     148%Pan-STARRS 1 Database and Data Products
     149\citet[][Paper VI]{flewelling2017}
     150describes  the details of the resulting catalog data and its organization in the Pan-STARRS database.
     151%
     152%
     153\citet[][Paper VII]{huber2017}
     154%Huber et al. 2017 (Paper VII)
     155describes 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)
     156
     157%
     158The Pan-STARRS1 filters and photometric system have already been
     159described in detail in \cite{2012ApJ...750...99T}.
     160
     161{\color{red} {\em Note: These papers are being placed on arXiv.org to
     162    provide crucial support information at the time of the public
     163    release of Data Release 1 (DR1). We expect the arXiv versions to
     164    be updated prior to submission to the Astrophysical Journal in
     165    January 2017. Feedback and suggestions for additional information
     166    from early users of the data products are welcome during the
     167    submission and refereeing process.}}
     168
     169\section{Pan-STARRS\,1}
     170
     171From May 2010 through March 2014, the Pan-STARRS Science Consortium
     172used the 1.8m \PSONE\ telescope to perform a set of wide-field science
     173surveys.  These surveys are designed to address a range of science
     174goals included the search for hazardous asteroids, the study of the
     175formation and architecture of the Milky Way galaxy, and the search for
     176Type Ia supernovae to measure the history of the expansion of the
     177universe. 
     178
     179The wide-field \PSONE\ telescope consists of a 1.8~meter diameter
     180$f$/4.4 primary mirror with an 0.9~m secondary, producing a 3.3 degree
     181field of view \citep{2004SPIE.5489..667H}.  The optical design yields
     182low distortion and minimal vignetting even at the edges of the
     183illuminated region.  The optics, in combination with the natural
     184seeing, result in generally good image quality: the median image
     185quality for the 3$\pi$ survey is FWHM = (1.31, 1.19, 1.11, 1.07, 1.02)
     186arcseconds for (\grizy), with a floor of $\sim0.7$ arcseconds.  The
     187\PSONE\ camera \citep{2009amos.confE..40T} is a mosaic of 60
     188edge-abutted $4800\times4800$ pixel back-illuminated CCID58 Orthogonal
     189Transfer Arrays manufactured by Lincoln Laboratory
     190\citep{2006amos.confE..47T,2008SPIE.7021E..05T}.  The CCDs have
     19110~$\mu$m pixels subtending 0.258~arcsec and are 70$\mu$m thick.  The
     192detectors are read out using a StarGrasp CCD controller, with a
     193readout time of 7 seconds for a full unbinned image
     194\citep{2008SPIE.7014E..0DO}.  The active, usable pixels cover $\sim
     19580$\% of the FOV.
     196
     197Nightly observations are conducted remotely from the Advanced
     198Technology Research Center in Kula, the main facility of the
     199University of Hawaii's Institute for Astronomy operations on Maui.
     200During the \PSONE\ Science Survey, images obtained by the
     201\PSONE\ system were stored first on computers at the summit, then
     202copied with low latency via internet to the dedicated data analysis
     203cluster located at the Maui High Performance Computer Center in Kihei,
     204Maui.
     205
     206Images obtained by \PSONE\ are automatically processed in real time by
     207the \PSONE\ Image Processing Pipeline \citep[IPP,][]{magnier2017a}.
     208Real-time analysis goals are aimed at feeding the discovery pipelines
     209of the asteroid search and supernova search teams.  The data obtained
     210for the \PSONE\ Science Survey has also been used in three additional
     211complete re-processing of the data: Processing Versions 1, 2, and 3
     212(PV1, PV2, and PV3).  The real-time processing of the data is
     213considered ``PV0''.  Except as otherwise noted, the PV3 analysis of
     214the data is used for the purpose of this article.
     215
     216The data processing steps are described in detail by \cite{waters2017}
     217and \cite{magnier2017a,magnier2017b}.  In summary, individual images
     218are detrended: non-linearity and bias corrections are applied, a dark
     219current model is subtracted and flat-field corrections are applied.
     220The \yps-band images are also corrected for fringing: a master fringe
     221pattern is scaled to match the observed fringing and subtracted.  Mask
     222and variance image arrays are generated with the detrend analysis and
     223carried forward at each stage of the IPP processing.  Source detection
     224and photometry are performed for each chip independently.  As
     225discussed below, preliminary astrometric and photometric calibrations
     226are performed for all chips in a single exposure in a single analysis.
     227
     228Chip images are geometrically transformed based on the astrometric
     229solution into a set of pre-defined pixel grids covering the sky,
     230called skycells.  These transformed images are called the warp images.
     231Sets of warps for a given part of the sky and in the same filter may
     232be added together to generate deeper `stack' images.  PSF-matched
     233difference images are generated from combinations of warps and stacks;
     234the details of the difference images and their calibration are outside
     235of the scope of this article.
     236
     237% Individual warp images are differenced during the nightly processing
     238% to detect the fast moving asteroids.  Stacks are subtracted from
     239% individual warps, and deep stacks are subtracted from stack generated
     240% from images for a single night (nightly stacks). 
     241
     242Astronomical objects are detected and characterized in the stacks
     243images.  The details of the analysis of the sources in the stack
     244images are discussed in \cite{magnier2017b}, but in brief these include
     245PSF photometry, along with a range of measurements driven by the goals
     246of understanding the galaxies in the images.  Because of the
     247significant mask fraction of the GPC1 focal plane, and the varying
     248image quality both within and between exposures, the effective PSF of
     249the PS1 stack images is highly variable.  The PSF varies significantly
     250on scales as small as a few to tens of pixels, making accurate PSF
     251modelling essentially infeasible.  The PSF photometry of sources in
     252the stack images is thus degraded significantly compared to the
     253quality of the photometry measured for the individual chip images. 
     254
     255To recover most of the photometric quality of the individual chip
     256images, while also exploiting the depth afforded by the stacks, the
     257PV3 analysis make use of forced photometry on the individual warp
     258images.  PSF photometry is measured on the warp images for all sources
     259which are detected in the stack images images.  The positions
     260determined in the stack images are used in the warp images, but the
     261PSF model is determined for each warp independently based on brighter
     262stars in the warp image.  The only free parameter for each object is
     263the flux, which may be insignificant or even negative for sources
     264which are near the faint limit of the stack detections.  When the
     265fluxes from the individual warp images are averaged, a reliable
     266measurement of the faint source flux is determined.  The details of
     267this analysis are described in detail in Magnier et al
     268\cite{magnier2017b}.
     269
     270In this article, we discuss the photometric calibration of the
     271individual exposures, the stacks, and the warp imags.  We also discuss
     272the astrometric calibration of the individual exposures and the stack
     273images.
     274
     275\section{Astrometric Models}
     276
     277% \note{include projection math?} 
     278% \note{reference discussion somewhere on cell vs chip}
     279
     280Three somewhat distinct astrometric models are employed within the IPP
     281at different stages.  The simplest model is defined independently for
     282each chip: a simple TAN projection as described by
     283\cite{2002AA...395.1077C} is used to relate sky coordinates to a
     284cartesian tangent-plane coordinate system.  A pair of low-order
     285polynomials are used to relate the chip pixel coordinates to this
     286tangent-plane coordinate system.  The transforming polynomials are of
     287the form:
     288\begin{eqnarray}
     289P & = & \sum_{i,j} C^P_{i,j} X^i_{\rm chip} Y^j_{\rm chip} \\
     290Q & = & \sum_{i,j} C^Q_{i,j} X^i_{\rm chip} Y^j_{\rm chip}
     291\end{eqnarray}
     292where $P,Q$ are the tangent plane coordinates, $X_{\rm chip}, Y_{\rm
     293  chip}$ are the coordinates on the 60 GPC1 chips, and $C^P_{i,j}, C^Q_{i,j}$
     294are the polynomial coefficients for each order.  In the \code{psastro}
     295analysis, $i + j <= N_{\rm order}$ where the order of the fit, $N_{\rm
     296  order}$, may be 1 to 3, under the restriction that sufficient stars
     297are needed to constrain the order. 
     298
     299% \note{describe a bit better: this is automatically selected based on the number of stars}
     300
     301A second form of astrometry model which yields somewhat higher
     302accuracy consists of a set of connected solutions for all chips in a
     303single exposure.  This model also uses a TAN projection to relate the
     304sky coordinates to a locally cartesian tangent plane coordinate system.
     305A set of polynomials is then used to relate the tangent plane
     306coordinates to a 'focal plane' coordinate system, $L,M$:
     307\begin{eqnarray}
     308P & = & \sum_{i,j} C^P_{i,j} L^i M^j \\
     309Q & = & \sum_{i,j} C^Q_{i,j} L^i M^j
     310\end{eqnarray}
     311This set of polynomial accounts for effects such as optical distortion
     312in the camera and distortions due to changing atmospheric refraction
     313across the field of the camera.  Since these effects are smooth across
     314the field of the camera, a single pair of polynomials can be used for
     315each exposure.  Like in the chip analysis about, the \code{psastro}
     316code restricts the exponents with the rule $i + j <= N_{\rm order}$
     317where the order of the fit, $N_{\rm order}$, may be 1 to 3, under the
     318restriction that sufficient stars are needed to constrain the order
     319For each chip, a second set of polynomials describes the
     320transformation from the chip coordinate systems to the focal
     321coordinate system:
     322\begin{eqnarray}
     323L & = & \sum_{i,j} C^L_{i,j} X^i_{\rm chip} Y^j_{\rm chip} \\
     324M & = & \sum_{i,j} C^M_{i,j} X^i_{\rm chip} Y^j_{\rm chip}
     325\end{eqnarray}
     326
     327A third form of the astrometry model is used in the context of the
     328calibration determined within the DVO database system.  We retain the
     329two levels of transformations (chip $\rightarrow$ focal plane $\rightarrow$
     330tangent plane), but the relationship between the chip and focal plane
     331is represented with only the linear terms in the polynomial,
     332supplemented by a course grid of displacements, $\delta L, \delta M$ sampled
     333across the coordinate range
     334of the chip.  This displacement grid may have a resolution of up to
     335$6\times6$ samples across the chip.  The displacement for a specific
     336chip coordinate value is determined via bilinear interpolation between
     337the nearest sample points.  Thus, the chip to focal-plane
     338transformation may be written as:
     339\begin{eqnarray}
     340  L & = & C^L_{0,0} + C^L_{1,0} X_{\rm chip} + C^L_{0,1} Y_{\rm chip} + \delta L(X_{\rm chip}, Y_{\rm chip}) \\
     341  M & = & C^M_{0,0} + C^M_{1,0} X_{\rm chip} + C^M_{0,1} Y_{\rm chip} + \delta M(X_{\rm chip}, Y_{\rm chip})
     342\end{eqnarray}
     343
     344{\bf WCS Keywords} When this polynomial representation is written to
     345the output files, a set of WCS keywords are used to define the
     346astrometric transformation elements.  It is necessary to transform the
     347simply polynomials above into an alternate form:
     348\begin{eqnarray}
     349  P & = & \sum_{i,j} C^P_{i,j} (X_{\rm chip} - X_0)^i (Y_{\rm chip} - Y_0)^j \\
     350  Q & = & \sum_{i,j} C^Q_{i,j} (X_{\rm chip} - X_0)^i (Y_{\rm chip} - Y_0)^j
     351\end{eqnarray}
     352
     353%% \note{need to complete this discussion of the WCS keywords, both
     354%%   standard and non-standard, used to represent these polynomial
     355%%   transformations}
     356
     357%% \begin{verbatim}
     358%% Here is a list of the keywords
     359%% and the related terms from Eqns above:
     360%% CTYPE1,2 : RA---WRP, DEC--WRP
     361%% CTYPE1,2 : RA---DIS, DEC--DIS
     362%% CRVAL1,2 : C^{L,M}_{0,0}
     363%% CRPIX1,2 : X_0, Y_0
     364%% PC001001 : C^{L}_{1,0}
     365%% PC001002 : C^{L}_{0,1}
     366%% PC002001 : C^{M}_{1,0}
     367%% PC002002 : C^{M}_{0,1}
     368%% PCA1XiYj : C^{L}_{i,j}
     369%% PCA2XiYj : C^{M}_{i,j}
     370%% \end{verbatim}
     371
     372\section{Real-time Calibration}
     373
     374\subsection{Overview}
     375
     376As images are processed by the data analysis system, every exposure is
     377calibrated individually with respect to a photometric and astrometric
     378database.  The goal of this calibration step is to generate a preliminary
     379astrometric calibration, to be used by the warping analysis to determine
     380the geometric transformation of the pixels, and preliminary
     381photometric transformation, to be used by the stacking analysis to
     382ensure the warps are combined using consistent flux units.
     383
     384The program used for the real-time calibration, \code{psastro}, loads
     385the measurements of the chip detections from their individual
     386\code{cmf}-format files.  It uses the header information populated at
     387the telescope to determine an initial astrometric calibration guess
     388based on the position of the telescope boresite right ascension,
     389declination and position angle as reported by the telescope \& camera
     390subsystems.  Using the initial guess, \code{psastro} loads astrometric
     391and photometric data from the reference database. 
     392
     393\subsection{Reference Catalogs}
     394
     395During the course of the PS1SC Survey, several reference databases
     396have been used.  For the first 20 months of the survey, \code{psastro}
     397used a reference catalog with synthetic PS1 \grizy\ photometry
     398generated by the Pan-STARRS IPP team based on based combined
     399photometry from Tycho (B, V), USNO (red, blue, IR), and 2MASS $J, H,
     400K$.  The astrometry in the database was from 2MASS.  After 2012 May, a
     401reference catalog generated from internal re-calibration of the PV0
     402analysis of PS1 photometry and astrometry was used for the reference
     403catalog. 
     404
     405% \note{discuss history of the different refcats?} 
     406
     407Coordinates and calibrated magnitudes of stars from the reference
     408database are loaded by \code{pasastro}.  A model for the positions of
     409the 60 chips in the focal plane is used to determine the expected
     410astrometry for each chip based on the boresite coordinates and
     411position angle reported by the header.  Reference stars are selected
     412from the full field of view of the GPC1 camera, padded by an
     413additional 25\% to ensure a match can be determined even in the
     414presence of substantial errors in the boresite coordinates.  It is
     415important to choose an appropriate set of reference stars: if too few
     416are selected, the chance of finding a match between the reference and
     417observed stars is diminished.  In addition, since stars are loaded in
     418brightness order, a selection which is too small is likely to contain
     419only stars which are saturated in the GPC1 images.  On the other hand,
     420if too many reference stars are chosen, there is a higher chance of a
     421false-positive match, especially as many of the reference stars may
     422not be detected in the GPC1 image.  The seletion of the reference
     423stars includes a limit on the brightest and fainted magnitude of the
     424stars selected.
     425
     426The astrometric analysis is necessarily performed first; after the
     427astrometry is determined, an automatic byproduct is a reliable match
     428between reference and observed stars, allowing a comparison of the
     429magnitudes to determine the photometric calibration. 
     430
     431The astrometric calibration is performed in two major stages: first,
     432the chips are fitted independently with independent models for each
     433chip.  This fit is sufficient to ensure a reliable match between
     434reference stars and observed sources in the image.  Next, the set of
     435chip calibrations are used to define the transformation between the
     436focal plane coordinate system and the tangent plane coordinate
     437system.  The chip-to-focal plane transformations are then determined
     438under the single common focal plane to tangent plane transformation. 
     439
     440\subsection{Cross-Correlation Search}
     441
     442The first step of the analysis is to attempt to find the match between
     443the reference stars and the detected objects.  \code{psastro} uses 2D
     444cross correlation to search for the match.  The guess astrometry
     445calibration is used to define a predicted set of $X^{\rm ref}_{\rm
     446  chip}, Y^{\rm ref}_{\rm chip}$ values for the reference catalog
     447stars.  For all possible pairs between the two lists, the values of
     448\begin{eqnarray}
     449\Delta X & = & X^{\rm ref}_{\rm chip} - X^{\rm obs}_{\rm chip}\\
     450\Delta Y & = & Y^{\rm ref}_{\rm chip} - Y^{\rm obs}_{\rm chip}
     451\end{eqnarray}
     452are generated.  The collection of $\Delta X, \Delta Y$ values are
     453collected in a 2D histogram with sampling of 50 pixels and the
     454peak pixel is identified.  If the astrometry guess were perfect, this
     455peak pixel would be expected to lie at (0,0) and contain all of the
     456matched stars.  However, the astrometric guess may be wrong in
     457several ways.  An error in the constant term above, $C^P_{0,0},
     458C^Q_{0,0}$ shifts the peak to another pixel, from which $C^P_{0,0},
     459C^Q_{0,0}$ can easily be determined.  An error in the plate scale or a
     460rotation will smear out the peak pixel potentially across many pixels
     461in the 2D histogram. 
     462
     463To find a good match in the face of plate scale and rotation errors,
     464the cross correlation analysis above is performed for a series of
     465trials in which the scale and rotation are perturbed from the nominal
     466value by a small amount.  For each trial, the peak pixel is found and
     467a figure of merit is measured.  The figure of merit is defined as
     468$\frac{\sigma^2_x + \sigma^2_y}{N_p^4}$ where $\sigma^2_{x,y}$ are the
     469second moment of $\Delta X,Y$ for the star pairs associated with the
     470peak pixel, and $N_p$ is the number of star pairs in the peak.  This
     471figure of merit is thus most sensitive to a narrow distribution with
     472many matched pairs.  For the PS1 exposures, rotation offsets of (-1.0,
     473-0.5, 0.0, 0.5, 1.0) degrees, and plate scales of (+1\%, 0, -1\%) of
     474the nominal plate scale are tested.  The best match among these 15
     475cross-correlation tests is selected and used to generate a better
     476astrometry guess for the chip.
     477
     478%% \note{option to downweight based on photometric inconsistency : not used in PS1 analysis}
     479
     480\subsection{Chip Polynomial Fits}
     481
     482The astrometry solution from the cross correlation step above is again
     483used to selected matches between the reference stars and observed
     484stars in the image.  The matching radius starts off quite large, and a
     485series of fits is performed to generate the transformation between
     486chip and tangent plane coordinates.  Three clipping iterations are
     487performed, with outliers $> 3 \sigma$ rejected on each pass, where
     488here $\sigma$ is determined from the distribution of the residuals in
     489each dimension (X,Y) independently.  After each fit cycle, the matches
     490are redetermined using a smaller radius and the fit re-tried. 
     491
     492\subsection{Mosaic Astrometry Polynomial Fits}
     493
     494The astrometry solutions from the independent chip fits are used to
     495generate a single model for the camera-wide distortion terms.  The
     496goal is to determine the two stage fit (chip $\rightarrow$ focal plane
     497$\rightarrow$ tangent plane).  There are a number of degenerate terms
     498between these two levels of transformation, most obviously between the
     499parameters which define the constant offset from chip to focal plane
     500($C^{L,M}_{0,0}$) and those which define the offset from focal plane
     501to tangent plane ($C^{P,Q}_{0,0}$).  We limit ($C^{P,Q}_{0,0}$) to be
     5020,0 to remove this degeneracy. 
     503
     504The initial fit of the astrometry for each chip follows the distortion
     505introduced by the camera: the apparent plate scale for each chip is
     506the combination of the plate scale at the optical axis of the camera,
     507modified by the local average distortion.  To isolate the effect of
     508distortion, we choose a single common plate scale for the set of chips
     509and re-define the chip $\rightarrow$ sky calibrations as a set of chip
     510$\rightarrow$ focal plane transformation using that common pixel
     511scale.  We can now compare the observed focal plane coordinates,
     512derived from the chip coordinates, and the tangent plane coordiantes,
     513derived from the projection of the reference coordinates.  One caveat
     514is that the chip reference coordinates are also degenerate with the
     515fitted distortion.  In order to avoid being sensitive to the exact
     516positions of the chips at this stage, we measure the local gradient
     517between the focal plane and tangent plane coordinate systems.  We then
     518fit the gradient with a polynomial of order 1 less than the polynomial
     519desired for the distortion fit.  The coefficients of the gradient fit
     520are then used to determine the coefficients for the polynomials
     521representing the distortion. 
     522
     523%% \note{write out the math of the gradients}
     524
     525Once the common distortion coming from the optics and atmosphere have
     526been modeled, \code{psastro} determines polynomial transformations
     527from the 60 chips to the focal plane coordinate system.  In this
     528stage, 5 iterations of the chip fits are performed.  Before each
     529iteration, the reference stars and detected objects are matched using
     530the current best set of transformations.  These fits start with low
     531order (1) and large matching radius.  As the iterations proceed, the
     532radius is reduced and the order is allowed to increaes, up to 3rd
     533order for the final iterations. 
     534
     535%% \note{quality of the fits as a result of this stage}.
     536
     537\subsection{Real-time Photometric Calibration}
     538
     539%% \note{define / describe the robust median}
     540
     541After the astrometric calibration has finished, the photometric
     542calibration is performed by \code{psastro}.  When the reference stars
     543are loaded, the apparent magnitude in the filter of interest is also
     544loaded.  Stars for which the reference magnitude is brighter than
     545(\grizy) = (19, 19, 18.5, 18.5, 17.5) are used to determine the zero
     546points by comparison with the instrumental magnitudes.  For the PV3
     547analysis, an outlier-rejecting median is used to measure the zero
     548point. For early versions of the analysis, when the reference catalog
     549used synthetic magnitudes, it was necessary to search for the blue
     550edge of the distribution: the synthetic magnitude poorly predicted the
     551magnitudes of stars in the presence of significant extinction or for
     552the very red stars, making the blue edge somewhat more reliable.  Note
     553that we do not include an airmass correction in this zero point
     554analysis: the airmass correction is folded into the observed zero
     555point.  The zero point may be measured separately for each chip or as
     556a single value for the entire exposure; the latter option was used for
     557the PV3 analysis.
     558
     559\subsection{Real-time outputs}
     560
     561The calibrations determined by \code{psastro} as saved as part of the
     562header information in the output FITS tables.  A single
     563multi-extension FITS table is written using the \code{smf} format.  In
     564these files, the measurements from each chip are written as a separate
     565FITS table.  A second FITS extension for each chip is used to store
     566the header information from the original chip image.  The original
     567chip header is modified so that the extension corresponds to an image
     568with no pixels data: \code{NAXIS} is set to 0, even though
     569\code{NAXIS1} and \code{NAXIS2} are retained with the original
     570dimensions of the chip.  A pixel-less primary header unit (PHU) is
     571generated with a summary of some of the important and common
     572chip-level keywords (e.g., \code{DATE-OBS}).  The astrometric
     573transformation information for each chip is saved in the corresponding
     574header using standard (and some non-standard) WCS keywords.  For the
     575two-level astrometric model, the PHU header carries the astrometric
     576transformation related to the projection and the camera-wide
     577distortions.  Photometric calibrations are written as a set of
     578keywords to individual chip headers, and if the calibration is
     579performed at the exposure-level, to the PHU.  The photometry
     580calibration keywords are:
     581\begin{itemize}
     582\item \code{ZPT_REF} : the nominal zero point for this filter
     583\item \code{ZPT_OBS} : the measured zero point for this chip /
     584  exposure
     585\item \code{ZPT_ERR} : the measured error on \code{ZPT_OBS}
     586\item \code{ZPT_NREF} : the number of stars used to measure \code{ZPT_OBS}
     587\item \code{ZPT_MIN} : minimum reference magnitude included in analysis
     588\item \code{ZPT_MAX} : maximum reference magnitude included in analysis
     589\end{itemize}
     590The keyword \code{ZPT_OBS} is used to set the initial zero point when
     591the data from the exposure are loaded into the DVO database.
     592
     593\section{PV3 DVO Master Database}
     594
     595Data from the GPC1 chip images, the stack images, and the warp images
     596are loaded into DVO using the real-time analysis astrometric
     597calibration to guide the association of detections into objects.
     598After the full PV3 DVO database was constructed, including all of the
     599chip, stack, and warp detections, several external catalogs were
     600merged into the database.  First, the complete 2MASS PSC was loaded
     601into a stand-alone DVO database, which was then merged into the PV3
     602master database.  Next the DVO database of synthetic photometry in the
     603PS1 bands (see Section~\ref{sec:synthdb}) was merged in.  Next, the
     604full Tycho database was added, followed by the AllWISE database.
     605After the Gaia release in August 2016 \citep{2016AA...595A...2G}, we
     606generated a DVO database of the Gaia positional and photometric
     607information and merged that into the master DVO database.
     608
     609%% \note{need to describe the assignment of flags, etc, for the external data sources}.
     610
     611\section{Photometry Calibration}
     612
     613\subsection{Ubercal Analysis}
     614
     615% \note{clean up and re-word the pieces below}
     616
     617The photometric calibration of the DVO database starts with the
     618``ubercal'' analysis technique as described by
     619\cite{2012ApJ...756..158S}.  This analysis is performed by the group
     620at Harvard, loading data from the \code{smf} files into their instance
     621of the Large Scale Database \citep[LSD,][]{2011AAS...21743319J}, a
     622system similar to DVO used to manage the detections and determine the
     623calibrations.
     624
     625Photometric nights are selected and all other exposures are ignored.
     626Each night is allowed to have a single fitted zero point and a single
     627fitted value for the airmass extinction coefficient per filter.  The
     628zero points and extinction terms are determined as a least squares
     629minimization process using the repeated measurements of the same stars
     630from different nights to tie nights together.  Flat-field corrections
     631are also determined as part of the minimization process.  In the
     632original (PV1) ubercal analysis, \cite{2012ApJ...756..158S} determined
     633flat-field corrections for $2\times 2$ sub-regions of each chip in the
     634camera and four distinct time periods (``seasons'').  Later analysis
     635(PV2) used an $8\times8$ grid of flat-field corrections to good
     636effect.
     637
     638The ubercal analysis was re-run for PV3 by the Harvard group.  For the
     639PV3 analysis, under the pressure of time to complete the analysis, we
     640chose to use only a $2\times 2$ grid per chip as part of the ubercal
     641fit and to leave higher frequency structures to the later analysis.  A
     6425th flat-field season consisting of nearly the last 2 years of data
     643was also included for PV3.  In retrospect, as we show below, the data
     644from the latter part of the survey would probably benefit from
     645additional flat-field seasons.
     646
     647%% \note{something for PV4}.
     648
     649By excluding non-photometric data and only fitting 2 parameters for
     650each night, the Ubercal solution is robust and rigid.  It is not
     651subject to unexpected drift or sensitivity of the solution to the
     652vagaries of the data set.  The Ubercal analysis is also especially
     653aided by the inclusion of multiple Medium Deep field observations
     654every night, helping to tie down overall variations of the system
     655throughput and acting as internal standard star fields.  The resulting
     656photometric system is shown by \cite{2012ApJ...756..158S} to have reliability
     657across the survey region at the level of (8.0, 7.0, 9.0, 10.7, 12.4)
     658millimags in (\grizy).  As we discuss below, this conclusion is
     659reinforced by our external comparison. 
     660
     661%% \note{do I have a measurement
     662%% of the bright end stability in PV3?  basically, what is the scatter
     663%% per star as a function of position in the camera and magnitude?}
     664
     665The overall zero point for each filter is not naturally determined by
     666the Ubercal analysis; an external constraint on the overall
     667photometric system is required for each filter.
     668\cite{2012ApJ...756..158S} used photometry of the MD09 Medium Deep
     669field to match the photometry measured by \cite{2012ApJ...750...99T}
     670on the reference photometric night of MJD 55744 (UT 02 July 2011).
     671\cite{2014ApJ...795...45S} and \cite{2015ApJ...815..117S} have
     672re-examined the photometry of Calspec standards %% XXX FIX: \citep{Bohlin.1996} as
     673observed by PS1.  \cite{2014ApJ...795...45S} reject 2 of the 7 stars
     674used by \cite{2012ApJ...750...99T} and add photometry of 5 additional
     675stars.  \cite{2015ApJ...815..117S} further reject measurements of
     676Calspec standards obtained close to the center of the camera field of
     677view where the PSF size and shape changes very rapidly.  The result of
     678this analysis modifies the over system zero points by 20 - 35
     679millimags compared with the system determined by
     680\cite{2012ApJ...756..158S}.
     681
     682%% \note{The calspec spectrophotometry values have also been re-examined
     683%%   by REF; using these new measurements, \cite{2015ApJ...815..117S}
     684%%   determine new zero points for the PS1 system, which we have applied
     685%%   (see below).}
     686
     687% http://iopscience.iop.org/article/10.1088/0004-637X/815/2/117/pdf
     688
     689\subsection{Applying the Ubercal Zero Points : Setphot}
     690
     691The ubercal analysis above results in a table of zero points for all
     692exposures considered to be photometric, along with a set of
     693low-resolution flat-field corrections.  It is now necessary to use this
     694information to determine zero points for the remaining exposures and
     695to improve the resolution of the flat-field correction.  This analysis
     696is done within the IPP DVO database system.
     697
     698The ubercal zero points and the flat-field correction data are loaded
     699into the PV3 DVO database using the program \code{setphot}.  This
     700program converts the reported zero point and flat field values to the
     701DVO internal representation in which the zero point of each image is
     702split into three main components:
     703\[
     704zp_{\rm total} = zp_{\rm nominal} + M_{cal} + K_{rm \lambda}(sec \zeta - 1)
     705\]
     706where $zp_{\rm nominal}$ and $K_{rm \lambda}$ are static values for
     707each filter representing respectively the nominal zero point and the
     708slope of the trend with respect to the airmass ($\zeta$) for each
     709filter.  These static values are listed in Table~\ref{tab:zpts}.  When
     710\code{setphot} was run, these static zero points have been adjusted by
     711the Calspec offsets listed in Table~\ref{tab:zpts} based on the
     712analysis of Calspec standards by \cite{2015ApJ...815..117S}.  These
     713offsets bring the photometric system defined by the ubercal analysis
     714into alignment with \cite{2015ApJ...815..117S}.  The value $M_{cal}$
     715is the offset needed by each exposure to match the ubercal value, or
     716to bring the non-ubercal exposures into agreement with the rest of the
     717exposures, as discussed below.  The flat-field information is encoded
     718in a table of flat-field offsets as a function of time, filter, and
     719camera position.  Each image which is part of the ubercal subset is
     720marked with a bit in the field \code{Image.flags}:
     721\code{ID_IMAGE_PHOTOM_UBERCAL = 0x00000200}
     722
     723%% \note{give airmass formula for completeness?}.
     724
     725When \code{setphot} applies the ubercal information to the image
     726tables, it also updates the individual measurements associated with
     727those images.  In the DVO database schema, the normalized instrumental
     728magnitude, $M_{\rm inst} = -2.5log_{10} (DN / sec) + 25.0$ are stored
     729for each measurement.  The value of 25.0 is an arbitrary (but fixed)
     730constant offset to place the instrumental magnitudes into
     731approximately the correct range.  Associated with each measurement are
     732two correction magnitudes: $M_{\rm cal}$ and $M_{\rm flat}$, along
     733with the airmass for the measurement, calculated using the altitude of
     734the individual detection as determined from the Right Ascension,
     735Declination, the observatory latitude, and the sidereal time.  For a
     736camera with the field of view of the PS1 GPC1, the airmass may vary
     737significantly within the field of view, especially at low elevations.
     738In the worst cases, at the celestial pole, the airmass range within a
     739single exposure is XXX - XXX.  The complete calibrated (`relative')
     740magnitude is determined from the stored database values as:
     741\[
     742M_{\rm rel} = M_{\rm inst} - 25.0 + zp_{\rm ref} + M_{\rm cal} + M_{\rm flat} + K_\lambda (sec \zeta - 1).
     743\]
     744The calibration offsets, $M_{\rm cal}$ and $M_{\rm flat}$, represent
     745the per-exposure zero point correction and the slowly-changing
     746flat-field correction respectively.  These two values are split so the
     747flat-field corrections may be determined and applied independently
     748from the time-resolved zero point variations.  Note that the above
     749corrections are applied to each of the types of measurements stored in
     750the database, PSF, Aperture, Kron.  The calibration math remains the
     751same regardless of the kind of magnitude being measured.  Also note
     752that for the moment, this discussion should only be considered as
     753relevant to the chip measurements.  Below we discuss the implications
     754for the stack and warp measurements.
     755
     756When the ubercal zero points and flat-field data are loaded,
     757\code{setphot} updates the $M_{\rm cal}$ values for all measurements
     758which have been derived from the ubercal images.  These measurements
     759are also marked in the field \code{Measure.dbFlags} with the bit
     760\code{ID_MEAS_PHOTOM_UBERCAL = 0x00008000}.  At this stage,
     761\code{setphot} also updates the values of $M_{\rm flat}$ for all GPC1
     762measurements in the appropriate filters.
     763
     764\subsection{Relphot Analysis}
     765
     766%% \note{how many exposures are not in ubercal?}
     767
     768Relative photometry is used to determine the zero points of the
     769exposures which were not included in the ubercal analysis.  The
     770relative photometry analysis has been described in the past by
     771\cite{2013ApJS..205...20M}.  We review that analysis here, along with
     772specific updates for PV3.
     773
     774As described above, the instrumental magnitude and the calibrated magnitude
     775are related by arithmetic magnitude offsets which account for effects
     776such as the instrumental variations and atmospheric attenuation. 
     777\[
     778M_{rel} = m_{inst} + ZP + M_{cal}
     779\]
     780
     781From the collection of measurements, we can generate an average
     782magnitude for a single star (or other object):
     783\[ M_{ave} = \frac{\sum_i M_{rel,i} w_i}{\sum_i w_i} \]
     784We find that the color difference of the different chips can be
     785ignored, and set the value of $A$ to 0.0.
     786Note that we only use a single mean airmass extinction term for all
     787exposures -- the difference between the mean and the specific value
     788for a given night is taken up as an additional element of the
     789atmospheric attenuation.
     790
     791%% \note{color-color terms between chips?}
     792
     793We write a global $\chi^2$ equation which we attempt to minimize by
     794finding the best mean magnitudes for all objects and the best
     795$M_{\rm cal}$ offset for each exposure:
     796\[ \chi^2 = \sum_{i,j} (m_{inst}[i,j] + ZP + K \zeta + M_{clouds}[i] - M_{ave}[j]) w_{i,j} / \sum_{i,j} w_{i,j} \]
     797
     798If everything were fitted at once and allowed to float, this system of
     799equations would have $N_{exposures} + N_{stars} \sim 2 \times 10^5 + N
     800\times 10^9$ unknowns.  We solve the system of equations by iteration,
     801solving first for the best set of mean magnitudes in the assumption of
     802zero clouds, then solving for the clouds implied by the differences
     803from these mean magnitudes.  Even with 1-2 magnitudes of extinction,
     804the offsets converge to the milli-magnitude level within 8 iterations.
     805
     806Only brighter, high quality measurements are used in the relative
     807photometry analysis of the exposure zero points.  We use only the
     808brighter objects, limiting the density to a maximum of 4000 objects
     809per square degree (lower in areas where we have more observations).
     810When limiting the density, we prefer objects which are brighter (but
     811not saturated), and those with the most measurements (to ensure better
     812coverage over the available images).
     813
     814There are a few classes of outliers which we need to be careful to
     815detect and avoid.  First, any single measurement may be deviant for a
     816number of reasons (e.g., it lands in a bad region of the detector,
     817contamination by a diffraction spike or other optical artifact, etc).
     818We attempt to exclude these poor measurements in advance by rejecting
     819measurements which the photometric analysis has flagged the result as
     820suspcious.  We reject detections which are excessively masked; these include
     821detections which are too close to other bright objects, diffraction
     822spikes, ghost images, or the detector edges.  However, these
     823rejections do not catch all cases of bad measurements.
     824
     825%% \citep[\code{PSF_QF} $< 0.85$, see][]{magnier2017b};
     826%% \note{refer to the PSPHOT bad and poor psphot bits?} 
     827
     828After the initial iterations, we also perform outlier rejections based
     829on the consistency of the measurements.  For each star, we use a two
     830pass outlier clipping process.  We first define a robust median and
     831sigma from the inner 50\% of the measurements.  Measurements which are
     832more than 5$\sigma$ from this median value are rejected, and the mean
     833\& standard deviation (weighted by the inverse error) are
     834recalculated.  We then reject detections which are more than 3$\sigma$
     835from the recalculated mean. 
     836
     837Suspicious stars are also exclude from the analsis.  We exclude stars
     838with reduced $\chi^2$ values more than 20.0, or more than 2$\times$
     839the median, whichever is larger.  We also exclude stars with standard
     840deviation (of the measurements used for the mean) greater than 0.005
     841mags or 2$\times$ the median standard deviation, whichever is greater.
     842
     843%% \note{is this true?}
     844
     845Similarly for images, we exclude those with more than 2 magnitudes of
     846extinction or for which the deviation greater of the zero points per
     847star are than 0.075 mags or 2$\times$ the median value, whichever is
     848greater.  These cuts are somewhat conservative to limit us to only
     849good measurements.  The images and stars rejected above are not used
     850to calculate the system of zero points and mean magnitudes.  These
     851cuts are updated several times as the iterations proceed.  After the
     852iterations have completed, the images which have been reject are
     853calibrated based on their overlaps with other images.
     854
     855We overweight the ubercal measurements in order to tie the relative
     856photometry system to the ubercal zero points.  Ubercal images and
     857measurements from those images are not allowed to float in the
     858relative photometry analysis.  Detections from the Ubercal images are
     859assigned weights of 10x their default (inverse-variance) weight.  The
     860calculation of the formal error on the mean magnitudes propagates this
     861additional weight, so that the errors on the Ubercal observations
     862dominates where they are present.
     863
     864% \note{do we drop this when calculating the final mean mags?}
     865% \note{do I need to present the math?}
     866\[ \mu = \frac{\sum m_i w_i \sigma_i^{-2}}{\sum w_i \sigma_i^{-2}} \]
     867\[ \sigma_\mu = \frac{\sum w_i^2 \sigma_i^{-2}}{(\sum w_i \sigma_i^{-2})^2} \]
     868
     869The calculation of the relative photometry zero points is performed
     870for the entire $3\pi$ data set in a single, highly parallelized
     871analysis.  As discussed above, the measurement and object data in the
     872DVO database are distributed across a large number of computers in the
     873IPP cluster: for PV3, 100 parallel hosts are used.  These machines by
     874design control data from a large number of unconnected small patches
     875on the sky, with the goal of speeding queries for arbitrary chunks of
     876the sky.  As a result, this parallelization is entirely inappropriate
     877as the basis of the relative photometry analysis.  For the relative
     878photometry calculation (and later for relative astrometry
     879calculation), the sky is divided into a number of large, contiguous
     880regions each bounded by lines of constant RA \& DEC, 73 regions in the
     881case of the PV3 analysis.  A separate computer, called a ``region
     882host'' is responsible for each of these regions: that computer is
     883responsible for calculating the mean magnitudes of the objects which
     884land within its region and for determining the exposure zero points
     885for exposures for which the center of the exposure lands in the region
     886of responsibility. 
     887
     888\begin{figure*}[htbp]
     889 \begin{center}
     890  \begin{minipage}{0.85\linewidth}
     891   \includegraphics[width=\textwidth,clip]{{pics/photflat.example}.png}
     892  \end{minipage}
     893  \hspace{-3.0in}
     894  \begin{minipage}{0.4\linewidth}
     895   \vspace{3.25in}
     896   \caption{\label{fig:photflat} High-resolution flat-field correction images for the 5 filters $grizy$.}
     897  \end{minipage}
     898 \end{center}
     899\end{figure*}
     900
     901The iterations described above (calculate mean
     902magnitudes, calculate zero points, calculate new measurements) are
     903peformed on each of the 73 region hosts in parallel.  However, between
     904certain iteration steps, the region hosts must share some information.
     905After mean object magnitudes are calculated, the region hosts must
     906share the object magnitudes for the objects which are observed by
     907exposures controlled by neighboring region hosts.  After image
     908calibrations have been determined by each region host, the image
     909calibrations must be shared with the neighboring region hosts so
     910measurement values associated with objects owned by a neighboring
     911region host may be updated.
     912
     913The completely work flow of the all-sky relative photometry analysis
     914starts with an instance of the program running on a master computer.
     915This machine loads the image database table and assigns the images to
     916the 73 region hosts.  A process is then launched on each of the region
     917hosts which is responsible for managing the image calibration analysis
     918on that host.  These processes in turn make an intial request of the
     919photometry information (object and measurement) from the 100 parallel
     920DVO partition machines.  In practice, the processes on the the region
     921hosts are launched in series by the master process to avoid
     922overloading the DVO partition machines with requests for photometry
     923data from all region hosts at once.  Once all of the photometry has
     924been loaded, the region hosts perform their iterations, sharing the
     925data which they need to share with their neighbors and blocking while
     926they wait for the data they need to receive from their neighbors.  The
     927management of this stage is performed by communication between the
     928region host.  At the end of the iterations, the regions hosts write out
     929their final image calibrations.  The master machine then loads the
     930full set of image calibrations and then applies these calibrations
     931back to all measurements in the database, updating the mean photometry
     932as part of this process.  The calculations for this last step are
     933performed in parallel on the DVO partition machines.
     934
     935With the above software, we are able to perform the entire relphot
     936analysis for the full 3$\pi$ region at once, avoiding any possible
     937edge effects.  The region host machines have internal memory ranging
     938from 96GB to 192GB.  Regions are drawn, and the maximum allowed
     939density was chosen, to match the memory usage to the memory available
     940on each machine.  A total of 9.8TB of RAM was available for the
     941analysis, allowing for up to 6000 objects per square degree in the
     942analysis.
     943
     944\begin{figure}[htbp]
     945  \begin{center}
     946 \includegraphics[width=\hsize,clip]{{pics/allsky.photom.sigma}.png}
     947  \caption{\label{fig:allsky.photom.sigma} Consistency of photometry
     948    measurements across the sky.  Each panel shows a map of the
     949    standard deviation of photometry residuals for stars in each
     950    pixel.  The median value of the measure standard deviations across
     951    the sky is $(\sigma_g, \sigma_r, \sigma_i, \sigma_z, \sigma_y) =
     952    (14, 14, 15, 15, 18)$ millimags.  These values reflect the typical
     953    single-measurement errors for bright stars.}
     954  \end{center}
     955\end{figure}
     956
     957%% \note{need to discuss the process of setting the final mean magnitudes}
     958
     959\subsubsection{Photometric Flat-field}
     960
     961For PV3, the relphot analysis was performed two times.  The first
     962analysis used only the flat-field corrections determined by the
     963ubercal analysis, with a resolution of 2x2 flat-field values for each
     964GPC1 chip (corresponding to \approx 2400 pixels), and 5 separate
     965flat-field 'seasons'.  However, we knew from prior studies that there
     966were significant flat-field structures on smaller scales.  We used the
     967data in DVO after the initial relphot calibration to measure the
     968flat-field residual with much finer resolution: 124 x 124 flat-field
     969values for each GPC1 chip (40x40 pixels per point).  We then used
     970\code{setphot} to apply this new flat-field correction, as well as the
     971ubercal flat-field corrections, to the data in the database.  At this
     972point, we re-ran the entire relphot analysis to determine zero points
     973and to set the average magnitudes.
     974
     975Figure~\ref{fig:photflat} shows the high-resolution photometric
     976flat-field corrections applied to the measurements in the DVO
     977database.  These flat-fields make low-level corrections of up to
     978\approx 0.03 magnitudes.  Several features of interest are apparent in
     979these images. 
     980
     981First, at the center of the camera is an important structure caused by
     982the telescope optics which we call the ``tent''.  In this portion of
     983the focal plane, the image quality degrades very quickly.  The
     984photometry is systematically biased because the point spread function
     985model cannot follow the real changes in the PSF shape on these small
     986scales.  As is evident in the image, the effect is such that the flux
     987measured using a PSF model is systematically low, as expected if the
     988PSF model is too small. 
     989
     990The square outline surrounding the ``tent'' is due to the 2$\times$2
     991sampling per chip used for the Ubercal flat-field corrections.  The
     992imprint of the Ubercal flat-field is visible throughout this
     993high-resolution flat-field: in regions where the underlying flat-field
     994structure follows a smooth gradient across a chip, the Ubercal
     995flat-field partly corrects the structure, leaving behind a saw-tooth
     996residual.  The high-resolution flat-field corrects the residual
     997structures well.
     998
     999Especially notable in the bluer filters is a pattern of quarter
     1000circles centered on the corners of the chips.  These patterns are
     1001similar to the ``tree rings'' reported by the DES team and others
     1002(G. Berstein REF \& REFS).  The details of these tree rings are beyond
     1003the scope of this article, and will be explored in future work.
     1004Unlike the tree ring features discussed by these other authors, the
     1005features observed in the GPC1 photometry are not caused by an
     1006interaction of the flat-field with the effective pixel geometry.
     1007Instead, these photometric features are due to low-level changes in
     1008the PSF size which we attribute to variable charge diffusion (Magnier
     1009in prep).
     1010
     1011Other features include some poorly responding cells (e.g., in XY14)
     1012and effects at the edges of chips, possibly where the PSF model fails
     1013to follow the changes in the PSF.
     1014
     1015%% XXX : need to refer to system paper on the central tent?
     1016
     1017%% \note{show the flat-field residual images, discuss the features?}. 
     1018
     1019For stacks and warps, the image calibrations were determined after the
     1020relative photometry was performed on the individual chips.  Each stack
     1021and each warp was tied via relative photometry to the average
     1022magnitudes from the chip photometry.  In this case, no flat-field
     1023corrections were applied.  For the stacks, such a correction would not
     1024be possible after the stack has been generated because multiple chip
     1025coordinates contribute to each stack pixel coordinate.  For the warps,
     1026it is in principle possible to map back to the corresponding chip, but
     1027the information was not available in the DVO database, and thus it was
     1028not possible at this time to determine the flat-field correction
     1029appropriate for a given warp.  This latter effect is one of several
     1030which degrade the warp photometry compared to the chip photometry at
     1031the bright end.
     1032
     1033\subsection{Photometry Calibration Quality}
     1034
     1035Figure~\ref{fig:allsky.photom.sigma} shows the standard devitions of
     1036the mean residual photometry for bright stars as a function of
     1037position across the sky.  For each pixel in these images, we selected
     1038all objects with (14.5, 14.5, 14.5, 14.0, 13.0) $<$ ($g,r,i,z,y$) $<$
     1039(17, 17, 17, 16.5, 15.5), with at least 3 measurements in $i$-band (to
     1040reject artifacts detected in a pair of exposures from the same night),
     1041with \code{PSF_QF} $> 0.85$ (to reject excessively-masked objects),
     1042and with $mag_{\rm PSF} - mag_{rm Kron} < 0.1$ (to reject galaxies).
     1043We then generated histograms of the difference between the average
     1044magnitude and the apparent magnitude in an individual image for each
     1045filter for all stars in a given pixel in the images.  From these
     1046residual histograms, we can then determine the median and the 68\%-ile
     1047range to calculate a robust standard deviation.  This represents the
     1048bright-end systematic error floor for a measurement from a single
     1049exposure.  The standard deviations are then plotted in
     1050Figure~\ref{fig:allsky.photom.sigma}. 
     1051
     1052The 5 panels in Figure~\ref{fig:allsky.photom.sigma} show several
     1053features.  The Galactic bulge is clearly seen in all five filters,
     1054with the impact strongest in the reddest bands.  We attribute this to
     1055the effects of crowding and contamination of the photometry by
     1056neighbors.  Large-scale, roughly square features \approx 10 degrees on
     1057a side in these images can be attributed to the vagaries of weather:
     1058these patches correspond to the observing chunks.  These images
     1059include both photometric and non-photometric exposures.  It seems
     1060plausible that the non-photometric images from relatively poor quality
     1061nights elevate the typical errors.  On small scales, there are
     1062circular patterns \approx 3 degrees in diameter corresponding to
     1063individual exposures; these represent residual flat-fields structures
     1064not corrected by our stellar flat-fielding.  The median of the
     1065standard deviations in the five filters are
     1066$(\sigma_g,\sigma_r,\sigma_i,\sigma_z,\sigma_y) = (14, 14, 15, 15,
     106718)$ millimagnitudes.
     1068
     1069%% \note{recommendation}
     1070
     1071\subsection{Calculation of Object Photometry}
     1072
     1073\subsubsection{Iteratively Reweighted Least Squares Fitting (1D)}
     1074
     1075\subsubsection{Selection of Measurements}
     1076
     1077\subsubsection{Stack Photometry}
     1078
     1079\subsubsection{Warp Photometry}
     1080
     1081\begin{figure*}[htbp]
     1082  \begin{center}
     1083 \includegraphics[width=\hsize,clip]{{pics/KHexample}.png}
     1084  \caption{\label{fig:KHexample} Illustration of the Koppenh\"ofer Effect
     1085    on chip XY04.  In each plot, the solid line shows the measured
     1086    mean residual for stars detected on this chip as a function of the
     1087    instrumental magnitude / FWHM$^2$.  {\bf top left} X-direction before correction. 
     1088{\bf top right} Y-direction before correction. 
     1089{\bf bottom left} X-direction after correction. 
     1090{\bf bottom right} Y-direction after correction.  }
     1091  \end{center}
     1092\end{figure*}
     1093
     1094\begin{figure}[htbp]
     1095  \begin{center}
     1096 \includegraphics[width=\hsize,clip]{{pics/KHmap}.png}
     1097  \caption{\label{fig:KHmap} Map of the amplitude of the
     1098    Koppenh\"ofer Effect on chips across the focal plane.  In the
     1099    affected chips, bright stars are up to 0.2 \note{arcsec} deviant
     1100    from their expected positions. {\bf bottom left} X-direction before
     1101    correction.  {\bf bottom right} Y-direction before correction.  {\bf
     1102      top left} X-direction after correction.  {\bf top right}
     1103    Y-direction after correction.  }
     1104  \end{center}
     1105\end{figure}
     1106
     1107\section{Astrometry Calibration}
     1108
     1109Once the full PV3 dataset loaded into the master PV3 DVO database,
     1110along with supporting databases, and the photometric calibrations were
     1111performed, relative astrometry could be performed on the database to
     1112improve the overall astrometric calibration.
     1113
     1114In many respects the relative astrometric analysis is similar to the
     1115relative photometric analysis: the repeated measurements of the same
     1116object in different images are used to determine a high quality
     1117average position for the object.  The new average positions are then
     1118used to determine improved astrometric calibrations for each of the
     1119images.  These improved calibrations are used to set the observed
     1120coordinates of the measurements from those images, which are in turn
     1121used to improve the average positions of the objects.  The whole
     1122process is repeated for several iterations.  Like the photometric
     1123analysis, the astrometric analysis is performed in a parallel fashion
     1124with the same concept that specific machines are responsible for
     1125exposures and objects which land within their regions of
     1126responsibility, defined on the basis of lines of constant RA and DEC.
     1127Between iteration steps, the astrometric calibrations are shared
     1128between the parallel machines as are the improved positions for
     1129objects controlled by one machine but detect in images controlled by
     1130another machine.  Like the photometric analysis, the entire sky is
     1131processed in one pass.  However, there are some important differences
     1132in the details.
     1133
     1134\subsection{Systematic Effects}
     1135
     1136First, the astrometric calibration has a larger number of systematic
     1137effects which must be performed.  These consist of: 1) the
     1138Koppenh\"offer Effect, 2) Differential Chromatic Refraction, 3) Static
     1139deviations in the camera.  We discuss each of these in turn below.
     1140
     1141\subsubsection{Koppenh\"offer Effect}
     1142
     1143The Koppenh\"offer Effect was first identified in February 2011 by
     1144Johannes Koppenh\"offer (MPE) as part of the effort to search for
     1145planet transists in the Stellar Transit Survey data.  He noticed that
     1146the astromety of bright stars and faint stars disagreed on overlapping
     1147chips at the boundary between the STS fields.  After some exploration,
     1148it was determined that the X coordinate of the brightest stars was
     1149offset from the expected location based on the faint stars for a
     1150subset of the GPC1 chips.  The essence of the effect was that a large
     1151charge packet could be drawn prematurely over an intervening negative
     1152serial phase into the summing well, and this leakage was
     1153proportionately worse for brighter stars.  The brighter the star, the
     1154more the charge packet was pushed ahead on the serial register.  The
     1155amplitude of the effect was at most $0\farcs{}25$, corresponding to a
     1156shift of about one pixel.  This effect was only observed in 2-phase
     1157OTA devices, with 22 / 30 of these suffering from this effect.  By
     1158adjusting the summing well high voltage down from a default +7 V to
     1159+5.5V on the 2-phase devices, the effect was prevented in exposures
     1160after 2011-05-03.  However, this left 101,550 exposures (27\%) already
     1161contaminated by the effect.
     1162% This uses PV3 3-pi exposures:
     1163% group           N(<2011-05-03)    N(total)  %
     1164% PV3-3pi         101550            375573    24.47
     1165% exptype=OBJECT  229272            936879    27.04
     1166% ALL             322922            1163377   27.76
     1167
     1168% \note{was there is significant difference using a surface brightness version?} 
     1169
     1170We measured the Koppenh\"offer Effect by accumulating the residual
     1171astrometry statistics for stars in the database.  For each chip, we
     1172measured the mean X and Y displacements of the astrometric residuals
     1173as function of the instrumental magnitude of the star divided by the
     1174FWHM$^2$.  We measured the trend for all chips in a
     1175number of different time ranges and found the effect to be quite
     1176stable, in the period where it was present.  The effect only appeared
     1177in the serial direction.  Figure~\ref{fig:koppenhoefer} shows the KE
     1178trend for a typical affected chip both before and after the
     1179correction.  For the PV3 dataset, we re-measured the KE trends using
     1180stars in the Galactic pole regions after an initial relative
     1181astrometry calibration pass: the Galactic pole is necessary because
     1182the real-time astrometric calibration relies largely on the fainter
     1183stars which are not affected by the KE.  The trend is then stored in a
     1184form which can be applied to the database measurements.
     1185
     1186\subsubsection{Differential Chromatic Refraction}
     1187
     1188Differential Chromatic Refraction (DCR) affects astrometry because the
     1189reference stars used the calibrate the images are not the same color
     1190(SED) as the rest of the stars in the image.  For a given star of a
     1191color different from the reference stars, as exposures are taken at
     1192higher airmass, the apparent position of the star will be biased along
     1193the parallactic angle.  While it is possible to build a model for the
     1194DCR impact based on the filter response functions and atmospheric
     1195refraction, we have instead elected to use an empirical correction for
     1196the DCR present in the PV3 database.  We have measured the DCR trend
     1197using the astrometric residuals of millions of stars after performing
     1198an initial relative astrometry calibration.  We define a blue DCR
     1199color ($g-i$) to be used when correcting the filters \gps,\rps,\ips, and a red
     1200DCR color ($z - y$) to be used when correcting the filters $zy$.  In
     1201the process of performing the relative astrometry calibration, we
     1202record the median red and blue colors of the reference stars used to
     1203measure the astrometry calibration for each image.  As we determine
     1204the astrometry parameters for each object in the database, we record
     1205the median red and blue reference star colors for all images used to
     1206determine the astrometry for a given object.  For each star in the
     1207database, we know both the color of the star and the typical color of
     1208the reference stars used to calibrate the astrometry for that star. 
     1209
     1210We measure the mean deviation of the residuals in the parallactic
     1211angle direction and the direction perpendicular to the parallactic
     1212angle.  For each filter, we determine the DCR trend as a function of
     1213the difference between the star color and the reference star color,
     1214using the red or blue color approriate to the particular filter, times
     1215the tangent of the zenith distance.  Figure~\ref{fig:DCR} shows the
     1216DCR trend for the 5 filters \grizy, as well as the measured
     1217displacement in the direction perpendicular to the parallactic angle.
     1218We represent the trend with a spline fitted to this dataset. 
     1219
     1220\begin{figure}[htbp]
     1221  \begin{center}
     1222 \includegraphics[width=\hsize,clip]{{pics/dcr.r2.g}.png}
     1223  \caption{\label{fig:DCRexample} Example of the DCR trend in the
     1224    g-band.  {\bf top:} DCR trend in the parallactic direction {\bf
     1225      bottom:} DCR trend perpendicular to the parallactic angle.}
     1226  \end{center}
     1227\end{figure}
     1228
     1229The amplitude of the DCR trend in the five filters is $(g,r,i,z,y) =
     1230(0.010, 0.001, -0.003, -0.017, -0.021)$ arcsec airmass$^{-1}$
     1231magntiude$^{-1}$.  We saturate the DCR correction if the term $color
     1232TAN (\zeta)$ for a given measurement is outside a range where the
     1233DCR correction is well measured.  The maximum DCR correction applied
     1234to the five filters is $(g,r,i,z,y) = (0.019, 0.002, 0.003, 0.006,
     12350.008)$ arcseconds.
     1236
     1237%% \note{write down the DCR formalae for reference}.
     1238
     1239\begin{figure*}[htbp]
     1240 \begin{center}
     1241 \includegraphics[width=0.85\textwidth,clip]{{pics/astroflat.gri}.png}
     1242 \caption{\label{fig:astroflat.gri} High-resolution astrometric flat-field correction images for $gri$.}
     1243 \end{center}
     1244\end{figure*}
     1245
     1246\begin{figure*}[htbp]
     1247 \begin{center}
     1248 \includegraphics[width=0.85\textwidth,clip]{{pics/astroflat.zy}.png}
     1249 \caption{\label{fig:astroflat.zy} High-resolution astrometric flat-field correction images for $zy$.}
     1250 \end{center}
     1251\end{figure*}
     1252
     1253\subsubsection{Astrometric Flat-field}
     1254
     1255After correction for both KE and DCR, we observe persistent residual
     1256astrometric deviations which depend on the position in the camera.  We
     1257construct an astrometric ``flat-field'' response by determining the
     1258mean residual displacement in the X and Y (chip) directions as a
     1259function of position in the focal plane.  We have measured the
     1260astrometric flat using a sampling resolution of 40x40 pixels, matching
     1261the photometric flat-field correction images.
     1262Figures~\ref{fig:astroflat.gri} and \ref{fig:astroflat.zy} show the
     1263astrometric flat-field images for the five filters \grizy\ in each of
     1264the two coordinate directions.  These plots show several types of
     1265features.
     1266
     1267The dominant pattern in the astrometric residual is roughly a series
     1268of concentric rings. The pattern is similar to the pattern of the
     1269focal surface residuals measured by (REF), which also has a concentric
     1270series of rings with similar spacing.  The ``tent'' in the center of
     1271the focal surface reflected in these astrometry residual plots.  Our
     1272interpretation of the structure is that the deviations of the focal
     1273plane from the ideal focal surface introduces small-scale PSF changes,
     1274presumably coupled to the optical aberrations, which result in small
     1275changes in the centroid of the object relative to the PSF model at
     1276that location.  Since the PSF model shape parameters are only able to
     1277vary at the level of a 6x6 grid per chips, the finer structures are
     1278not included in the PSF model.  The PV2 analysis shows the ring
     1279structure more clearly, with a pattern much more closely following the
     1280focal surface deviations.  In the PV2 analysis, the PSF model used at
     1281most a 3x3 grid per chip to follow the shape variations, so any
     1282changes caused by the optical aberrations would be less well modeled in
     1283the PV2 analysis, as we observe.
     1284
     1285A second pattern which is weakly seen in several chips consists of
     1286consistent displacements in the X (serial) direction for certain
     1287cells.  This effect can be seen most clearly in chips XY45 and XY46.
     1288In the PV2 analysis, this pattern is also more clearly seen.  In this
     1289case, the fact that the astrometric model used polynomials with a
     1290maximum of 3rd order per chip means the deviation of individual cells
     1291cannot be followed by the astrometric model. 
     1292
     1293A third effect is seen at the edge of the chips, where there appears
     1294to be a tendency for the residual to follow the chip edge.  The origin
     1295of this is unclear, but likely caused by the astrometry model failing
     1296to follow the underlying variations because of the need to extrapolate
     1297to the edge pixels.  Finally, we also mention an interesting effect
     1298{\em not} visible at the resolution of these astrometric flat-field
     1299images.  Fine structures are observed at the \approx 10 pixel scale
     1300similar to the ``tree rings'' reported by the DES team and others
     1301(G. Berstein REF \& REFS).  The details of these tree rings are beyond
     1302the scope of this article, and will be explored in future work.
     1303
     1304Unfortunately, we discovered a problem with the astrometric flat-field
     1305correction too late to be repaired for DR1.  As can be seen by
     1306inspection of Figures~\ref{fig:astroflat.gri} and
     1307\ref{fig:astroflat.zy}, there is significant pixel-to-pixel noise in
     1308the the astrometric flat-field images.  This pixel-to-pixel noise is
     1309caused by too few stars used in the measuremnt of the flat-field
     1310structure for the high-resolution sampling.  As a result, the
     1311astrometric flat-field correction reduces systematic structures on
     1312large spatial scales, but at the expense of degrading the quality of
     1313an individual measurement.  Only $i$-band has sufficient
     1314signal-to-noise per pixel to avoid significantly increasing the
     1315per-measurement position errors. 
     1316
     1317Figure~\ref{fig:allsky.astrom.sigma} shows the standard devitions of
     1318the mean residual astrometry in $(\alpha,\delta)$ for bright stars as
     1319a function of position across the sky.  For each pixel in these
     1320images, we selected all objects with $15 < i < 17$, with at least 3
     1321measurements in $i$-band (to reject artifacts detected in a pair of
     1322exposures from the same night), with \code{PSF_QF} $> 0.85$ (to reject
     1323excessively-masked objects), and with $mag_{\rm PSF} - mag_{rm Kron} <
     13240.1$ (to reject galaxies).  We then generated histograms of the
     1325difference between the object position predicted for the epoch of each
     1326measurement (based on the proper motion and parallax fit) and the
     1327observed position of that measurement, in both the Right Ascension and
     1328Declination directions (in linear arcseconds), for all stars in a
     1329given pixel in the images.  From these residual histograms, we can
     1330then determine the median and the 68\%-ile range to calculate a robust
     1331standard deviation.  This represents the bright-end systematic error
     1332floor for a measurement from a single exposure.  The standard
     1333deviations are then plotted in Figure~\ref{fig:allsky.photom.sigma}.
     1334The median value of the standard deviations across the sky is
     1335$(\sigma_\alpha, \sigma_\delta) = (22, 23)$ milliarcseconds.
     1336
     1337The Galactic plane is clearly apparently in these images.  Like
     1338photometry, we attribute this to failure of the PSF fitting due to
     1339crowding.  The celestial North pole regions have somewhat elevated
     1340errors in both R.A. and DEC.  This may be due to the larger typical
     1341seeing at these high airmass regions, but without further exploration
     1342this is interpretation uncertain.  Several features can be seen which
     1343appear to be an effect of the tie to the Gaia astrometry: the stripes
     1344near the center of the DEC image and the right side of the R.A. image.
     1345The mesh of circular outlines is due to the outer edge of the focal
     1346plane where the astrometric calibration is poorly determined.  As
     1347discussed above, the median values in the images are higher than
     1348expected based on our PV2 analysis of the astrometry: the median
     1349per-measurement error floor of \approx 22 mas is significantly worse
     1350than the \approx 17 mas value in that earlier analysis.  We attribute
     1351this degradation to the noise introduced by the astrometric
     1352flat-field.  This noise can likely be addressed before the DR2 release
     1353of the individual measurement data.
     1354
     1355\begin{figure}[htbp]
     1356  \begin{center}
     1357 \includegraphics[width=\hsize,clip]{{pics/allsky.astrom.sigma}.png}
     1358  \caption{\label{fig:allsky.astrom.sigma} Consistency of photometry
     1359    measurements across the sky.  Each panel shows a map of the
     1360    standard deviation of astrometry residuals for stars in each
     1361    pixel.  The median value of the standard deviations across the sky
     1362    is $(\sigma_\alpha, \sigma_\delta) = (22, 23)$ milliarcseconds.
     1363    These values reflect the typical single-measurement errors for
     1364    bright stars.  See discussion regarding the astrometric flat which
     1365    is likely responsible for these elevated value. }
     1366  \end{center}
     1367\end{figure}
     1368
     1369% plot of the astrometric error floor per filter?
     1370
     1371% \note{SECTION or REF?}.
     1372
     1373After the initial analysis to measure the KE corrections, DCR
     1374corrections, and astrometric flat-field corrections, we applied these
     1375corrections to the entire database.  Within the schema of the
     1376database, each measurement has the raw chip coordinates
     1377(\code{Measure.Xccd,Yccd}) as well as the offset for that object based on each of
     1378these three corrections: \code{Measure.XoffKH,YoffKH,
     1379  Measure.XoffDCR,YoffDCR, Measure.XoffCAM,YoffCAM}.  The offsets are
     1380calculated for each measurement based on the observed instrumental
     1381chip magnitudes and FWHM for the Koppenhoffer Effect, on the average
     1382chip colors and the altitude \& azimuth of each measurement for the
     1383DCR correction, and on the chip coordinates for the astrometric
     1384flat-field corrections.  The corrections are combined and applied to
     1385the raw chip coordinates and saved back in the database in the fields
     1386\code{Measure.Xfix,Yfix}.  At this point, we are ready to run the
     1387full astrometric calibration.
     1388
     1389\subsection{Galactic Rotation and Solar Motion}
     1390
     1391The initial analysis of the PV2 astrometry used the 2MASS positions as
     1392an inertial constraint: the 2MASS coordiates were included in the
     1393calculation of the mean positions for the objects in the database,
     1394with weight corresponding to the reported astrometric errors.  In this
     1395analysis, the object positions used to determine the calibrations of
     1396the image parameters ignored proper motion and parallax.  After the
     1397image calibrations were determined, then individual objects were
     1398fitted for proper motion and possibly parallax, as discussed in detail
     1399below.
     1400
     1401Using the PV2 analysis of the astrometry calibration, we discovered
     1402large-scale systematic trends in the reported proper motions of
     1403background quasars.  This motion had an amplitude of 10 - 15
     1404milliarcseconds per year and clear trends with Galactic longitude.  We
     1405also observed systematic errors of the mean positions with respect to
     1406the ICRF milliarcsecond radio quasar positions, with an amplitude of
     1407\approx 60 milliarcseconds, again with trends associated with Galactic
     1408longitude.  Since the 2MASS data were believed to have minimal average
     1409deviations relative to the ICRF quasars, this latter seemed to be a
     1410real effect. 
     1411
     1412We realized that both the proper motion and the mean position biases
     1413could be caused by a single common effect: the proper motion of the
     1414stars used as reference stars between the 2MASS epoch (\approx 2000)
     1415and PS1 epoch (\approx 2012).  Since we are fitting the image
     1416calibrations without fitting for the proper motions of the stars, we
     1417are in essencence forcing those stars to have proper motions of 0.0.
     1418The background quasars would then be observed to have proper motions
     1419corresponding to the proper motions of the reference stars, but in the
     1420opposite direction.  We demonstrated that the observed quasar proper
     1421motions agreed well with the distribution expected if the median
     1422distance to our reference stars was \approx 500 pc. 
     1423
     1424For PV3, we desired to address this bias by including our knowledge
     1425about the distances to the reference stars and the expected typical
     1426proper motions for stars at those distances.  With some constraint on
     1427the distance to each star, we can determine the expected proper motion
     1428based on a model of the Galactic rotation and solar motions.  We can
     1429then calculate the mean positions for the objects keeping the assumed
     1430proper motion fixed.  When calibrating a specific image, the reference
     1431star mean position is then translated to the expected position at the
     1432epoch of that image.  The image calibration is then performed relative
     1433to these predicted postions.  This process naturally accounts for the
     1434proper motion of the reference stars.  In order to make the
     1435calibrations consistent with the observed coordinates of an external
     1436inertial reference, we perform the iterative fits using the technique
     1437as described, but assign very high weights in the initial iterations
     1438to the inertial reference, and reduce the weights as the astrometric
     1439calibration iterations proceed.
     1440
     1441In order to perform this analysis, we need estimated distances for
     1442every reference star used in the analysis.  Green et al (REF)
     1443performed SED fitting for 800M stars in the 3$\pi$ region using PV2
     1444data.  The goal of this work was to determine the 3D structure of the
     1445dust in the galaxy.  By fitting model SEDs to stars meeting a basic
     1446data quality cut, they determined the best spectral type, and thus
     1447$T_{\rm eff}$, absolute $r$-band magnitude, distance modulus, and
     1448extinction $A_V$ (the desired output and used to determine the dust
     1449extinction as a function of distance throughout the galaxy).  We use
     1450the distance modulus determined in this analysis to predict the proper
     1451motions.
     1452
     1453To convert the distances to proper motions, we use the Galactic
     1454rotation parameters ($A,B$) = (14.82,-12.37) km sec$^{-1}$ pc$^{-1}$
     1455and Solar motion parameters ($U_{\rm sol}, V_{\rm sol}, W_{\rm sol}$)
     1456= (9.32, 11.18, 7.61) km sec$^{-1}$ as determined by Feast \&
     1457Whitelock (REF) using Hipparchos data.  Proper motions are determined
     1458from the following:
     1459\begin{eqnarray}
     1460\mu^{\rm gal}_{l} & = & (A \cos (2 l) + B) \cos (b) \\
     1461\mu^{\rm gal}_{b} & = & \frac{-A \sin (2 l) \sin (2 b)}{2} \\
     1462\mu^{\rm sol}_{l} & = & \frac{U \sin(l) - V \cos(l)}{d} \\
     1463\mu^{\rm sol}_{b} & = & \frac{(U \cos(l) + V \sin(l)) \sin(b) - W \cos(b)}{d}
     1464\end{eqnarray}
     1465where $d$ is the distance and $l,b$ are the Galactic coordintes of the
     1466star. Note that the proper motion induced by
     1467%% \note{some reference for this?} 
     1468the Galactic rotation is independent of distance while the reflex
     1469motion induced by the solar motion decreases with increasing
     1470distance.  Also note that this model assumes a flat rotation curve for
     1471objects in the thin disk; any reference stars which are part of
     1472the halo population will have proper motions which are not
     1473described by this model; the mostly random nature of the halo motions
     1474should act to increase the noise in the measurement, but should not
     1475introduce detectable motion biases.  Also, if the distance modulus is
     1476not well determined, we can assume the object is simply following the
     1477Galactic rotation curve and set a fixed proper motion.  If we do not
     1478have a distance modulus from the Green et al analysis, we assume a
     1479value of 500pc. 
     1480
     1481%% \note{plots to show how well this worked for PV3 pre Gaia}
     1482
     1483\subsection{Gaia Constraint}
     1484
     1485After the full relative astrometry analysis was performed for the PV3
     1486database, the Gaia Data Release 1 became available
     1487\citep{2016A&A...595A...2G, 2016A&A...595A...4L}.  This afforded us
     1488the opportunity to constrain the astrometry on the basis of the Gaia
     1489observations.  Gaia DR1 objects which are bright enough to have proper
     1490motion and parallax solutions are in general saturated in the PS1
     1491observations.  Thus, we are limited to using the Gaia mean positions
     1492reported for the fainter stars.  We extracted all Gaia sources not
     1493marked as a duplicate from the Gaia archive and generated a DVO
     1494database from this dataset.  We then merged the Gaia DVO into the PV3
     1495master DVO database.  We re-ran the complete relative astrometry
     1496analysis using Gaia as an additional measurement.  We applied the
     1497analysis described above, applying the estimated distances to
     1498determine preliminary proper motions.  The Gaia mean epoch is reported
     1499as 2015.0, so all Gaia measurements were assigned this epoch.  We
     1500wanted to ensure the Gaia measurements dominated the astrometric
     1501solutions, so we made the weight very high for the Gaia points:
     15021000$\times$ the nominal weight in the initial fits (to lock down the
     1503reference frame), decreasing to 100$\times$ the nominal weight for the
     1504last fits.  We also retained the 2MASS measurements in the analysis,
     1505but gave them somewhat lower weights than Gaia: while the 2MASS data
     1506does not have the accuracy of Gaia, the coverage is known to be quite
     1507complete, while the Gaia DR1 has clear gaps and holes.  Having 2MASS,
     1508even at a lower weight, helps to tile over those gaps.
     1509
     1510%% \note{Figures showing the Gaia residuals}
     1511
     1512\begin{figure*}[htbp]
     1513  \begin{center}
     1514  \includegraphics[width=\hsize,clip]{{pics/gaia.photom}.png}
     1515  \caption{\label{fig:gaia.photom} Comparison with Gaia
     1516    photometry. {\bf Left} Mean of PS1 - Gaia, {\bf Right} Standard
     1517    deviation of PS1 - Gaia.  For pixels with $|b| > 30$ and $\delta >
     1518    -30$, the standard deviation of the PS1 - Gaia mean values is 7
     1519    millimagnitudes, while the median of the standard deviations is 12
     1520    millimagnitudes.  The former is a statement about the consistency
     1521    of the Gaia and Pan-STARRS\,1 photometry, while the latter
     1522    reflects the combined bright-end errors for both systems.  }
     1523  \end{center}
     1524\end{figure*}
     1525
     1526Figure~\ref{fig:gaia.photom} shows a comparison between the Pan-STARRS
     1527photometry in $g,r,i$ and the Gaia photometry in the $G$-band.  To
     1528compare the PS1 photometry to the very broadband Gaia G filter, we
     1529have determined a transformation based on a 3rd order polynomial fit
     1530to $g-r$ and $g-i$ colors.  This transformation reproduces Gaia
     1531photometry reasonably well for stars which are not too red.  For a
     1532comparison, we have seleted all PS1 stars with Gaia measurements
     1533meeting the following criteria: $14 < i < 19$, with at least 10 total
     1534measurements, within a modest color range $0.2 < g - r < 0.9$.  We
     1535also restricted to objects with $i_{\rm PSF} - i_{\rm Kron} < 0.1$,
     1536using the average $i$ magnitudes determined from the individual
     1537exposures. 
     1538
     1539For Figure~\ref{fig:gaia.photom}, we calculate the difference between
     1540the estimated $G$-band magnitude based on PS1 $g,r,i$ photometry and
     1541the $G$-band photometry reported by Gaia.  For each pixel, we
     1542determine the histogram of these differences and calculate the median
     1543and the 68\%-ile range.  In Figure~\ref{fig:gaia.photom}, these
     1544values are plotted as a color scale. 
     1545
     1546The Galactic plane is clearly poorly matched between the two
     1547photometry systems.  This may in part be due to the difficulty of
     1548predicting $G$-band magnitudes for stars which are significantly
     1549extincted: the $G$-band includes significant flux from the PS1
     1550$z$-band which was not used in our transformation.  Many other large
     1551scale feature in the median differences have structures similar to the
     1552Gaia scanning pattern (large arcs and long parallel lines.  There are
     1553also structures related to the PS1 exposure footprint.  These show up
     1554as a mottling on the \approx 3 degree scale (e.g., lower right below
     1555the Galactic plane).  The amplitude of the residual structures is
     1556fairly modest.  The standard devition of the median difference values
     1557is 7 millimagnitudes.  This number gives an indication of the overall
     1558photometric consistency of both Gaia and PS1 and implies that the
     1559systematic error floor for each survey is less than 7 millimags.
     1560
     1561% set Gr = -0.090 + gr*gi*0.229 + gi*(-0.207+gi*(gi*0.015 - 0.250)) + gr*(0.491+gr*(-0.021*gr - 0.052))
     1562
     1563%\[
     1564%G - r = -0.09 + 0.229(g-r)(g-r) + (g-i)((
     1565
     1566\begin{figure*}[htbp]
     1567  \begin{center}
     1568  \includegraphics[width=\hsize,clip]{{pics/gaia.astrom}.png}
     1569  \caption{\label{fig:gaia.astrom} Comparison with Gaia
     1570    astrometry. {\bf Left} Mean of PS1 - Gaia, {\bf Right} Standard
     1571    deviation of PS1 - Gaia.  The median value of the standard
     1572    deviations is $(\sigma_\alpha, \sigma_\delta) = (4, 3)$
     1573    milliarcseconds. }
     1574  \end{center}
     1575\end{figure*}
     1576
     1577Figure~\ref{fig:gaia.astrom} shows a comparison between the Pan-STARRS
     1578mean astrometry positions in $\alpha,\delta$ and the Gaia astrometry.
     1579For this comparison, we have seleted all PS1 stars with Gaia
     1580measurements with $14 < i < 19$ and with at least 10 total
     1581measurements.  For Figure~\ref{fig:gaia.astrom}, we calculate the
     1582difference between the position predicted by PS1 at the Gaia epoch
     1583(using the proper motion and parallax fit) and the position reported
     1584by Gaia.  For each pixel, we determine the histogram of these
     1585differences in the R.A\. and DEC directions, and calculate the median
     1586and the 68\%-ile range.  In Figure~\ref{fig:gaia.astrom}, these
     1587values are plotted as a color scale.
     1588
     1589There is good consistency between the PS1 and Gaia astrometry.  There
     1590are patterns from the Galactic plane (though not very strongly at the
     1591bulge).  There are also clear features due to the PS1 exposure
     1592footprint (ring structure on \approx 3 degree scales).  In the plots
     1593of the scatter, there are patterns which are related to the Gaia
     1594scanning rule.  These are presumably regions with relatively low
     1595signal to noise in Gaia; they were also apparent in the plots of the
     1596statisics of the per-exposure measurement residuals
     1597(Figure~\ref{fig:allsky.astrom.sigma}.  The standard deviations of the
     1598median differences are ($\sigma_\alpha, \sigma_\delta) = (4, 3)$
     1599milliarcseconds.
     1600
     1601\subsection{Calculation of Object Astrometry}
     1602
     1603\subsubsection{Iteratively Reweighted Least Squares Fitting}
     1604
     1605\subsubsection{Seletion of Measurements}
     1606
     1607\section{Discussion}
     1608
     1609\section{Conclusion}
     1610
     1611\acknowledgments
     1612
     1613The Pan-STARRS1 Surveys (PS1) have been made possible through
     1614contributions of the Institute for Astronomy, the University of
     1615Hawaii, the Pan-STARRS Project Office, the Max-Planck Society and its
     1616participating institutes, the Max Planck Institute for Astronomy,
     1617Heidelberg and the Max Planck Institute for Extraterrestrial Physics,
     1618Garching, The Johns Hopkins University, Durham University, the
     1619University of Edinburgh, Queen's University Belfast, the
     1620Harvard-Smithsonian Center for Astrophysics, the Las Cumbres
     1621Observatory Global Telescope Network Incorporated, the National
     1622Central University of Taiwan, the Space Telescope Science Institute,
     1623the National Aeronautics and Space Administration under Grant
     1624No. NNX08AR22G issued through the Planetary Science Division of the
     1625NASA Science Mission Directorate, the National Science Foundation
     1626under Grant No. AST-1238877, the University of Maryland, and Eotvos
     1627Lorand University (ELTE) and the Los Alamos National Laboratory.
     1628
     1629\bibliographystyle{apj}
     1630%\bibliography{lib}{}
     1631\input{calibration.bbl}
     1632
     1633\end{document}
     1634
    901635\begin{verbatim}
    91 Intro
    92  Pan-STARRS background
    93  Scope: Source Detection \& Characterization, Galaxy modeling
    94  Requirements / Goals
    95  Comparable programs
    96  PSPhot
    97 
    98 Figures which might be interesting:
    99 
    100 * kron vs psf star-galaxy separation
    101 * lensing parameters for star-galaxy separation?
    102 * color-color locus plots
    103 * density of stars on the sky vs mag?
    104 * density of galaxies on the sky
    105 * good objects vs garbage?
    106 * bright-end astrometry residuals
    107 * bright-end photometry residuals
    108 * photometry residuals vs camera
    109 
    110 in patches, measure dlogN/dmag slope and roll-off (scale?)
    111 
    112 chip vs warp vs stack photometry across the sky
    113 
    114 color-color plots: g-r,r-i r-i,i-z (the stats from photladder paper)
    115 
    116 number of stars @ 20.5
    117 
    118 ** do these plots in parallel :
     1636 Plots:
     1637* illustration of the astrometric models (schematic)
     1638* astrometry cross-correlation example?
     1639* zero point history, including / excluding ubercal? (from Eddie)
     1640* applied flat-field images [FITS -> png]
     1641* Koppenhoffer plots [from presentations]
     1642* DCR plots [exist]
     1643* astrometric flat fields [FITS -> png]
     1644* PV3 vs Gaia [exit]
     1645* PV3 quasar motions [** need to extract **]
     1646* bright-end astrometry residuals [running cdhist code, but is the density too low?]
     1647* bright-end photometry residuals [running cdhist code, but is the density too low?]
     1648
     1649* careful discussion of calibration wrt scolnic et al
    1191650
    1201651\end{verbatim}
    1211652
    122 \section{INTRODUCTION}\label{sec:intro}
    123 
    124 \section{Pan-STARRS1}
    125 
    126 \section{Photometry Analysis}
    127 
    128 \section{Astrometry Analysis}
    129 
    130 \section{Systematic Residuals}
    131 
    132 \subsection{Camera-Scale Trends}
    133 
    134 \section{Discussion}
    135 
    136 \section{Conclusion}
    137 
    138 \end{document}
     1653List of Figures and their sources:
     1654
     1655* KH example & map:
     1656  * kukui:/data/kukui.3/eugene/pv3.stats.20161202
     1657    * kh.data.20151203.v1/spline.final.fits : spline fits to the KH data
     1658    * kh.data.20151203.v1.fits : densify images of residuals per chip : (dX,dY) & (T0, T1) = (pre fix, post fix)
     1659    * mana.sh : kh.example - plot of XY04
     1660    * mana.sh : khmap (needs cleanup)
     1661  * ipp094:/data/ipp094.0/eugene/pv3.cam.20150607/astrom.corrections : extractions and original scripts to make spline, etc
     1662
     1663* DCR plots:
     1664  * need to rebuild density plots (density images used to make splines are poor for plots)
     1665  * old examples:
     1666    * /data/kukui.3/eugene/dcr.20141205
     1667      * dcr.r2.g.png
     1668  * spline fits (DCR.example)
     1669    * g : dP/dQ =  0.010, dPmax =  0.019
     1670    * r : dP/dQ =  0.001, dPmax =  0.002
     1671    * i : dP/dQ = -0.003, dPmax = -0.003
     1672    * z : dP/dQ = -0.017, dPmax = -0.006
     1673    * y : dP/dQ = -0.021, dPmax = -0.008
     1674
     1675* astroflats:
     1676  * kukui:/data/kukui.3/eugene/pv3.cam.20150607
     1677    * plots.sh :
     1678  * photflat.20151127.fix.fits was made in:
     1679    * kukui:/data/kukui.3/eugene/setphot.20151213
     1680
     1681* Gaia comparisons:
     1682  * ipp094:/data/ipp094.0/eugene/pv3.stats.20161022
     1683  * kukui:/data/kukui.3/eugene/pv3.stats.20161022
     1684 
     1685* photom & astrom residuals:
     1686  kukui:/data/kukui.3/eugene/pv3.stats.20161202/maps.measure
     1687
Note: See TracChangeset for help on using the changeset viewer.