\documentclass[preprint2]{emulateapj}

%% EAM 2019.08.26 : I am starting edits based on the comments I sent to HAF last month

\usepackage{longtable}
\usepackage{cancel}	
\usepackage{color}
\usepackage{graphicx, subfigure}

\usepackage{placeins}
\usepackage{amsmath}
\usepackage{tabulary}
\usepackage{natbib}


\def\lesssim{\mathrel{\hbox{\rlap{\hbox{\lower4pt\hbox{$\sim$}}}\hbox{$<$}}}}
\def\gtrsim{\mathrel{\hbox{\rlap{\hbox{\lower4pt\hbox{$\sim$}}}\hbox{$>$}}}}
\newcommand{\gps}{\ensuremath{g_{\rm P1}}}
\newcommand{\rps}{\ensuremath{r_{\rm P1}}}
\newcommand{\ips}{\ensuremath{i_{\rm P1}}}
\newcommand{\zps}{\ensuremath{z_{\rm P1}}}
\newcommand{\yps}{\ensuremath{y_{\rm P1}}}
\newcommand{\wps}{\ensuremath{w_{\rm P1}}}
\newcommand{\grizy}{\gps,\rps,\ips,\zps,\yps}
\newcommand{\rizy}{\rps,\ips,\zps,\yps}

\newcommand{\PS}{\protect \hbox {Pan-STARRS1}}
\newcommand{\ps}{\protect \hbox {PS1}}
%in kens paper PS1 is used everywhere (not ps1)

\newcommand{\degree}{\mbox{$^\circ$}}
\newcommand{\degrees}{\degree}
\newcommand{\msun}{\mbox{M$_{\odot}$}}
\newcommand{\msol}{\mbox{M$_{\odot}$}}
\newcommand{\zsol}{\mbox{Z$_{\odot}$}}
\newcommand{\rsun}{\mbox{R$_{\odot}$}}
\newcommand{\kms}{\mbox{$\rm{\,km\,s^{-1}}$}}
\newcommand{\logl}{\mbox{$\log L/{\rm L_{\odot}}$}}
\newcommand{\hii}{\mbox{H\,\{\sc ii}}
\newcommand{\nick}{\mbox{$^{56}$Ni}}
\newcommand{\mpcy}{\mbox{Mpc$^{-3}$\,yr$^{-1}$}}

\newcommand\note[1]{\textbf{\color{red}#1}}

\newcommand\parheading[1]{\vskip 0.1cm \noindent {\bf \em #1:}}

\newcommand\showfigure[1]{\input{#1}}
%\newcommand\showfigure[1]{}

\def\Ha{H{$\alpha$}}
\def\Hb{H{$\beta$}}
\def\Hg{H{$\gamma$}}
\def\Hd{H{$\delta$}}
\def\Ni{$^{56}$Ni}
\def\Co{$^{56}$Co}
\def\Mej{$M_{\rm ej}$}
\def\Mcsm{$M_{\rm CSM}$}
\def\Mni{$M_{\rm Ni}$}
\def\Rph{$R_{\rm phot}$}
\def\vsn{$v_{\rm SN}$}
\def\vph{$v_{\rm phot}$}
\def\Rs{$R_{\star}$}
\def\EM{$E_{\rm k}/M_{\rm ej}$}
\def\E{$E_{\rm k}$}

\outer\def\replacetext#1#2{{\textcolor{red}{#1} {\ensuremath{\rightarrow}} \textcolor{blue}{#2}}}
\outer\def\okreplacetext#1#2{{#2}}  
\outer\def\noreplacetext#1#2{{#1}} % \let\replacetext=\okreplacetext
%; change 'replacetext' to 'okreplacetext' to accept the change, to noreplacetext to reject.  Uncomment the "let" command to hide the changes.
%if using \PS\ (words), it seems to print like "Pan-STARRS1(words)", no space, I'm removing the ending \ to see if it fixes it 

%heather's style guide for data product words 
%(may not be correct, just writing down the rules 
%please edit to make correct

\newcommand\ippstage[1]{\textsc{#1}}

\newcommand\ippprog[1]{\texttt{#1}}
\newcommand\ippmisc[1]{\texttt{#1}}

\newcommand\ipptable[1]{\textit{#1}}
\newcommand\ippdbtable[1]{\textit{#1}}
\newcommand\ippdbcolumn[1]{\textit{#1}}
\newcommand\smf{\textit{smf}}
\newcommand\cmf{\textit{cmf}}

% EAM for consistency with the other papers:

% small caps for the analysis stages (vs programs)

% italics (\em ) for glossary / acronyms
% italics for table names
% italics for column names

% teletype for code, queries, miscellaneous constants

% Preferred capitalizations for things

% IppToPsps
% PSPS  
% PS1
% dvo or DVO?
% add other things if you like


\shorttitle{The Pan-STARRS1 Database and Data Products}
\shortauthors{H. A. Flewelling}


\begin{document}
\title{The Pan-STARRS1 Database and Data Products}
\author{
H.~A.~Flewelling\altaffilmark{1}, 
E.~A.~Magnier\altaffilmark{1}, 
K.~C.~Chambers\altaffilmark{1},
J.~N.~Heasley\altaffilmark{8},
C.~Holmberg\altaffilmark{1},
M.~E.~Huber\altaffilmark{1},
W.~Sweeney\altaffilmark{1}, 
C.~Z.~Waters\altaffilmark{1},
A.~Calamida\altaffilmark{4},
S.~Casertano\altaffilmark{4},
X.~Chen\altaffilmark{10},
D.~Farrow\altaffilmark{5}
G.~Hasinger\altaffilmark{1},
R.~Henderson\altaffilmark{11},
K.~S.~Long\altaffilmark{4},
N.~Metcalfe\altaffilmark{2},
G.~Narayan\altaffilmark{4},
M.~A.~Nieto-Santisteban\altaffilmark{4},
P.~Norberg\altaffilmark{6,7},
A.~Rest\altaffilmark{4},
R.~P.~Saglia\altaffilmark{5},
A.~Szalay\altaffilmark{3},
A.~R.~Thakar\altaffilmark{3},
J.~L.~Tonry\altaffilmark{1}, 
J.~Valenti\altaffilmark{4},
S.~Werner\altaffilmark{3},
R.~White\altaffilmark{4},
%
L.~Denneau\altaffilmark{1},
P.~W.~Draper\altaffilmark{2},
K.~W.~Hodapp\altaffilmark{1},
R.~Jedicke\altaffilmark{1},
N.~Kaiser\altaffilmark{1},
R.~P.~Kudritzki\altaffilmark{1},
P.~A.~Price\altaffilmark{9},
R.~J.~Wainscoat\altaffilmark{1},
% P.~S.~Builders\altaffilmark{PS1},
S.~Chastel\altaffilmark{1},
B.~McLean\altaffilmark{4},
M.~Postman\altaffilmark{4},
B.~Shiao\altaffilmark{4}.
}



\altaffiltext{1}{Institute for Astronomy, University of Hawaii, 2680 Woodlawn Drive, Honolulu, Hawaii 96822, USA}
\altaffiltext{2}{Department of Physics, Durham University, South Road, Durham DH1 3LE, UK}
\altaffiltext{6}{Institute for Computational Cosmology, Department of Physics, Durham University, South Road, Durham DH1 3LE, UK}
\altaffiltext{7}{Centre for Extragalactic Astronomy,  Department of Physics, Durham University, South Road, Durham DH1 3LE, UK}
\altaffiltext{3}{Department of Physics and Astronomy, The Johns Hopkins University, 3400 North Charles Street, Baltimore, MD 21218, USA}
\altaffiltext{4}{Space Telescope Science Institute, 3700 San Martin Drive, Baltimore, MD 21218, USA}
\altaffiltext{5}{ Max-Planck Institut f\"ur extraterrestrische Physik, Giessenbachstra\ss e 1, D-85748 Garching, Germany}
\altaffiltext{8}{Back Yard Observatory, P.O. BOX 68856, Tucson, AZ 85737}
\altaffiltext{9}{Department of Astrophysical Sciences, Princeton University, Princeton, NJ 08544, USA}
\altaffiltext{10}{Google Inc., 1600 Amphitheatre Pkwy, Mountain View, CA 94043}
\altaffiltext{11}{Spire Global, Sky Park 5,45 Finnieston Street, Glasgow, G3 8JU, UK }
% \altaffiltext{PS1}{Pan-STARRS1 Builders}
%\begin{document}
%\maketitle
%\section{}
%\subsection{}

%to be included: all theses guys -- I emailed them if they replied I add a YES.. all should be added into paper list
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%authorlist %These guys are in 
%tier 1
%Magnier YES
%Chambers YES
%Heasley YES % J. N. Heasley\altaffilmark{x},
%Holmberg YES
%Huber YES
%Sweeney bills@ifa.hawaii.edu
%Waters YES

%tier2 %these guys are in unless they opt out
%Chen, Thomas   txchen@gmail.com
%Farrow   dfarrow@mpe.mpg.de 
%Hasinger  hasinger@ifa.hawaii.edu
%Henderson YES
%Long      YES  long@stsci.edu
%Metcalfe  nigel.metcalfe@durham.ac.uk 
%Niento-Santisteban
%Norberg  Peder.Norberg@durham.ac.uk 
%Saglia saglia@mpe.mpg.de 
%Szalay szalay@pha.jhu.edu
%Rest arest@stsci.edu 
%Thakar thakar@jhu.edu
%Tonry jt@ifa.hawaii.edu 
%Valenti valenti@stsci.edu 
%Werner YES
%White rlw@stsci.edu 

%builders =---not yet emailed, they have to opt in

%tier 3 % these guys are in as well
% Chastel YES  rlw@stsci.edu 
% Postman postman@stsci.edu
% shiao  shiao@stsci.edu 
% McClean mclean@stsci.edu


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{abstract}
 This paper describes the organization of the database and the catalog data products from the \PS\ $3\pi$ Steradian Survey. The catalog data products are available in the form of an SQL-based relational database from MAST, the Mikulski Archive for Space Telescopes at STScI. The database is described in detail, including the construction of the database, the provenance of the data, the schema, and how the database tables are related. Examples of queries for a range of science goals are included. The catalog data products are available in the form of an SQL-based relational database from MAST, the Mikulski Archive for Space Telescopes at STScI.
\end{abstract}

\keywords{astronomical databases, database schemas, queries}

\section{Introduction}\label{sec:introduction}

For nearly four years, from 2010 May through 2014 March, the 1.8m \PS\ telescope (PS1) was used to perform as set of astronomical surveys with wide-ranging scientific goals.  The largest portion of the observing time (56\%) was used for the so-called $3\pi$ Survey, covering the $\frac{3}{4}$ of the sky north of -30 Declination, easily observable by \ps\ from its site on the summit of Haleakala on the Hawaiian island of Maui.  The wide-field optical design of the telescope \citep{2004AN....325..636H} allowed \ps\ to observe most of the $3\pi$ Survey area in each five filters (\grizy) between 10 and 15 times.  Another 25\% of the observing time was dedicated to the Medium Deep (MD) Survey, in which 10 fields were repeatedly observed over the course of the 4 year mission.  The Pan-STARRS1 Gigapixel Camera (GPC1), consisting of an $8 \times 8$ grid of $4846 \times 4868$ pixel CCDs covering roughly 7 square degrees, has a pixel scale of 0.257 arcseconds.  The telescope optics and the natural seeing of the site result in good image quality which is fully sampled by the GPC1 pixels: 75\% of the $3\pi$ Survey images have full-width half-max values less than (1.51, 1.39, 1.34, 1.27, 1.21) arcseconds for (\grizy), with a floor of $\sim 0.7$ arcseconds. 

% Operating under the aegis of the Pan-STARRS Science Consortium,

 This is the sixth in a series of seven papers that describe the \PS\ Surveys, the data processing algorithms, calibration,
and the resulting data products. \citet[][Paper I]{Chambers2017} describe the \PS\ Surveys, an overview of the \PS\ System, the resulting image and catalog data products, a discussion of the overall data quality and basic characteristics, and a summary of important results. \citet[][Paper II]{Magnier2017a} describe how the various data processing stages of the Pan-STARRS Image Processing Pipeline (IPP) are organised and implemented. \citet[][Paper III]{Waters2017} describe 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. \citet[][Paper IV]{Magnier2017b} describe the details of the source detection and photometry, including point-spread-function and extended source fitting models, and the techniques for forced photometry measurements. \citet[][Paper V]{Magnier2017c} describe the final calibration process, and the resulting photometric and astrometric quality. This paper (Paper VI) describes the \PS\ database, the data products, and details of their organization in the \PS\ database. 
\citet[][Paper VII]{Huber2017} will describe the Medium Deep Survey in detail, including the unique issues and data products specific to that survey. 

In this article, we use the following type-faces to distinguish
different concepts:
\begin{itemize}
\item \ippstage{Small caps} for the analysis stages.
\item \ippdbtable{Italics} for database tables and columns.
\item \ippprog{Fixed-width} font for program names, variables, and miscellaneous constants.
\end{itemize}

\section{Background}
\label{sec:background}
The Pan-STARRS Project teamed with Alex Szalay's database development group at The Johns Hopkins University (JHU) to undertake the task of providing a publicly accessible hierarchical database for \PS\ \citep{Heasley2008}. The JHU team was the major developer of the Sloan Digital Sky Survey (SDSS) public database \citep{Thakar2003}, and it was an early goal of the Pan-STARRS team to reuse as much of the existing software as possible. However, for a number of reasons including the much larger size of the \PS\ dataset, the wide variety of image and measurement types and the importance of temporal information, major changes to the code base were required.  Like the SDSS database, the database implementation for \PS\ is based on the Microsoft SQL Server product line, with supporting code forked from the SDSS Catalog Archive Server Jobs System (CasJobs).  Staying with SQL Server allows the use of a wealth of software developed for SDSS, including the  Hierarchical Triangular Mesh tools \citep{Szalay2007}.  The system developed for \PS\ is called the {\em Published Science Products Subsystem}, or PSPS \citep{Heasley2006}.

%(SDSS) public database \citep{Thakar2003}, and it is useful to reuse as much of the software developed for the SDSS as possible. However, due
%to the Pan-STARRS's data having a larger intrinsic size and more complicated dataset, which covers a larger area of sky than SDSS and which
%includes measurements on the stacks, single exposures, and mean properties of each, major changes were required. The system developed is
%called the {\em Published Science Products Subsystem}, or PSPS \citep{Heasley2006}.

The most significant challenge for the PSPS relative to the SDSS database implementation was the need to address the very large volume of \PS\ data.  The single monolithic database design of SDSS could not scale to the level needed for PS1 data.  While SQL Server does not have (at present) a cluster implementation, a bespoke version can be crafted using a combination of distributed partition views and data slices~\citep{Heasley2008}. Partitioning data into smaller databases spread over multiple server machines allows the information to be presented to the users as a single, unified table.

%Our approach has been to use several features available within the Microsoft SQL Server product line to implement a system that would meet our requirements. 

%The key to moving from the SDSS database to a system capable of dealing with the large volume of \PS\ data is the design of the Data Storage layers. 

% The key to moving from the SDSS database to a system capable of dealing with the large volume of \PS\ data is the design of the Data Storage layers. It was immediately clear that a single monolithic database design (like SDSS) would not work for the challenges posed by the PS1 data. Our approach has been to use several features available within the Microsoft SQL Server product line to implement a system that would meet our requirements. While SQL Server does not have (at present) a cluster implementation, a bespoke version can be crafted using a combination of distributed partition views and slices~\citep{Heasley2008}. Partitioning data into smaller databases spread over multiple server machines allows us to still treat the information as a unified table (from the users' perspective). Further, by staying with SQL Server we retain a wealth of software tools developed for SDSS, including the use of Hierarchical Triangular Mesh \citep{Szalay2007}.

\section{Processing Versions and Data Releases}

The Pan-STARRS data released to the community has been processed several times.  All data is processed immediately by the data analysis system in order to discover moving and transient objects.   This nightly science processing is streamlined and designed to allow fast access to the results by the \PS\ {\em Moving Object Processing System} \citep[MOPS]{Denneau2013} and the PS1 science consortium, typically within a few hours after observation, for the discovery of moving objects, supernovae, and other time-sensitive transients.  We refer to the nightly science processing as Processing Version 0 (PV0).  On longer time-scales, large portions of the data have been re-processed, either for internal use or for external release.  The $3\pi$ Survey data spans $> 4$ years of observations (2010-2014, with some observations in 2009 and 2015), a time during which the IPP was actively being developed and improved.  To make a consistent set of data, both for internal use as well as for the public release, all of the raw images were reprocessed from scratch using a specific revision number of the IPP code.  During the survey, the 3$\pi$ Survey data was reprocessed twice for internal access by the consortium members, making use of improvements to the calibrations and the processing algorithms.  These internal releases are considered PV1 and PV2.  The data released to the public in DR1 and DR2 represent a third full-scale reprocessing of the data, PV3.  

%The first several \PS\ data releases will be dedicated to the 3$\pi$ survey, covering the sky North of $ -30\deg $ \citep[See ][for a description of the various surveys carried out with the PS1 telescope]{Chambers2017}, with plans to release the Medium Deep Survey (MD) data thereafter.  
%The available pixel data products for DR1 include the PS1 \ippstage{stack} image products from the 3$\pi$ survey.  

\input{pspstables.tex}

This paper covers multiple data releases.  The first \PS\ data release
(DR1, Dec 2016) covers the 3$\pi$ \ippstage{stack} images and the static
sky catalog.  The DR1 image products are deep stacked images
along with ancillary data including signal, masks, variance, and
number maps.  The DR1 catalog data products available from the PSPS
include the PS1 static sky 3$\pi$ catalog. Source properties are
organized into several tables, as described in
Table~\ref{table:pspstables}; only tables referring to the static
results, without time domain information, are included in DR1.

Data Release 2 (DR2, Jan 2019), adds more of the PS1 image products
from the 3$\pi$ survey, including the single epoch \ippstage{warp} images
and their ancillary data, such as signal, masks, and variance
maps. DR2 provides the \ippdbtable{Detection} tables and \ippdbtable{Forced*}
tables, containing the single epoch source detections and the forced
photometry.  DR2 also contains numerous improvements to the data
products in DR1, which it supersedes. Future data releases are
anticipated to provide the 3$\pi$ \ippstage{diff} image products and
catalogs, and analogous data products for the MD surveys.

\showfigure{revisedipptopsps.tex}

\section{Overview of the Data Products}
\label{sec:overview}

Public access to the Pan-STARRS data is through the web server located
at \url{http://panstarrs.stsci.edu} and is hosted by the {\em
  Barbara A. Mikulski Archive for Space Telescopes} (MAST) at
STScI. MAST provides the access point for downloading different pixel
data products and their associated metadata and source catalogs. This
includes FITS images, FITS and JPEG image cutouts, scriptable image
access, color JPEG images, and an interactive image browser with
catalog overlays through the MAST portal and the MAST PS1 image cutout
server. In addition, MAST provides a simple web-based interface to
access the Pan-STARRS catalog database. Full database access to the
Pan-STARRS tables is available through the Catalog Archive Server Jobs
System (CasJobs) interface (see description at
\url{http://mastweb.stsci.edu/mcasjobs}). CasJobs emulates local
free-form SQL access in a web environment, and provides both
synchronous and asynchronous query execution. The interface can
execute complex, large queries of the PS1 (DR1/DR2) catalogs, with
results saved to a private space allocated to each registered
user. The Pan-STARRS catalog database accessible through CasJobs
contains calibrated catalogs of photometric and astrometric parameters
for single epoch exposures, stacks, difference images, and forced
photometry. The database schema for the Pan-STARRS catalog database is
briefly described in Section~\ref{sec:schemaintro}, and is fully
expanded in Appendix~\ref{sec:schema}. Examples of queries are
described in Appendix~\ref{sec:query}.

The \PS\ catalog database schema is organized into four sections:

\begin{enumerate}

\item Fundamental Data Products. These are attributes that are
  calculated from either detrended but untransformed pixels or warped
  pixels. It should be noted that, once in the database, the
  instrumental fluxes and magnitudes have been subject to
  re-calibration, as have the sky coordinates. Because of these
  re-calibrations on the catalogs, the catalog values are to be
  preferred to making a new measurement directly from the available
  released pixel data, and care should be taken when using the
  recalibrated astrometry with the original images (see Table
  \ref{table:fundamentalipp}).

\item Derived Data Products. These are higher order science products
  that have been calculated from the Fundamental data products, such
  as proper motions and photometric redshifts. These data products are
  not yet available and will come in later data releases.

\item Observational Metadata. These metadata provide detailed
  information about the individual exposures (e.g. information like
  exposure time, filter used, etc.) or about which exposures went into
  an image combination (stacks and diffs), as well as information such
  as detection efficiencies.
% (see Table \ref{table:observationalmetadata}).

\item System Metadata. These tables have fixed information about the
  system and the database itself, primarily descriptions of various
  flags and their bits, but also for other metadata such as filter
  information.

% (see Table \ref{table:systemmetadata}).
\end{enumerate}

Various database ``Views'' are also constructed as an aid to the user
for standard types of queries. Views act like tables, and primarily
consist of joins of different commonly used tables, in order to
simplify queries. Views are also used to join slices of tables (sliced
by area of sky) into a full sky view. For example, ``\ippdbtable{Detection}'' is a
view of 32 \ippdbtable{Detection} tables, but the individual tables are hidden from
the user. For more information on views, including the currently
defines ones, see Table \ref{table:views}.

This paper covers the data products and schema for the 3$\pi$ data
releases, though most details also apply to the Medium Deep
fields. Additional documentation is available together with the data
products through MAST.

\note{what are the notes in Table 2?}

\input{fundamentalipp.tex}

\section{Flow of Data From Pipeline to the Pan-STARRS Catalog Database}

\label{sec:creation}
This section presents a condensed version of the flow of data starting with raw image processing by the Pan-STARRS {\em Image Processing Pipeline} (IPP), and ending with the steps used to generate the PSPS database. The description includes an overview of the various terms used to describe different data products. For the full description of these steps, see Paper II.  A flowchart of the whole process is shown in Figure~\ref{fig:revisedipptopsps}.  
 
Exposures are first processed by the IPP, producing measurements of the sources in the individual images, stacks, and difference images.   These measurements are then ingested into an instance of the ``Desktop Virtual Observatory'' database system (DVO, described briefly in section~\ref{sec:DVOdatabase} and more extensively in Paper V).  The DVO database is then calibrated (Paper V).  Next, the \ippstage{IppToPsps} combines the measurements with the calibrations and transforms them into the appropriate format for the PSPS.  Data in this form are loaded into the PSPS database at the IfA.  The PSPS database is then copied to STScI and made available to the users.

% During the various processing steps some data are removed or flagged out , requiring updates to the list of available data. (wording unclear) 

%% EAM : I'm streamlining this whole section by removing these summary paragraphs.  

% An overall summary of the process is as follows.  First, exposures are taken by the telescope at the summit.  They then undergo processing by the IPP producing catalogs files from the \ippstage{camera} stage, \ippstage{stack} stage, \ippstage{diff} stage and \ippstage{forced warp} stage. These catalog files (in the form of binary FITS tables called /cmf\/smf\ files) are then ingested into an instance of the ``Desktop Virtual Observatory'' database system (DVO, described briefly in section~\ref{sec:DVOdatabase} and more extensively in Paper V).  The DVO database is then calibrated (Paper V).  Next, the \ippstage{IppToPsps} system creates ``batches'' or small file sets containing chunks of data corresponding to a portion of the database content and formatted according to the PSPS database schema.  These batches either correspond to a small portion of the sky for a particular processing stage (extracted from the DVO database) or to specific \cmf\ or \smf\ files.  The batches are loaded into the PSPS database at the IfA.  The PSPS database is then copied to STScI and made available to the users.

\subsection{Processing Stages}
\label{sec:processingstages}

Processing with the IPP takes place in several stages.  Since the organization of the PSPS database is tied to these processing stages, we describe them in some detail here.  For further information, see Paper II for the overall analysis sequence, Paper III for the details in the detrending and other pixel manipulation, Paper IV for the source detection and characterization, and Paper V for the photometric and astrometric calibration.

% The first stage of data analysis starts with the processing of raw images into detrended images (with flats/biases/darks and other corrections applied) as described in Paper III.  The detrended images are then geometrically transformed to a common pixel grid system.  The resulting warp images are used to generate \ippstage{stacks}, \ippstage{difference images} and associated catalogs. Finally, forced photometry is performed on the \ippstage{warps} using positions of sources detected in the stacks (see Paper IV).

% We provide a short description of the different stages of this pipeline, separated into sections based on final available image data products and products that are used to create the large relational database below. 

\subsubsection{Download and registry of images}
\label{sec:ippmetadata}

Before processing of images can take place, they must first be transferred to the IPP cluster from the summit, and registered in a metadata database to ensure that all of the $>$ 1.3 million images taken by Pan-STARRS have been properly handled.  This is represented as the ``image" $\rightarrow$ ``ipp processing" step in Figure~\ref{fig:revisedipptopsps}. The IPP uses an internal database to track all parts of the image processing.  This database keeps basic metrics relevant to each stage, including details on what type of image was taken,  when an image was processed, how long processing took, flags and other metrics on the quality, etc.  This internal processing database is referenced to in this paper as the ``GPC1'' database.

\subsubsection{Chip and Camera Stages}
\label{sec:chipandcamera}

 The \ippstage{chip} stage takes the raw images, generally 60 FITS files, one FITS file per OTA, and detrends them, one chip per computing job. Dark, flat, bias, background and other corrections, as described in Paper III, are applied to each chip image, followed by source detection and photometry using the \ippprog{psphot} program (Paper IV). Next, the \ippstage{camera} stage combines the outputs of the \ippstage{chip} stage, performs basic astrometry on the detected sources, and generates a binary FITS table, called an \smf\ file, holding the catalog information for the entire exposure. These files  are later ingested into a DVO-style database for internal use. These 2 stages are represented as the ``ipp processing" $\rightarrow$ ``camera" steps in Figure~\ref{fig:revisedipptopsps}. Camera stage products are available to the user in the PSPS `Detection' tables, starting with DR2.


\subsubsection{Warp Stage}
\label{sec:fakeandwarp}

The next step, the \ippstage{warp} stage, is represented as ``camera" $\rightarrow$ ``stacks" in Figure~\ref{fig:revisedipptopsps}. The \ippstage{warp} stage geometrically transforms the output images from the \ippstage{chip} stage to a common pixel grid defined on a tangential RA/Dec plane, with 0.25\arcsec\ pixels.  The output images, called ``skycells'', cover the entire sky; thus an image from a PS1 exposure can be split and projected onto a common layout for its portion of the sky. For 3$\pi$, the skycell tessellation\footnote{Note that our use of the term `tessellation' is inaccurate since the skycell sizes are variable and neighbors overlap each other.} is called \ippmisc{Rings.V3} and is described in detail in Paper II. This tessellation subdivides the sky into projections cell rings with centers at constant Declination.  Each projection cell is $\sim4.0~ \times \sim4.0$ degrees, subdivided into $10 \times 10$ skycells, each with 60\arcsec\ of overlap on a side, yielding square image with size ranging from 6240 to 6500 pixels on a side. All image data products beyond \ippstage{warp} (\ippstage{stacks}/\ippstage{forced warps}/\ippstage{diffs}/ etc.) are laid out in skycells as well.  

The warp image products are available to users via MAST for the $3\pi$ survey as part of DR2.

\subsubsection{Stack, StaticSky, Skycal Stages}
\label{sec:stackstages}

There are 3 stack-related stages: \ippstage{stack}, \ippstage{staticsky}, and \ippstage{skycal}. The \ippstage{stack} stage generates the stacked images, \ippstage{staticsky} generates the source catalogs files, while \ippstage{skycal} calibrates the source catalogs. All of the stack related stages are represented as ``stacks" in Figure~\ref{fig:revisedipptopsps}.

\ippstage{Stacks} are generated by adding together \ippstage{warp} skycells, with bad-pixel rejection and internal calibration as described in Paper III.  Depending on the survey, stacks may be generated from different sets of raw exposures.  For the deepest possible stacks, essentially all available exposures are combined, with only weak cuts on the data quality.  Stacks may also be generated with a constraint on the image quality of the input exposures in order to yield a deep reference image with good image quality.   In order to limit contamination from on-going transient events, stacks may also be generated with constraints on the time range of the input exposures : out-of-season stacks would include only exposures {\em not} taken within a given year or period to act as a reference for transient events within that period.  The different stack types are listed in the \ippdbtable{StackType} table in the PSPS database.  For the DR1 and DR2 3$\pi$ databases, only the \ippmisc{DEEP\_STACK} \ippstage{stack} type is used, i.e., all available \ippstage{warps} of sufficiently good quality for a given skycell and filter within the 3$\pi$ survey data set are used to generate the \ippstage{stacks}, yielding one \ippstage{stack} per skycell per filter. Mask images, variance images, and related pixel images are also generated for each stack.   

Once each \ippstage{stack} image is created, source detection and characterization, including galaxy morphological analysis, is performed by the \ippstage{staticsky} stage.  The source analysis is run on all 5 filters at once.  PSF photometry is forced for sources which are detected in at least two filter images on the other filter images for which the source was not detected above the $5\sigma$ threshold.  This forced photometry is also performed for sources detected in only the \yps-band.  

Aperture photometry, for a series of circular apertures specified by SDSS \citep{Stoughton2002}, is performed on the raw stacks and also on stack images which have been convolved to a common 6 pixel FWHM, and again to a common 8 pixel FWHM.  These latter seeing-matched images are only kept in memory for the analysis and are not written to disk.  Up to 9 of the SDSS apertures are used for this measurement: R3 ($r = 1.03$ arcsec), R4 ($r = 1.76$ arcsec), R5 ($r = 3.00$ arcsec), R6 ($r = 4.63$ arcsec), R7 ($r = 7.43$ arcsec), R8 ($r = 11.42$ arcsec), R9 ($r = 18.20$ arcsec), R10 ($r = 28.20$ arcsec), and R11 ($r = 44.21$ arcsec).  Note that the measurement is performed in apertures with the same angular diameter as used for SDSS, which necessarily results in different radii in pixels from those used by SDSS apertures \citep[see Table 7 in ][]{Stoughton2002}.  For more details on the photometric analysis of the stack images, see Paper IV.

Catalog files, one per filter, are generated with sources spatially-matched between filters using a 5 pixel (1.25\arcsec) correlation radius. Sources matched as across filters are linked in the output catalog by the detection ID.  The \ippstage{skycal} stage calibrates the \ippstage{staticsky} catalogs relative to the reference catalog. The calibrated catalog files are later ingested into the DVO database and then into the PSPS database. Due to the overlap between skycells, sources that land in the overlaps can be reported 2, 3, or 4 times in the DVO and PSPS database.  See the discussion in Section~\ref{sec:schemast} regarding the `primary' and `best' stack measurements.

Stack data products are available for the $3\pi$ survey as part of DR1 and DR2. Stack image products are available to users via MAST, and Stack-related tables are available in the PSPS database.

\subsubsection{Forced Warp Photometry Stage}
\label{sec:forcedphotom}

 Sources which are detected in the stack images are used to measure forced photometry on each of the input warps in the \ippstage{forced warp photometry} stage.  Two types of forced photometry analysis are performed on the \ippstage{warp} exposures: PSF photometry and galaxy model analysis. 

In the forced warp photometry stage, the positions of sources located in the deep \ippstage{stacks} are used to fix the position in the warp images.  The software then measures the PSF model flux at those positions on each of the individual warps.  This measurement also yields the Kron and aperture fluxes for the warp image at that location.  The catalogs generated by this process are ingested into the DVO database and average values are then calculated.  Note that the fluxes on the warps for faint objects may be insignificant or even negative; the average values are calculated using all flux values (both positive and negative) properly weighted by the detection flux errors.  Only measurements for which the warp pixels were excessively masked are rejected in this average flux calculation.  The individual measurements and the averages are translated by the \ippstage{IppToPsps} stage into the \ippdbtable{ForcedWarp*} tables for the PSPS.  For the $3\pi$ survey, these tables are available starting with DR2. 

For extended sources, galaxy models are fitted on the \ippstage{stack} images. These models are then used as a seed to determine galaxy models for each warp image. The position, aspect ratio, and (where appropriate) Sersic radius are kept fixed to the values determined for the stack image.  A grid of major and minor axis values are tested around the values from the stack fit for each warp image, with the galaxy model convolved with the PSF appropriate to the specific warp image.  The software reports the model normalization and $\chi^2$ value at each grid point; these are combined together across all warp exposures and the interpolated minimum $\chi^2$ value is used to determine a best-fit galaxy model.  Due to size constraints, only the average galaxy model results are propagated to the PSPS database.  These are later ingested into the PSPS database as the \ippdbtable{ForcedGalaxy*} tables. 

The extended source (galaxy) models described above are not applied to all sources.  Galaxy models are only applied if the measured Kron magnitudes are brighter than the following limits for at least one filter: (\grizy) = (21.5, 21.5, 21.5, 20.5, 19.5).  In addition, galaxy models and Petrosian fluxes are only measured for skycells with centers outside of a Galactic plane exclusion zone defined for the $3\pi$ Survey as:
\[
|b| > b_0 + r_b e^{\frac{-l^2}{2\sigma_b^2}}
\]
where $b_0 = 20\degree$, $r_b = 15\degree$, and $\sigma_b = 50\degree$ and $l$, the Galactic longitude, is constructed to have a domain of -180\degree\ to +180\degree.  Thus, both apparently stellar and non-stellar sources outside of the dense portions of the Galactic plane and bulge have galaxy models and Petrosian fluxes measured (see full discussion in Paper IV).

%\subsection{Results from Processing Stages}
%\label{sec:resultsfromprocessingstages}

% A subset of these products are to be released in DR1, and the rest will be released in DR2. These include, for DR1, unconvolved images from the \ippstage{stack} stage for 3$\pi$.  
%DR2 will include warp images for all of the 3$\pi$ exposures.  Catalog data will be available via the PSPS database, it will include for DR1 stack measurements for unconvolved and convolved stacks, available in the Stack* tables, and mean properties from the camera stage (ObjectThin and MeanObject).  DR2 will include single exposure catalogs from the 'camera' stage (as Detection tables), all measurements from the 'forced photometry' stage (as Forced* tables), and all measurements from the 'diff' stage (as Diff* tables). 

%images/\smf\ files for the camera stage, images/\cmf\ files for the \ippstage{warp} stage, and images/\cmf\ files for the \ippstage{stack} stage (check).  Later data released will include  \ippstage{diffs} and forced \ippstage{warp} images/cmfs (xxx)  These products are available via STSCI / MAST (xxx)

\subsubsection{Diff Stage}
\label{sec:diffstage}

Difference images are generated by the IPP in order to detect transient and moving objects.  Several types of difference images may be generated by the IPP depending on the type of images which are involved in the subtraction.  The \ippmisc{WARP\_WARP} diffs are generated by subtracting warps from a pair of exposures, usually taken within a short period of time; these are primarily used by the nightly science processing and the MOPS analysis for inner solar system sources and for transient detections from the $3\pi$ survey data. \ippmisc{STACK\_STACK} diffs are generated by subtracting a deep reference stack from a stack of multiple exposure taken over a shorter period. The \ippmisc{STACK\_STACK} diffs are used for supernova discovery in the MD survey fields with 8 exposures taken in sequence and stacked to make a more sensitive single-epoch observation. The \ippmisc{WARP\_STACK} diffs were generated for the $3\pi$ survey by combining warps from single exposures with a deep reference stack.  These diffs are also used for MOPS and transient discoveries, and will be provided for the full $3\pi$ Survey as a temporal reference.  There is one \ippstage{diff} image for each single exposure within the 3$\pi$ survey. Finally, \ippmisc{STACK\_WARP} diffs could be made in principal but are not in practice used by the IPP. 

For the difference image analysis, the input images (\ippstage{stack} or \ippstage{warp}) are convolved to have similar PSFs \citep{Waters2017} and one subtracted from the other. Sources are detected on the difference image, basic photometry is performed on the sources, and \ippstage{diff} catalog files are created.  The \ippstage{diff} catalog files are then ingested into the \ippstage{diff} DVO, and later ingested into the PSPS.  
The results from this stage of processing include diff catalog files, which will be available in a future release (nominally DR3). The diff images can be reconstructed from available data products hosted at STScI, but at this time we anticipate they will not be stored there due to space constraints.

\subsection{DVO Database Steps}
\label{sec:DVOdatabase}

%\subsubsection{Building and calibrating a DVO Database}
%\label{sec:buildingdvo}

%{\color{red} this needs a high level description of what DVO is }

The Desktop Virtual Observatory \citep[DVO][]{Magnier2017c,Magnier2004} is a database that tracks the measurements of astronomical sources detected in the various types of images and associates them into unique astronomical objects based on positional coincidence.  This database system also tracks the metadata for each image which provided the measurements.  The DVO database is loaded with a subset of photometric, astrometric, and other information from the catalog FITS files (\smf/\cmf) from various IPP stages.  The DVO database is then used to determine the astrometric and photometric calibrations for all survey images.  These calibrations are in turn used to calculate the average properties of the astronomical objects (see Paper V). 

\showfigure{ipptopsps.tex}

Catalog files from several stages of IPP processing are ingested into the DVO database via the IPP program \ippprog{addstar}.  The relevant stages are \ippstage{camera} (all measurements from the individual exposures), \ippstage{skycal} (measurements from the stacks), and \ippstage{forced warp} (forced photometry and the forced galaxy model fits from the warps).  Difference image catalogs are ingested into the separate diff DVO database. 

Measurements from 2MASS, WISE, and Gaia are also merged into the DVO database; flags within the DVO database, and inherited by the PSPS database, note the presence of data from these surveys. Gaia DR1 \citep{Gaia2016} was released before the Pan-STARRS DR1 was complete, but after all of the object tables were already ingested into the PSPS database.  We used the Gaia DR1 data to recalibrate the DVO object positions, which improved the astrometry significantly. Rather than regenerate the database and start over (with corrected RA and Dec positions), we arranged for the \ippstage{IppToPsps} system to export just the newly calibrated positions along with minimal metadata to link the new coordinates with the existing objects.  See Section~\ref{sec:ipptopsps} on the special table which carries the Gaia DR1 calibration into the $3\pi$ Survey DR1 release.  For the $3\pi$ Survey DR2, the calibration is tied directly to the Gaia DR1 astrometric system (Paper V).  

The DVO databasing system uses a collection of binary FITS tables as the backend.  These files define a spatial partition of the database, divided on lines of constant RA and Dec.  For a given file type, the database contains several thousand such files.  Several categories of DVO files are used by \ippstage{IppToPsps} to populate the PSPS database.  Here we give a short summary of the subset of DVO files that are most relevant for \ippstage{IppToPsps} (see Paper II for more details).

\parheading{.cpt} Object information - each .cpt table has one entry for each object in that region of the sky. It summarizes the average properties of that object as long as those properties can be derived independently of the filter used. Information such as mean RA and Dec are listed in these files.  

\parheading{.cpm} Measurements - each .cpm table contains all of the measurement information for each object in the .cpt file. Contains measurement information for detections from the stack/skycal cmf, camera smfs, and forced warp smfs.

\parheading{.cps} Mean properties - the .cps table has filter-dependent average property information for each object listed in the .cpt file.  Information such as mean magnitudes are located in these files.

\parheading{.cpx} Lensing measurements - the .cpx files contains lensing parameters measured from all the forced warp cmfs. 

\parheading{.cpy} Lensing Objects - the .cpy table has one entry per filter for each object in that region of the sky, same object ids as for objects in the .cpt file. It summarizes the average properties of the lensing measurements.  

\parheading{.cpq} Forced Galaxy - the .cpq table has one entry per filter for each object in that region of the sky, same object ids as for objects in the .cpt files. It summarizes the extended source galaxy shape measurements.

%query to get the numbers
%select count(*), stage from mergeDVOdbRun join minidvodbRun using (minidvodb_id) join addRun using (minidvodb_group, minidvodb_name) where mergedvodb = 'LAP.PV3.MERGE' group by stage;

%ffw exp number select count(*) from fullForceRun join fullForceInput using (ff_id)  where label = 'LAP.PV3.20140730.ff01' group by warp_id; 
% select count(*) from fullForceRun join fullForceInput using (ff_id) join  fullForceResult using (ff_id, warp_id)  where label = 'LAP.PV3.20140730.ff01' and quality = 0 group by warp_id;

%skycell counts

%ffg numbers
%select count(*) , label from minidvodbRun join addRun using (minidvodb_group, minidvodb_name ) where label like '%ffg' group by label;


%specific 3$\pi$ calibration steps
%know missing data

%\subsubsection{Building the 3$\pi$ Diff Database}
%\label{sec:building3pidiff}

%The 3$\pi$ diff database has not been built yet.
%specific 3$\pi$ \ippstage{diff} steps
%known missing data

%\subsubsection{Building the MD Databases}

%The MD databases have not yet been built, details will be included in \citet{Huber2017}.

\showfigure{ODM_data_flow.tex}

\subsection{IppToPsps Steps} 
\label{sec:ipptopsps}

The DVO database contains the calculated astrometric and photometric calibrations and average properties of the astronomical objects, but only a subset of the information recorded by the IPP in the output catalog files.   It is therefore necessary, when building the PSPS database, to combine the calibrations from the DVO database with the full set of data from the individual \smf\ and \cmf\ catalog files.  It is also necessary to extract the average quantities from the DVO database to be uploaded to the PSPS database.  The \ippstage{IppToPsps} system is responsible for both of these actions.  

The \ippstage{IppToPsps} extracts the average properties from the DVO database in units of the DVO sky partition files and generates file sets called ``batches'' containing the information formatted according to the PSPS schema.  The \ippstage{IppToPsps} generates average property batches separately for measurements from individual exposures, difference exposures, and exposures measured at the \ippstage{forced warp} stage.  In addition, for the $3\pi$ Survey DR1, mean property batches are generated for the astrometry tied to the Gaia DR1 catalogue \citep{Gaia2016}.  

The \ippstage{IppToPsps} system also extracts calibration information and calibrated measurements for the \ippstage{camera}, \ippstage{stack}, \ippstage{forced warp}, and \ippstage{difference} stages and combines those values with the raw measurements stored in the \smf/\cmf\ files.  Batch files are generated for the \ippstage{camera} stage data for each exposure.  For data from the other three stages, batches are generated for individual skycells.  In the case of the \ippstage{stack} data, the batch contains data for the stack images from all 5 filters.  For the \ippstage{forced warp} stage, the batch contains data from all warp epochs for a given skycell.  

The batches generated by the \ippstage{IppToPsps} are made available to the PSPS ingest system using an internal web-based interface called a 'datastore'.  The \ippstage{IppToPsps} software is written in python/jython, using the STILTS library \citep{Taylor2006} to interact with the FITS tables.  \ippstage{IppToPsps} also uses as MySQL database to track the processing and for temporary scratch databases.  This process also queries the IPP processing database, retrieves files from the IPP cluster, and reads data from the DVO database. 

Below we provide additional details on the different batch types generated by the \ippstage{IppToPsps} system.  
An overview of the different batch types and associated DVO files and smf/cmf files is shown in the flowchart in Figure~\ref{fig:ipptopsps}.

\parheading{Init batch (IN)} Defines elements of the PSPS database structure and is the first to be ingested into PSPS.  It includes the system metadata tables described in Section~\ref{sec:schemameta}, with flag bits listed in Appendix~\ref{sec:FlagTables}.  

\parheading{Object batches (OB)} Populate the \ippdbtable{ObjectThin} and \ippdbtable{MeanObject} tables, described in more detail in Section~\ref{sec:schemaobject}.  Each batch represents individual DVO files which are subdivided into small rectangular patches of sky. Columns are filled from the DVO database ({\em cpt} and {\em cps} files).

\parheading{Detection batches (P2)} Populate the \ippdbtable{Detection} tables, described in more detail in Section~\ref{sec:schemap2}.  Each batch corresponds to a single exposure from \PS.  Columns within are filled from the DVO database ({\em cpt} and {\em cpm} files) as well as the \ippstage{camera} stage catalog file (\smf).  

\parheading{Stack batches (ST)} Populate the \ippdbtable{stack} tables, described in more detail in Section~\ref{sec:schemast}.  Each batch corresponds to a skycell from the \ippstage{skycal} stage.  Columns are filled from the DVO database ({\em cpt} and {\em cpm} files ) as well as from the corresponding \ippstage{skycal} catalog files (\cmf) for all 5 filters (or what is available).

\parheading{Forced mean object batches (FO)} Populate the \ippdbtable{ForcedMeanObject} and \ippdbtable{ForcedMeanLensing} tables, described in more detail in Section~\ref{sec:schemaobject}.  Each batch contains data from individual DVO files ({\em cpt}, {\em cps}, {\em cpy}).  

\parheading{Forced galaxy batches (FG)} Populate the \ippdbtable{ForcedGalaxyShape} table, described in more detail in Section~\ref{sec:schemaobject}.  Each batch contains data from individual DVO files ({\em cpt}, {\em cps}, {\em cpq}).

\parheading{Forced warp batches (FW)} Populate the \ippdbtable{ForcedWarp*} tables, described in more detail in Section~\ref{sec:schemafw}.  Each batch corresponds to a different skycell, and contains all of the \ippstage{forced warp} catalog measurements for that skycell.  Each batch contains data from individual DVO files ({\em cpt}, {\em cps}, {\em cpx}) as well as from the corresponding \ippstage{forced warp} catalog files (\cmf). 

\parheading{Diff object batches (DO)} Populate the \ippdbtable{DiffDetObject} table, described in more detail in Section~\ref{sec:schemaobject}.  Columns are filled from the DVO \ippstage{diff} database ({\em cpt} and {\em cps} files). 
 
\parheading{Diff detection batches (DF)} Populate the \ippdbtable{DiffDetection} table, described in more detail in Section~\ref{sec:schemadiff}.  Each batch corresponds to a difference image catalog file created in the \ippstage{diff} stage, and contains all of the skycells for a given exposure.  Columns are filled from the DVO database ({\em cpt} and {\em cpm} files), and from the corresponding \ippstage{diff} catalog file (\cmf). 

\parheading{Gaia object batches (GO)} Populate the \ippdbtable{GaiaFrameCoordinate} table, linking the Gaia DR1 calibrated positions to the \ippdbtable{ObjectThin} entries by \ippdbcolumn{objID}.  It is based on exactly the same DVO files as OB batches, has updated RA and Dec calibrated to Gaia, and ignores the rest of the DVO columns.  These batches, and this table, are only present for DR1.  For DR2, additional calibration improvements were made within the DVO database (see Paper V).  The average property batches were regenerated, making the GO batch irrelevant for that release.

Within \ippstage{IppToPsps} it is possible to verify that the expected batches were generated, and to re-queue and regenerate batches that failed.  Batches fail for a variety of reasons, but none of the failures are terminal.  Batches can fail if any of the associated {\em mysql} databases time out or are unavailable, if there are disk or network I/O glitches or other disk/network problems.  The DVO database sets the expected number of batches to generate, and failures are investigated and retried until they are resolved. Within \ippstage{IppToPsps} it is also possible to poll the PSPS to verify if batches have been ingested, thus closing the loop.  %This allows for easy removal of batches that have been loaded to PSPS in order to regain disk space. 

%\subsection{Ingest into PSPS}
%\label{sec:PSPS}

%\noindent We present an overview of the PSPS, first so that the user understands better how the PSPS database is constructed in order to optimize the queries, and secondly to describe the currently known issues within the PSPS database.

\section{PSPS}
\label{sec:overviewpsps}
\label{sec:PSPS}

% We present an overview of the Published Science Products Subsystem (PSPS), both to help users understand better how the PSPS database is constructed in order to optimize the queries, and to describe the currently known issues within the PSPS database.

\showfigure{ODM_data_layout.tex}

%\subsection{Introduction}

The PSPS consists of several parts: the data transformation layer (DXLayer), the Object Database Manager (ODM), the Workflow Manager Database (WMD), and the data retrieval layer (DRL).  The user accesses the data through the DRL, using either scripts, the STScI CasJobs interface, or if the user is a \PS\ Consortium member, the Published Science Interface (PSI). The DXLayer polls the \ippstage{IppToPsps} datastores for new batches and prepares them for loading.  The ODM is the software used to load, merge, copy and publish the PSPS databases.  The WMD is the database containing all the logs about the PSPS databases.  The DRL is the intermediate layer between the client and the PSPS database.  The PSI is the web based interface for PS1 consortium members, for interacting with the DRL. Each of these components is described in more detail below, and a diagram of the process is shown in Fig~\ref{fig:odm_data_flow}

% \showfigure{pspsslices.tex}

\subsection{Partitioning the PSPS} The PSPS uses Distributed Partitioned Views, a mechanism that allows tables to be partitioned into files which reside on different linked servers. For the PSPS, the largest tables are partitioned into ``slices'' which divide the sky into declination bands.  The database tables exposed to the end users (e.g., \ippdbtable{Detection}, \ippdbtable{ForcedWarpMeasurement}, etc.) are composed of views combining the distributed slices.  This aspect of the database design is intended to be transparent to the user but power users may find it useful to know how the slices are subdivided.  The dividing declination cuts are defined to ensure each slice contains a similar amount of data, with the constraint that no slice span less than a full camera footprint (3.3\degree) due to the loading implementation. Partition slices are customized for each database version (e.g., $3\pi$ DR1, DR2 vs MD).  Figure~\ref{fig:odm_data_layout} shows how the data is partitioned across a subset of the machines. For the $3\pi$ Survey, the PSPS database is partitioned into 32 slices.  Table~\ref{table:pspsslices} lists the names of the slices and the declination ranges for each slice for the $3\pi$ Survey.  

\subsection{Loading data into PSPS}

The process of loading data into the PSPS is split into several stages in order to manage the large data volume, to ensure data integrity, and to allow portions of the database to be exposed to internal users for testing while loading proceeds.  A top-level outline of the process is as follows.  First, the PSPS DXLayer retrieves the batch files, generated by the \ippstage{IppToPsps} system, from the IPP datastore interface.  These batch files are loaded into an initial set of database machines (the Load/Merge Nodes, see Figure~\ref{fig:odm_data_layout}).  As batches are loaded, they populate a temporary set of tables which grow as more batches are added.  When enough batches have been loaded, these temporary tables are merged into the corresponding tables in the first instance of the PSPS database (see Figure~\ref{fig:psps_mergecriteria}).  This initial instance, called the Cold database, naturally changes on a regular basis as more data is added.  When the PSPS team is ready to expose the database to end users, the Cold database is copied to one of the two database instances exposed to end users.  In this period, the database which is the target of the copy cannot be queried, but users may continue to query the other database while the copy proceeds.  When the copy is complete, the newly copied version is 'flipped' with the active query database, and a second copy is performed.  Now the end users are able to query the updated database while the second copy is made.  After the copies are completed, one of the two user-end databases is used for short-lived queries (the Hot database) while the other is used for long-runing queries (the Warm database).  Below, we discuss in more detail the PSPS components involved in various loading stages as well as those used for the user query operations.

% Figure~\ref{fig:pspsslices} shows the different database slices, and Table~\ref{table:pspsslices} describes the names of the slices and the declination ranges for each slice.  

\subsection{The Data Transformation Layer (DXLayer)} The DXLayer is the first stage in the PSPS to receive data from \ippstage{IppToPsps}. This stage polls the IPP datastore interface for new batches to load and prepares them for the next step (ODM). Fig~\ref{fig:dxlayerprocess} shows the flowchart of the DXLayer process, and Fig~\ref{fig:psps_loadprocess} shows a more detailed flowchart of how batches are loaded and verified within the DXLayer and ODM. PSPS loads batches created by the \ippstage{IppToPsps} (Section~\ref{sec:ipptopsps}).  Batches contain a manifest file that describes the batch information such as type of batch, min/max \ippdbcolumn{objID}, MD5 checksum, and the tables to load. Batch data is stored in FITS files, which are transformed into comma-separated value (csv) files in the DXLayer. As noted above, the batch area cannot exceed two PSPS slices or it will fail to load.  The PSPS slices are constructed so that this does not happen.

\input{pspsslicetable.tex}

\showfigure{dxlayerprocess.tex}
 
\subsection{The Object Data Manager (ODM)}  The ODM is the software system which oversees the steps of the loading process described above. The nodes within the ODM have naming conventions for their roles: load/merge (lm), slice (s), head (h) and admin (a).  The ODM processes represent each of the steps described above: load, merge, copy, flip.  All logs, processes, and requests are inserted into an administration database called the Workflow Manager Database (WMD).  Databases are named by the roles defined above: Load, Cold, Warm, Hot.  These databases use the MS-SQL Server engine and are divided into four volumes with 96 file partitions each.  While the large data tables are distributed across multiple ``slice'' machines, the smaller tables (the metadata tables,  \ippdbtable{ObjectThin}, \ippdbtable{GaiaFrameCoordinate}, and \ippdbtable{StackObjectThin}) are stored on a single ``head'' machine for faster queries.

\showfigure{psps_loadprocess.tex}

\subsection{The Data Retrieval Layer (DRL)} The DRL is the layer between the user and the PSPS database.  The DRL is responsible for management of queries that the user submits via the DRL API.  The DRL is based on CasJobs \citep{Szalay2007}, and has many similar features. It primarily keeps track of all user queries and provides progress updates of those queries in a secure way. It also kills queries that use too many resources or take too long. The DRL API is accessed via Simple Access Object Protocol (SOAP), allowing users multiple ways to access the database.  Before the public releases, Pan-STARRS science consortium members used the Published Science Interface (PSI, a web-based user interface) initially based at the IfA and later at STScI.  For the general public, the MAST server provides access via the CasJobs interface (\url{https://mastweb.stsci.edu/ps1casjobs/}), as well as a simple object search form which implements a basic cone search (\url{https://catalogs.mast.stsci.edu/panstarrs}).  It is also possible for the consortium users to query the database via SOAP calls from command line scripts.  

%A flowchart of the DRL can be seen in Figure~\ref{fig:psps_drl}.
% EAM : note sure this figure adds much

% \note{can non-consortium users query the MAST version via SOAP?} :
% Bernie says 'no'

\subsection{Published Science Interface (PSI)} The PSI is the web user interface provided to the Pan-STARRS Science Consortium members. This interface provides many useful features including a query request page, information on query progress, MyDB management tools, graphing tools, access to the pixel data products, and interactive help.  The query request page allows for the user to easily submit queries to a variety of databases (3pi/MD/MyDB), to upload query files or to check the syntax, to name MyDB results tables and to select the queue to submit to. The MyDB management tools allow the user to easily select which MyDB tables to purge as well as well as methods to extract to csv, FITS or xml files to download.  Some of the interactive features include an interactive schema browser, a query builder to easily create a query with multiple joins and conditions, and a flag generator to create bitmasks for the different types of flag tables. 
% SC: consider removing most of the PSI content.  The last sentence mostly replicates previous content.

% \note{figures psps\_merging and psps\_index do not add much information.  it might be worth adding a paragraph to replace the text in these figures}

% \showfigure{psps_merging.tex}
%\showfigure{psps_index.tex}
%\showfigure{psps_drl.tex}
%\showfigure{psps_copy.tex}
\showfigure{psps_mergecriteria.tex}


%\subsubsection{Verification of Ingest into PSPS}
%\label{sec:verifypsps}
%{\color{red} write some generic words here}

\section{Overview of the PSPS Database Schema}
\label{sec:schemaintro}

Table~\ref{table:pspstables} lists the 51 different database tables that make up the PSPS schema. Here we give a brief overview of the tables and indexes, to help aid the user in selecting the most appropriate table for queries. 

The database has a unique \ippdbcolumn{objID} for each object detected
within \PS\ data. An object is defined to be a source which has
measurable flux at a given R.A. and Dec. In general, multiple
detections of an object will all share the same \ippdbcolumn{objID}, as
well as multiple detections within 1\arcsec\ of that object (which
might not be physically associated with that object, for example,
blended sources). A detailed description of the source deblending
algorithm and its properties is beyond the scope of this work (see
Paper IV). This \ippdbcolumn{objID} is the core index used to join the
object and detection tables in order to select detections associated
with a given object.  For example, \ippdbtable{ObjectThin} has the
astrometric information for the objects; one would join against the
\ippdbtable{Detection} table, using \ippdbcolumn{objID}, in order to get the
individual photometric attributes for all the detections of that
object within the single exposures (at a given RA and Dec).

% \subsection{\ippdbcolumn{objID} and its relation to R.A. and Dec.} 
\label{sec:schemaobjid}

The index \ippdbcolumn{objID} (and \ippdbcolumn{diffObjID} for difference
tables) is derived from right ascension and declination.  While it is
possible to calculate the RA and Dec from the \ippdbcolumn{objID}, this is
not recommended. The \ippdbcolumn{objID} value is determined when an object
is initially instantiated in the DVO database, and is based on the
initial astrometric solutions from individual exposures and
\ippstage{stacks} as they are ingested into the DVO database.  These
values are not calibrated against 2MASS or Gaia, nor are they
authoritative.  Since DR1 and DR2 use the same initial DVO database
ingestion, the \ippdbcolumn{objID} values are the same for the same object
between the two releases.
%
%  It is recommended to use \ippdbcolumn{raMean}, \ippdbcolumn{decMean} from
% \ippdbtable{ObjectThin} or (for DR1 only) \ippdbcolumn{ra}, \ippdbcolumn{dec} from
% \ippdbtable{GaiaFrameCoordinate}.  For DR1, \ippdbtable{ObjectThin} is calibrated
% against 2MASS, and \ippdbtable{GaiaFrameCoordinate} is calibrated against
% Gaia.  For DR2 and beyond, \ippdbtable{ObjectThin} is calibrated against
% 2MASS and Gaia, and there is no \ippdbtable{GaiaFrameCoordinate} as the
% Gaia-calibrated coordinates are included in \ippdbtable{ObjectThin}.
%
Included below is the C code for the translation between R.A. and Dec.
See also Figure~\ref{fig:objiddef}.

\vskip 0.5cm
{\small
\begin{verbatim}
uint64_t CreatePSPSObjectID(double ra, double dec) {
    double zh = 0.0083333;
    double zid = (dec + 90.) / zh;
      // zid : 0 - 180*60*2 = 21600 (< 15 bits)
    int izone = (int) floor(zid);
    double zresid = zid - (float) izone;    
      // zresid : 0.0 - 1.0

    uint64_t part1, part2, part3;
    part1 = (uint64_t)( izone  * 10000000000000LL) ; 
    part2 = ((uint64_t)(ra * 1000000.)) * 10000 ; 
      // part2 : 0 - 360*1e6 = 3.6e8 (< 29 bits)
    part3 = (int) (zresid * 10000.0) ; 
      // part3 : 0 - 10000 
      // (1 bit == 30/10000 arcsec) (< 14 bits)

    return part1 + part2 + part3;
}
\end{verbatim}
}

% Aren't MEAN objects defined by grouping detections?
\subsection{The Main Categories of Tables}
\label{sec:schemacategories}

% \note{'Detection tables' as a class is confusing with the Detection table in the db schema: replace with Measurement?}

There are 4 main types of tables within the PSPS database:
\textit{\bf Fundamental Data Product} tables can be categorized into
either \ippdbtable{Object} tables (Section~\ref{sec:schemaobject}) or
\ippdbtable{Detection} tables (Section~\ref{sec:schemadetections}).
\ippdbtable{Object} tables contain summary information for each source in
the sky, including the mean photometric and astrometric information.
\ippdbtable{Detection} tables contain photometric and astrometric
measurements from individual exposures (\ippdbtable{Detection}), stacked
images (\ippdbtable{Stack*} tables), warp images (\ippdbtable{forcedWarp*} tables),
or difference images.  The description of the \ippdbtable{Detection}
tables below is organized by these processing stages (see also
Section~\ref{sec:processingstages}). \textit{\bf Observational Metadata} tables
(Section~\ref{sec:schemadetections}), contain information about the
individual exposures and other image types and provide links to map
from images to measurements.  \textit{\bf Derived Data Products} (e.g.,
photo-z measurements) will be incorporated into the PSPS database in
the future and are not described in this paper. \textit{\bf System
  Metadata} tables (Section~\ref{sec:schemameta}) contain hardwired
information about the PSPS, including tables describing flags,
filters, tessellations and other fixed system-level quantitites.
 
%  that contain forced photometry of sources on individual exposures at the locations of the sources detected on stacked images

% Fundamental Data Product tables, Observational Metadata tables, Derived Data Product tables, and System Metadata tables (see also Section~\ref{sec:overview}). 
 
% This section will start by briefly describing the System Metadata tables (Section~\ref{sec:schemameta}), followed by Object tables (Section~\ref{sec:schemaobject}). The Detection tables (Section~\ref{sec:schemadetections}) are organized by stage of IPP processing for both Fundamental Data Product tables and Observational Metadata tables. 

 %For this section, there will be a brief discussion of 
%3 of the different categories of the tables, followed by the table descriptions and indexes. 

\showfigure{dataproductimages.tex}
\showfigure{imageid.tex}

% EAM I am not sure this table adds any useful information not in Table 1
%\input{observationalmetadata.tex}

% EAM I am not sure this table adds any useful information not in Table 1
% \input{systemmetadata.tex}

\subsection{System Metadata Tables}
\label{sec:schemameta}

%\noindent There are several types of metadata tables, primarily they fall into one of two categories.  There are metadata tables that provide additional general information about \PS\ (specifically, filters, flags, etc.) this is called system metadata, and metadata tables that provide specific information about images, stacks, difference images, and forced warp (example, \ippdbtable{ImageMeta}, \ippdbtable{StackMeta}, etc.), these are called observational metadata.  

The system metadata tables primarily contain static information of flags, filters, surveys and other information that is specific to \PS.  Several tables describe the different flag bits used to indicate data quality or to identifies details of how a measurement was made.  These tables are described in Section~\ref{sec:schemaflagsbitmasks}.  The other system metadata tables are described below:

% and would be the same for the Medium Deep catalogs as well.  

% : \ippdbtable{ImageFlags}, \ippdbtable{DetectionFlags}, \ippdbtable{DetectionFlags2}, \ippdbtable{DetectionFlags3}, \ippdbtable{ObjectInfoFlags}, \ippdbtable{ObjectFilterFlags}, \ippdbtable{ObjectQualityFlags}, and \ippdbtable{ForcedGalaxyShapeFlags}. % Use the \ippdbtable{FlagGenerator} to create a bitmask or create your own bitmask to filter out entries based on flags.  

\parheading{Filter} Provides database indexes for the optical filters used in the survey \citep{Tonry2012}. Filters (\grizy) are assigned integer values from 1 to 5 (\ippdbcolumn{filterID}).

\parheading{FitModel} Provides database indexes for models used in fitting detections in images, both PSF-like and extended galaxy models including Exponential, \cite{deVaucouleurs1948}, and \cite{Sersic1963} profiles. Describes the values for column \ippdbcolumn{psfModelID} (located in various tables).

\parheading{Survey} Provides database indexes for the various PS1 Science Consortium Surveys. The 3$\pi$ \ippdbcolumn{SurveyID} is 0.

\parheading{PhotoCal} Contains photometric calibration information for each filter and detector image combinations. Defines the values of \ippdbcolumn{photoCalID} within \ippdbtable{ImageMeta}, \ippdbtable{StackMeta}, \ippdbtable{ForcedWarpMeta}, and \ippdbtable{DiffMeta}.

\parheading{StackType} Provides database indexes for the types of stacked images constructed. For 3$\pi$, all \ippstage{stacks} are \texttt{DEEP\_STACK}.  

\parheading{DiffType} Provides database indexes for the types of difference images constructed. For 3$\pi$,  all \ippstage{diffs} are \texttt{WARP\_STACK}, meaning they are constructed by subtracting warps from single exposures from the deep stacks for the corresponding part of sky. 

\parheading{TessellationType} Provides database indexes for the types of image tessellations for the sky. For 3$\pi$, this is \texttt{RINGS.V3}.  Each MD field has its own \ippdbtable{TessellationType} (\texttt{MD01.V3}, \texttt{MD02.V3}, etc.). The RINGS.V3 Tessellations are described in more detail in \citet{Magnier2017a}, and the MD tessellations in \citet{Huber2017}. 

%%%Since I keep asking myself what is the tesellation, here is the query: 
%mysql> select distinct tess_id from stackRun where label like 'LAP.PV3.2014%';
%+----------+
%| tess_id  |
%+----------+
%%| RINGS.V3 | 
%+----------+

%%note that PV2 used CNP.LAP.

\begin{table}
\caption{Flag types within \PS}
\begin{center}
\begin{tabular}{lll}
\hline
\hline
Flag Type &  Size & See in this paper \\
\hline
ObjectInfoFlags        & INT      & Table~\ref{table:objectinfoflags} \\
ObjectQualityFlags     & SMALLINT & Table~\ref{table:objectqualityflags} \\
ObjectFilterFlags      & INT      & Table~\ref{table:objectfilterflags}  \\
ImageFlags             & INT      & Table~\ref{table:imageflags}  \\
ForcedGalaxyShapeFlags & SMALLINT & Table~\ref{table:forcedgalaxyshapeflags}  \\
Detection              & BIGINT   & Table~\ref{table:detectionflags}  \\
Detection2             & INT      & Table~\ref{table:detectionflags2}  \\
Detection3             & INT      & Table~\ref{table:detectionflags3}  \\
\hline
\end{tabular}
\end{center}
\label{table:flagtypetables}
\end{table}%

\begin{table*}
\caption{Flag columns within \PS}
\begin{center}
\begin{tabular}{llll}
\hline
\hline
Table Name  &     Flag Column    &  Size  &   Flag Type \\
\hline
ObjectThin  & objectInfoFlag  &  INT          & ObjectInfoFlags \\
ObjectThin  &  qualityFlag     &   SMALLINT   &   ObjectQualityFlags \\
GaiaFrameCoordinate & gaiaFlag & INT & ObjectInfoFlags \\
MeanObject & (grizy)Flags          & INT  & ObjectFilterFlags \\
ForcedMeanObject & (grizy)Flags & INT & ObjectInfoFlags \\
DiffDetObject & objectInfoFlag & INT & ObjectInfoFlags \\
DiffDetObject & qualityFlag & SMALLINT & ObjectQualityFlags  \\
ImageMeta  & qaFlags       & INT & ImageFlags \\
ForcedGalaxyShape   & (grizy)GalFlags  & SMALLINT & ForcedGalaxyShapeFlags \\
Detection    & infoFlag  & BIGINT   & DetectionFlags \\
Detection    & infoFlag2  & INT   & DetectionFlags2 \\
Detection    & infoFlag3 & INT   & DetectionFlags3 \\
StackObjectThin    & (grizy)infoFlag  & BIGINT   & DetectionFlags \\
StackObjectThin    & (grizy)infoFlag2  & INT   & DetectionFlags2 \\
StackObjectThin    & (grizy)infoFlag3 & INT   & DetectionFlags3 \\
DiffDetection    & DinfoFlag  & BIGINT   & DetectionFlags \\
DiffDetection    & DinfoFlag2  & INT   & DetectionFlags2 \\
DiffDetection    & DinfoFlag3 & INT   & DetectionFlags3 \\
ForcedWarpMeasurement    & FinfoFlag  & BIGINT   & DetectionFlags \\
ForcedWarpMeasurement    & FinfoFlag2  & INT   & DetectionFlags2 \\
ForcedWarpMeasurement    & FinfoFlag3 & INT   & DetectionFlags3 \\
\hline
\end{tabular}
\end{center}
\label{table:flagtablestable}
\end{table*}%


\subsubsection{Flag Tables}
\label{sec:schemaflagsbitmasks}

%{\color{red} needs introduction}

%\subsection{Flags and  Bitmasks}
%\label{sec:schemaflagsbitmasks}

There are 45 flag columns within the \PS\ database schema (e.g.,
Detection.infoFlag), and 8 different types of flags listed below (see
Table~\ref{table:flagtypetables}).  These flag columns use integer
values to represent, e.g., different outcomes of the detection
analysis.  The 8 different types of flags specify the meaning of the
bit values for the flag columns.  This section gives a brief overview
of the 8 different types of flags. Table~\ref{table:flagtablestable}
lists the flag columns in each of the PSPS tables and identifies the
flag type for that column.  Tables~\ref{table:objectinfoflags} -
\ref{table:detectionflags3} list the bit values for each of the flag
types.  These tables are intended to be used as a reference to select
the appropriate flag information tables.

\parheading{ObjectInfoFlags} These flags specify characteristics of
the {\em object} determined during the photometric and astrometric
analysis, or by external analysis or publications.  For example,
several bits specify if the object has been identified as a QSO,
variable, transient, or a known solar system object, if it has large
proper motions, if it is extended, and the source of the average
position information.

\parheading{ObjectQualityFlags} Contains information flag values that denote if an object is real or a possible false positive. This is a subset of flags from \ippdbtable{ObjectInfoFlags}, specifically the ones if the object is extended, has good measurements in individual exposures, and has good measurements in the stacks.  This describes the flags used in \ippdbtable{ObjectThin}.qualityFlag and \ippdbtable{DiffDetObject}.qualityFlag.  
 
\parheading{ObjectFilterFlags} These flags specify the quality of the
photometric calibration for the object and are specified for each of
the 5 filters.  More detail about the meaning of these flag bits
can be found in Paper V.

%% Contains information flags for the photometric calibration of an
%% object (\ippdbtable{MeanObject}.(grizy)Flags). Bits specify if the source was
%% included in the `ubercal' photometric calibration analysis (Paper V),
%% where photometry comes from (single exposures or stacks), information
%% about synthetic photometry, and how the average magnitude was
%% calculated.

\parheading{ImageFlags} Primarily denotes the quality of the
photometric and astrometric calibration of the chip image (e.g.,
whether the image is bad or if there are too few measurements).

\parheading{ForcedGalaxyShapeFlags} Contains information flag values
that define ForcedGalaxyShape chi-squared surface fit failures.

\parheading{DetectionFlags} These flag bits are generated in the
pixel-level source analysis software and include information about the
quality of the detection.  Bits include, e.g., if the detection is
blended, used for PSF model, saturated, and many other types of
defects, as well as information on types of magnitudes calculated, if
it is extended, and fit information.  See also Paper IV.

\parheading{DetectionFlags2} Like the previous set of flags, these
flags contain information about the pixel-level analysis of the
detection.  These bits include information specific to difference
imaging, as well as quality issues such as if source is near
diffraction spikes, star core, affected by the `burntool' analysis of
persistence features (see Paper III), along with other analysis
issues.  See also Paper IV.

\parheading{DetectionFlags3} These flag bits are generated by the
photometric and astrometric calibration analysis.  They include bits
to specify, e.g., if the detection was used in the analysis of the
mean astrometric or photometric properties of the object.

%\subsubsection{Examples of useful bitmasks}
%\label{sec:schemaflagexamples}


%\subsubsection{Known Issues}
%\label{sec:schemaflagissues}

% \ippdbtable{DetectionFlags} is currently a type \texttt{BIGINT}, however should be an \texttt{INT}.  Applying a bitmask will work the same as for the other flag table types.  If in the future there is a flag column with a type of \texttt{BIGINT}, i.e. through additional database tables or views, the bit mask will need to be recast as a \texttt{BIGINT}.
% \newpage
\subsection{Object-type tables}
\label{sec:schemaobject}

The object-type tables originate from the DVO database, specifically, the DVO tables that have information about objects, their mean astrometric and photometric properties and information such as the number of detections per objects and other statistics and information.  The object-type tables form the equivalent of a telephone book for all of the objects, with \ippdbcolumn{objID} being the equivalent of the phone number or social security number.  A key defining feature is that \ippdbcolumn{objID} is unique in these object-type tables, there are no instances of 2 objects with the same \ippdbcolumn{objID} in the same object-type table. If an object is not in these tables, it has not been detected in any of the stages of processing.  What follows is a description of each of the object-type tables, for DR1 and beyond.
 
% The object type tables are \ippdbtable{ObjectThin}, \ippdbtable{MeanObject}, \ippdbtable{DiffDetObject}, \ippdbtable{ForcedMeanObject}, \ippdbtable{ForcedMeanLensing}, \ippdbtable{ForcedGalaxyShape} and \ippdbtable{GaiaFrameCoordinate}.  For DR1, the available tables are \ippdbtable{ObjectThin}, \ippdbtable{MeanObject}, \ippdbtable{ForcedMeanObject}, \ippdbtable{ForcedMeanLensing}, and \ippdbtable{GaiaFrameCoordinate}. 

\parheading{ObjectThin} Contains the positional information for
objects in a number of coordinate systems. The objects associate
single epoch detections and the stacked detections within a one
arcsecond radius. The mean position from all the available single
epoch data is used as the basis for coordinates when available, or the
mean position over each filter of an object in the \ippstage{stack} when it
is not. The right ascension and declination for both the \ippstage{stack}
and single epoch mean is provided. The number of detections in each
filter from single epoch data is listed, along with which filters the
object has a \ippstage{stack} detection \citep[see][]{Szalay2007}. Use
\ippdbcolumn{objID} to join to most tables; \ippdbtable{uniquePspsOBid} to join to
       \ippdbtable{MeanObject}.  For DR1 only, the Gaia-calibrated positions
       were calculated after \ippdbtable{ObjectThin} was populated, they are
       provided in \ippdbtable{GaiaFrameCoordinate}.  For DR2 and beyond,
       there is no \ippdbtable{GaiaFrameCoordinate} table, as \ippdbtable{ObjectThin} has
       be re-calibrated and has the Gaia-calibrated positions.

\parheading{MeanObject} Contains the mean photometric information for
objects based on the single epoch data, calculated as described in
Paper V. To be included in this table, an object must be bright enough
to have been detected at least once in an individual exposure. PSF,
\citet{Kron1980}, and total aperture-based magnitudes and statistics
are listed for all filters in a single row. The apertures are defined
to match (in arcseconds) those used by SDSS \citep[see Table 7
  in][]{Stoughton2002}.  Use \ippdbcolumn{objID} to join to most tables;
\ippdbtable{uniquePspsOBid} to join to \ippdbtable{MeanObject}.  Average values are
determined using outlier rejection based on the iteratively-reweighted
least squares technique in which measurements are averaged with
weights determined by their individual errors combined with a
weighting factor depending on their deviation from the previously
calculated average value (see Paper IV for a full description).

%WHY STOUGHTON 2002? ISNT THIS JUST THE REFERENCE TO THE SDSS RASDIAL APERTURES? - NM 6 Dec 2018 
% Stoughton et al 2002 is the SDSS early data release and it lists the aperture sizes.

%QUESTION - ARE THESE MEANS WEIGHTED MEANS OR CLIPPED MEANS OR WHAT? - NM 6 Dec 2018
% HAF I need help here :
% EAM : updated text

\parheading{GaiaFrameCoordinate} This table, only available in DR1,
contains PSPS objects re-calibrated against Gaia DR1 astrometry.  The
coordinates in this table are the best ones to use for DR1.  For the
DR2 version of the database, the astrometry was recalibrated against
Gaia DR1; the coordinates reported in the \ippdbtable{ObjectThin} table should be
used as the best RA and Dec.  Use \ippdbcolumn{objID} to join to most
tables.

\subsection{Individual Exposure Detection Type Tables}
\label{sec:schemadetections}

The majority of the data in the database is in the form of detection-type tables.  These are tables that are based on individual stages of processing from the IPP. Specifically, these are tables from the catalog outputs of \ippstage{camera}, \ippstage{stack}, \ippstage{forced photometry} and \ippstage{diff} stages of the IPP. Each of these categories of tables are described below.  

Note that for these tables, if it has an \ippdbcolumn{objID} column, \ippdbcolumn{objID} will not necessarily be unique as each measurement of the same object on different images will have the same \ippdbcolumn{objID}. If doing joins between tables from the same stage, use the appropriate \ippdbcolumn{uniquePspsXXid}. For example, to join between \ippdbtable{StackObjectThin} and \ippdbtable{StackApFlx}, use \ippdbcolumn{uniquePspsSTid}.
 
%There are several metadata tables specific to different stages of data ingested (i.e., metadata for individual exposures, \ippstage{stacked} skycells, \ippstage{difference} skycells, \ippstage{forced warp} skycells).  Basic information about indivudual exposures, \ippstage{stack} skycells, \ippstage{difference} skycells, such as the filter, exposure time, observation time, basic metrics, etc. can be found in these tables: \ippdbtable{DiffMeta}, \ippdbtable{ForcedWarpMeta}, \ippdbtable{StackMeta}, \ippdbtable{ImageMeta}. The metadata tables linking \ippstage{stacks}/\ippstage{diffs}/\ippstage{forcedwarps} to individual exposures are \ippdbtable{DiffToImage}, \ippdbtable{ForcedWarpToImage}, \ippdbtable{StackToImage}, and \ippdbtable{StackToFrame}.  There is metadata available on the detection efficiency for difference images and single exposures in \ippdbtable{DiffDetEffMeta} and \ippdbtable{ImageDetEffMeta}. \ippdbtable{ImageMeta} has metadata for a single exposure, while \ippdbtable{FrameMeta} has metadata for each of the 60 OTAs that make up an image. Further information about these tables are described in sections below.

\subsubsection{Tables based on the `camera' stage of IPP}
\label{sec:schemap2}

Images processed through the \ippstage{camera} stage of the IPP have been detrended, and have had astrometry and photometry calculated.  Basic information from the images are then merged into the DVO database.  The core tables based on the \ippstage{camera} stage are \ippdbtable{FrameMeta}, \ippdbtable{ImageMeta}, \ippdbtable{Detection}, and \ippdbtable{ImageDetEffMeta}. Each image ingested into the PSPS database has a unique \ippdbcolumn{imageID}; this can be used to find out, via the \ippdbtable{FrameMeta}, \ippdbtable{ImageMeta}, and \ippdbtable{ImageDetEffMeta} tables, information about each image such as the filter, RA and Dec, exposure time, etc.  All of the detections measured in the image are ingested into the Detection table, which also has the \ippdbcolumn{imageID}, allowing for single detections to be traced back to the OTA on which it was imaged.  

\parheading{FrameMeta} Contains metadata related to an individual exposure. A {\em Frame} refers to the collection of all images obtained by the 60 OTA devices in the camera in a single exposure. The camera configuration, telescope pointing, observation time, and astrometric solution from the detector focal plane (L,M) to the sky (RA,Dec) is provided.

\parheading{ImageMeta} Contains metadata related to an individual OTA (chip) image that comprises a portion of the full exposure. The characterization of the image quality, the detrends applied, and the astrometric solution from the raw pixels (X,Y) to the detector focal plane (L,M) is provided.

\parheading{Detection} Contains single epoch photometry of individual detections from a single exposure. The identifiers connecting the detection back to the original image and to the object association are provided. PSF, aperture, and \citet{Kron1980} photometry are included, along with sky and detector coordinate positions. Use \ippdbcolumn{objID} to join to other tables with photometry/astrometry parameters. Note that \ippdbcolumn{objID} is not unique.

\parheading{ImageDetEffMeta} Contains the detection efficiency information for a given individual OTA image. Provides the number of recovered sources out of 500 injected fake source and statistics about the magnitudes of the recovered sources for a range of magnitude offsets.

\subsubsection{Tables based on the `stack' stage of IPP}
\label{sec:schemast}

There are 15 tables based on the \ippstage{stack} stage of processing.
Several groups of these tables share a common schema, but are based on
different convolutions of the stack images or use different
extended-source models. The basic table is
\ippdbtable{StackObjectThin} which contains the positional and
photometric information for point-source photometry of stack
detections. The other stack tables provide additional measurements for
the objects listed in \ippdbtable{StackObjectThin}.  There are several
stack metadata tables, they are \ippdbtable{StackMeta},
\ippdbtable{StackToImage}, \ippdbtable{StackToFrame} and
\ippdbtable{StackDetEffMeta}.  They provide general information about
the stack and can be used to find out the exposures used in the stack.

Joins between any of the stack tables, except for the stack meta
tables, should use \ippdbcolumn{uniquePspsSTID}.

Due to overlaps in the stack tessellations, an object may appear in
multiple stack images.  Since neighboring stack images contain nearly
the same input exposures, these measurements are not statistically
independent.  Only one set of such measurements should be used for
valid population statistics.  To aid in such analysis, we define a
`primary' detection for all stack measurements (from a single filter)
of the same astronomical object.  The `primary' detection is that
detection for which the stack pixels are closest to the center of the
skycell. Since the definition is purely geometric, in theory no
portion of the sky can contribute more than a single stack detection.
In practice, the photometric analysis of sources will occasionally
split a source into multiple detections within the image.  For the
primary skycells, these detections will each be identified as
`primary', though they come from the same astrophysical object.
However, this is due to the analysis process, not the overlap of the
stack boundaries.

Although the primary and secondary detections in general are derived
from the same input pixels, differences can occur.  It is possible
that the primary detection of an object (for a particular filter) is
actually more heavily masked than any secondary detections of the same
object.  Users who prefer a high-quality measurement of a particular
object may choose to use these secondary measurements rather than the
primary.  We attempt to identify the `best' stack measurement for each
filter by examining the signal-to-noise of the measurements and the
{\tt PSF\_QF\_PERFECT} values, a measurement of the masked-fraction
for the object (see Paper IV for details of the parameter).

If the primary detection has $\mbox{\tt PSF\_QF\_PERFECT} > 0.95$,
then it is marked as the best.  If multiple such measurements exist
for the object, the highest signal-to-noise measurements is used.  If
not, but a secondary detection has $\mbox{\tt PSF\_QF\_PERFECT} >
0.95$, then the secondary detection with the highest signal-to-noise
is chosen as best.  If neither primary nor secondaries have $\mbox{\tt
  PSF\_QF\_PERFECT} > 0.95$, the primary measurement with the highest
{\tt PSF\_QF\_PERFECT} is selected as the best.  Finally, if no
primary detection exists, the secondary with the highest {\tt
  PSF\_QF\_PERFECT} is selected as the best.

Stack measurements which are the primary measurement have the {\tt
  STACK\_PRIMARY} bit set in the \ipptable{StackObjectThin.XinfoFlag3}
field for the appropriate filter while stack measurements which are
identified as the `best' measurement for an object within a given
filter have the {\tt STACK\_PHOT\_SRC} bit set in the same field (see
Tables~\ref{table:detectionflags3} and \ref{table:StackObjectThin}).

%% If all of the `best' measurements for a stack object (across all 5
%% filters) are also primary measurements, then the {\tt BEST\_STACK} bit
%% is set in the \ipptable{StackObjectThin.XinfoFlag4} for all 5 filters
%% (this field is identical for all filters).

If all of the `best' measurements for a stack object (across all 5
filters) are also primary measurements, then the {\tt BEST\_STACK} bit
is set in the \ipptable{ObjectThin.objInfoFlag} entry for the
corresponding object (see Tables~\ref{table:objectinfoflags} and
\ref{table:ObjectThin}).

Several bits in the \ipptable{StackObjectThin.XinfoFlag4} field for
each filter may be set based on the `primary' and `best' detections
(see Tables~\ref{table:detectionflags3} and
\ref{table:StackObjectThin}).  If a `primary' measurement exists for a
given filter, then the {\tt SECF\_STACK\_PRIMARY} bit is set for that
filter.  If multiple primary stack measurements exist for a given
filter, then the {\tt SECF\_STACK\_PRIMARY\_MULTIPLE} bit is also set for
that filter (not set in DR1).  If the `best' measurement for a filter
is a significant detection (not forced from another band), then the
{\tt SECF\_STACK\_BESTDET} bit is set. If any of the `primary' measurements
for a filter is a significant detection (not forced from another
band), then the {\tt SECF\_STACK\_PRIMDET} bit is set. If any stack
measurements exist for a given filter, then the per-filter bit flag
{\tt SECF\_HAS\_PS1\_STACK} is set.

Users should note that the fields
\ipptable{StackObjectThin.primaryDetection} and
\ipptable{StackObjectThin.bestDetection} are incorrectly set for DR1
and DR2.  A coding error resulted in these bits being set based on the
wrong input fields.  A future update to the tables may be performed to
repair these two fields.

% \ippdbtable{StackObjectAttributes} extends the information from \ippdbtable{StackObjectThin} and it contains the PSF, Kron, and aperture fluxes for all objects.

% StackApFlx contains the fluxes for all sources measured on unconvolved images in 3 SDSS apertures (R5 = 3.00 arcsec, R6 = 4.63 arcsec, R7 = 7.43 arcsec).  (\ippdbtable{StackApFLxExGalUnc}, \ippdbtable{StackApFlxExGalCon6}, \ippdbtable{StackApFlxExGalCon8}) contain fluxes for sources measured on the (unconvolved, convolved to 6 pixels, convovolved to 8 pixels) images in 9 of the SDSS apertures \citep[R3 - R11, see Table 7 in][]{Stoughton2002}, but only for sources not in the Galactic plane. (\ippdbtable{StackModelFitExp}, \ippdbtable{StackModelFitDeV}, \ippdbtable{StackModelFitSer}) contain fit parameters for extended sources for different types of models (Exponential, DeVaucouleurs, Sersic). These are only measured outside the Galactic plane and for objects with S/N$>20$. \ippdbtable{StackPetrosian} contains the magnitudes and radii for extended sources.
%WHERE ARE THE PETROSIANS MEASURED? - NM 6 Dec 2018
% HAF FIXME

\parheading{StackObjectThin} Contains the positional and magnitude
information for PSF, \citet{Kron1980} and total aperture-based
measurements of stack detections.  The information for all filters are
joined into a single row, with metadata indicating if this stack
object represents the primary detection.  In addition, a detection is
flagged as `best' if it is a primary detection with a \ippdbcolumn{psfQf}
value greater than 0.98; if that condition is not met, then the
primary or secondary detection with the highest \ippdbcolumn{psfQf} value
is flagged as best (see Paper V).

\parheading{StackObjectAttributes} Contains the PSF, \citet{Kron1980},
and total aperture-based fluxes for all filters in a single row, along
with point-source object shape parameters. Since the photometry for an
object which is not detected in some filters is forced in those
filters, some fluxes may have negative values.  The magnitudes in
\ippdbtable{StackObjectThin} are derived from this table, where the
flux is positive.

\parheading{StackApFlx} Contains the fluxes within the SDSS R5 ($r =
3.00$ arcsec), R6 ($r = 4.63$ arcsec), and R7 ($r = 7.43$ arcsec)
apertures \citep{Stoughton2002} as measured on the raw (unconvolved)
stack images.  Fluxes within these same apertures are also provided
for images convolved to 6 sky pixels (1.5 arcsec) and 8 sky pixels
(2.0 arcsec).  See Section~\ref{sec:stackstages} for further
information.  All filters are matched into a single row.  These values
are measured for all objects in all stacks.

%\vskip 0.1cm
%\noindent \ippdbtable{StackModelFitExtra} Contains the galaxy shape and concentration parameters measured from the stack detections.  See \ippdbtable{StackObjectThin} table for %discussion of primary, secondary, and best detections.  See \citet{Blakeslee2006,Cheng2011,Schade1995,Simard2011,Simard2002}.

\parheading{StackModelFitExp} Contains the exponential galaxy model
fit parameters (see Section~\ref{sec:forcedphotom} for constraints).   All filters are matched into a single row.  

\parheading{StackModelFitDeV} Contains the \citet{deVaucouleurs1948} fit parameters (see Section~\ref{sec:forcedphotom} for constraints).    All filters are matched into a single row.  

\parheading{StackModelFitSer} Contains the \citet{Sersic1963} fit parameters (see Section~\ref{sec:forcedphotom} for constraints).    All filters are matched into a single row.  

% \note{what constrains these tables to the galactic poles? -- nothing did, see comments below}

\parheading{StackApFlxExGalUnc} Contains the fluxes within the 9 SDSS apertures (see Section~\ref{sec:stackstages}) as measured on the unconvolved stacks.    All filters are matched into a single row.  

% EAM: 2019.09.16 : the galactic plane exclusion was planned, but I can confirm by examination of the PSPS contents that the cut was not applied.
%These measurements are only provided for objects in the extragalactic sky, i.e., they are not provided for objects in the Galactic plane because they are not useful in crowded areas.  

\parheading{StackApFlxExGalCon6} Contains the fluxes within the 9 SDSS apertures (see Section~\ref{sec:stackstages}) images  convolved to a target of 6 sky pixels (1.5 arcsec).   All filters are matched into a single row.  

% These measurements are only provided for objects in the extragalactic sky, i.e., they are not provided for objects in the Galactic plane because they are not useful in crowded areas.  

\parheading{StackApFlxExGalCon8} Contains the fluxes within the 9 SDSS apertures (see Section~\ref{sec:stackstages}) images  convolved to a target of 8 sky pixels (2.0 arcsec).    All filters are matched into a single row.  

% These measurements are only provided for objects in the extragalactic sky, i.e., they are not provided for objects in the Galactic plane because they are not useful in crowded areas.  

\parheading{StackPetrosian} Contains the \citet{Petrosian1976} magnitudes and radii (see Section~\ref{sec:forcedphotom} for constraints).  All filters are matched into a single row.  

\parheading{StackMeta} Contains the metadata describing the stacked image produced from the combination of a set of single epoch exposures.  The nature of the stack is given by the \ippdbcolumn{StackTypeID}.  The astrometric and photometric calibration of the stacked image are listed.

\parheading{StackToImage} Contains the mapping of which input images were used to construct a particular stack.

\parheading{StackToFrame} Contains the mapping of input frames used to construct a particular stack along with processing statistics.

\parheading{StackDetEffMeta} Contains the detection efficiency information for a given stacked image.  Provides the number of recovered sources out of 500 injected sources for each magnitude bin and statistics about the magnitudes of the recovered sources for a range of magnitude offsets.

\subsubsection{Tables from the `forced photometry' stage of IPP}
\label{sec:schemafw}

%  The \ippstage{forced photometry} stage of the IPP uses the positions of detections found on the \ippstage{stacks} as a list of positions to force calculations of photometry on the individual \ippstage{warps} from images.  The \ippstage{warp} images are essentially the detrended images rotated, rebinned, and chopped into skycells.  For a given \ippstage{stack} skycell with a list of detected objects, the corresponding \ippstage{warps} (from individual images) will have their photometry calculated, based on the list of detected objects in the \ippstage{stack} skycell.  More extended photometric calculations are performed in the \ippstage{forced photometry} stage compared to the \ippstage{camera} stage, for example, lensing parameters and extended photometry is calculated for this stage and not for the \ippstage{camera} stage.  Similar to the \ippstage{stack} and \ippstage{camera} stages, the end product of this stage of processing is a catalog file, basic information from the catalog file is ingested into the DVO, and then information from both the DVO and the catalog file are later ingested into the PSPS.  Basic information about each \ippstage{forced warp} skycell can be found in \ippdbtable{ForcedWarpMeta} and a mapping to the individual exposures can be found in \ippdbtable{ForcedWarpToImage}, use \ippdbcolumn{forcedWarpID} and \ippdbcolumn{imageID} to make these joins. Tables with photometric information are in \ippdbtable{ForcedWarpMeasurement} and \ippdbtable{ForcedWarpExtended}.  \ippdbtable{ForcedWarpMasked} allows one to know if there were no unmasked pixels for a specific \ippstage{forced warp} measurement.  

The following tables contain information related to the \ippstage{Forced Warp} analysis stage.  Joins between \ippdbtable{ForcedWarpMeasurement}, \ippdbtable{ForcedWarpMasked}, \ippdbtable{ForcedWarpExtended}, \ippdbtable{ForcedWarpLensing} should use uniquePspsFWid.

\parheading{ForcedMeanObject} Contains the mean of single-epoch
photometric information for sources detected in the stacked data,
calculated as described in Paper IV. The mean is calculated for
detections associated into objects within a one arcsecond correlation
radius. PSF, \citet{Kron1980}, and SDSS \citep{Stoughton2002} aperture
R5 ($r = 3.00$ arcsec), R6 ($r = 4.63$ arcsec), and R7 ($r = 7.43$
arcsec) total aperture-based magnitudes and statistics are listed for
all filters. See also Paper IV.  Use \ippdbcolumn{objID} to join to most
tables, and use \ippdbtable{uniquePspsFOid} to join to \ippdbtable{ForcedMeanLensing}. \ippdbcolumn{objID} is not unique, but
\ippdbcolumn{uniquePspsFOid} is.

% \note{EAM: I do not understand why objID is not unique within the ForcedMeanObject table}

\parheading{ForcedMeanLensing}  Contains the mean \citet{Kaiser1995} lensing parameters measured from the forced photometry of objects detected in stacked images on the individual single epoch data. Use \ippdbcolumn{objID} to join to most tables; use \ippdbcolumn{uniquePspsFOid} to join to \ippdbtable{ForcedMeanObject}. \ippdbcolumn{objID} is not unique, but \ippdbcolumn{uniquePspsFOid} is.

\parheading{ForcedGalaxyShape} 	Contains the extended source galaxy shape parameters. The positions, magnitudes, fluxes, and Sersic indices are inherited from their parent measurement in the \ippdbtable{StackModelFit} tables, and are reproduced here for convenience. The major and minor axes and orientation are recalculated on a warp-by-warp basis from the best fit given these inherited properties \citep{Sersic1963}. Use \ippdbcolumn{objID} to join to most tables. \ippdbcolumn{objID} is not unique, but \ippdbcolumn{uniquePspsFGid} is.

\parheading{ForcedWarpMeta} Contains the metadata related to a sky-aligned distortion corrected \ippstage{warp} image, upon which forced photometry is performed. The astrometric and photometric calibration of the \ippstage{warp} image are listed. 

\parheading{ForcedWarpMeasurement} Contains single epoch forced photometry of individual measurements for each warp image. The identifiers connecting the measurement back to the original exposure and to the object association are provided. PSF,  \citet{Kron1980}, and total aperture-based fluxes are provided, along with positions in both sky and detector coordinates.

\parheading{ForcedWarpMasked} Contains an entry for objects detected in the stacked images which were in the footprint of a single epoch exposure, but for which there are no unmasked warp pixels at that epoch.

\parheading{ForcedWarpExtended} Contains the single epoch forced photometry fluxes within the SDSS R5 ($r = 3.00$ arcsec), R6 ($r = 4.63$ arcsec), and R7 ($r = 7.43$ arcsec) apertures \citep{Stoughton2002} for objects detected in the stacked images. 

\parheading{ForcedWarpLensing} Contains the \citet{Kaiser1995} lensing parameters measured from the forced photometry of objects detected in stacked images on the individual single epoch data. 

\parheading{ForcedWarpToImage} Contains the mapping of which input image comprises a particular \ippstage{warp} image used for forced photometry.

\showfigure{objid.tex}

\subsubsection{Tables based on the `diff' stage of IPP}
\label{sec:schemadiff}

The tables described below relate to the difference image processing.  Each \ippstage{diff} image has a unique \ippdbtable{diffImageId}, and all 4 \ippstage{diff} tables use this to join to each other. 

% The \ippdbtable{DiffMeta}, \ippdbtable{DiffToImage}, and \ippdbtable{DiffDetEffMeta} metadata tables describe basic properties of the difference images and allow the \ippstage{diff} images to be mapped to the \ippstage{stacks} and single exposures that were used in the creation of the diff images.  \ippdbtable{DiffDetection} contains the photometry from the detections measured from the difference images.  

\parheading{DiffDetObject} Contains the positional information for difference detection objects in a number of coordinate systems. The objects associate difference detections within a one arcsecond radius. The number of detections in each filter is listed, along with maximum coverage fractions \citep[see][]{Szalay2007}). Use \ippdbcolumn{diffObjID} to join to most diff tables.  \ippdbcolumn{diffObjID} and \ippdbcolumn{uniquePspsDOid} are unique for \ippdbtable{DiffDetObject}. Note that (\ippdbcolumn{diffObjID} and  \ippdbcolumn{objID} will be similar, but not identical, and it will not be easy to join to non-diff tables.  We recommend comparing the R.A. and Declination for objects between Diff* and non-diff tables.

\parheading{DiffMeta} Contains metadata related to a difference image constructed by subtracting a stacked image from a single epoch image, or in the case of the MD Survey from a nightly \ippstage{stack} (stack made from all exposures in a single filter in a single night). The astrometric calibration of the reference \ippstage{stack} is listed.

\parheading{DiffDetection} Contains the photometry of individual detections from a difference image. The identifiers connecting the detection back to the difference image and to the object association are provided. PSF, aperture, and \citet{Kron1980} photometry are included, along with sky and detector coordinate positions. 

\parheading{DiffToImage} Contains the mapping of which input images were used to construct a particular difference image. 

\parheading{DiffDetEffMeta} Contains the detection efficiency information for a given individual difference image. Provides the number of recovered sources out of 500 injected sources and statistics about the magnitudes of the recovered sources for a range of magnitude offsets. 

\begin{table*}
\caption{Coordinate fields in PSPS}
\begin{center}
\begin{tabular}{llll}
\hline
\hline
PSPS Table & \multicolumn{2}{c}{column names} & comments \\
\hline
FrameMeta & raBore & decBore & RA/Dec of telescope boresite \\
%- where the telescope was pointed when image was taken \\
ObjectThin & raMean & decMean & mean RA and Dec from single exposure, calibrated against 2MASS \\
ObjectThin & raStack & decStack & mean RA and Dec calculated from \ippstage{stack} skycells \\
Detection & RA & Dec & RA and Dec for single exposure detections \\
StackObjectThin & (grizy)ra & (grizy)dec & RA and Dec calculated from individual \ippstage{stack} skycells \\
DiffDetection & RA & Dec & RA and Dec for single \ippstage{diff} exposure detections  \\
DiffDetObject & RA & Dec & similar to raMean/decMean, calculated for \ippstage{diff} objects \\
GaiaFrameCoordinate & RA & Dec & \textbf{Best RA and Dec, recalibrated to Gaia (DR1 only).}\\%\tablenotemark{a} \\ 
\hline
\end{tabular}
\end{center}
%\tablenotetext{a}{This is the best and most accurate RA and Dec to use if interested in the static sky.}
\label{table:radec}
\end{table*}


\subsection{Which RA and Dec to use?}
\label{sec:schemaradec}

Multiple tables contain columns that provide a measurement or
representation of the R.A. and Declination.  This section gives
information on each so that the user can choose the appropriate
R.A. and Dec version to use. A summary of these tables are provided in
Table~\ref{table:radec}.  Generally, if the user is not interested in
proper motion or moving objects, it is best to use coordinates from
\ippdbtable{GaiaFrameCoordinate} if using DR1, as this is the weighted mean
RA and Dec (similar to \ippdbtable{ObjectThin}), but tied to the Gaia system.
This information is in a separate table and not part of \ippdbtable{ObjectThin} because the mean properties were calculated and ingested
into PSPS prior to Gaia's DR1.  \ippdbtable{ObjectThin}'s \ippdbcolumn{raMean} and
\ippdbcolumn{decMean} is calibrated against 2MASS, and is thus degraded compared
to Gaia.  The 2MASS reference system is consistent with the ICRS to
within 15 mas, but the scatter for even bright sources is $\approx 100$
mas \citep{2006AJ....131.1163S}.

For DR2, there is no \ippdbtable{GaiaFrameCoordinate} table, as DR2's
\ippdbtable{ObjectThin} table is already calibrated to Gaia. The best
R.A. and Dec. to use for most cases is ObjectThin's \ippdbcolumn{raMean}
and \ippdbcolumn{decMean}. If the proper motion is high, or the object is
moving, and the user is interested in the single epoch photometry,
they should use \ippdbcolumn{ra} and \ippdbcolumn{dec} in the
\ippdbtable{Detection} table.

\subsection{Indexes and Joins}
\label{sec:schemaindexjoins}

There are multiple columns within the schema that are indexed and
designed to be used to join tables together. Generally, if a column
name ends in ``\ippdbcolumn{ID}", it is designed to be joined to other
tables, either to system metadata tables (examples include
\ippdbcolumn{filterID}, \ippdbcolumn{surveyID}, \ippdbcolumn{ccdID}), or to
fundamental data tables (for example, \ippdbcolumn{objID},
\ippdbcolumn{diffObjID}, \ippdbcolumn{uniquePspsSTid}). There are a few
exceptions, \ippdbcolumn{randomID} and \ippdbcolumn{random(stage)ID} should not
be used for joins, the contents of each are random numbers to aid the
user in selecting repeatable random subsets of data. Also, some of the
\ippdbcolumn{uniquePspsXXIds} are only present in one table, they are used
to provide unique IDs for each stage of processing but some stages
(\ippdbtable{DiffDetObject}, for example) only have one corresponding table
and therefore nothing to join to.

Figure~\ref{fig:objidmap} and Figure~\ref{fig:imageidmap} show
graphical representations of how to join various tables.  On these
figures, the table names are boxed, while the columns to be used to
join are in ovals.  For the diagram with \ippdbcolumn{objID} in the middle,
it shows that any of the boxes connected to \ippdbcolumn{objID} can be
joined to each other using \ippdbcolumn{objID}.

% \note{somewhat repetative w.r.t. section on objID (7.1)}

All tables with photometric or astrometric information involving
different sources or objects have an index, called \ippdbcolumn{objID}.
\ippdbcolumn{objID} is only unique for the object type of tables, and is
loosely based on RA and Dec, see Section~\ref{sec:schemaobjid} for
more information. It is possible to use the \ippdbcolumn{objID} to get a
rough estimate of the RA and Dec, but this should not be used for the
definitive RA and Dec. Use \ippdbtable{ObjectThin} to get the RA and Dec
calibrated to 2MASS, and use \ippdbtable{GaiaFrameCoordinate}(for DR1) or
\ippdbtable{ObjectThin}(for DR2)to get the RA and Dec calibrated to Gaia
astrometry.  When available and possible, if joining 2 tables and they
both have the same column name like \ippdbcolumn{uniquePspsXXId}, join
those 2 tables using the \ippdbcolumn{uniquePspsXXId}. See
Table~\ref{table:uniqueuepsps} to see the \ippdbcolumn{uniquePsps} column
name.  \ippdbcolumn{UniquePspsXXId} is designed to be unique, specifically
for the cases of when there are multiple detections that are
sufficiently close by, they will have the same \ippdbcolumn{objID} but
different \ippdbcolumn{uniquePspsXXId}s.

 %AGAIN, IS THIS GAIA STUFF IRRELEVANT FOR DR2? - NM 10 Dec 2018
 %HAF tried to fix, I think...  FIXME
 
It is possible to join every detection, no matter what stage of
processing it is from, back to the original exposure(s) and to the
OTAs.  Figure~\ref{fig:imageidmap} shows how to do this.  For each
stage of processing, there is an associated (stage)imageID that is
mapped back to the \ippdbcolumn{imageID} via tables of the name
\texttt{(stage)ToImage}.  For example, if one wanted to find out which
exposures contributed to a detection in \ippdbtable{StackObjectThin}, they
would join to \ippdbtable{StackToImage} using the \ippdbcolumn{stackImageID}.
This allows the user to find data within the database as well as to
find out the corresponding images to download from MAST.

\begin{table}
\caption{Unique indicies for various PSPS tables}
\begin{center}
\begin{tabular}{lll}
\hline
\hline
PSPS Table & uniquePspsID name & Release\\
\hline
ObjectThin & uniquePspsOBid  & DR1 \\
MeanObject & uniquePspsOBid & DR1 \\
Detection & uniquePspsP2id & DR2\\
DiffDetection  & uniquePspsDFid & DR2\\
DiffDetObject& uniquePspsDOid & DR2\\
ForcedGalaxyShape& uniquePspsFGid & DR2\\
ForcedMeanObject& uniquePspsFOid & DR1\\
ForcedMeanLensing& uniquePspsFOid & DR1\\
ForcedWarpMeasurement& uniquePspsFWid & DR2\\
ForcedWarpExtended& uniquePspsFWid & DR2\\
ForcedWarpLensing& uniquePspsFWid & DR2\\
ForcedWarpMasked& uniquePspsFWid & DR2\\
GaiaFrameCoordinate& uniquePspsGOid & DR1\\
StackObject* (2 tables)& uniquePspsSTid & DR1\\
StackApFlx* (4 tables)& uniquePspsSTid & DR1\\
StackModelFit* (4 tables)& uniquePspsSTid & DR1\\
StackPetrosian& uniquePspsSTid & DR1\\
\hline
\end{tabular}
\end{center}
\label{table:uniqueuepsps}
\end{table}%
 
\subsection{NULLS as $-999$}
\label{sec:schemanulls}

The PSPS uses \texttt{-999} to denote \texttt{NULL} values, as PSPS is based off of CasJobs which also does not use NULL. The justification for this is  explained at the following url: \url{http://skyserver.sdss.org/edr/en/sdss/skyserver/}. Specifically, they state "We also insist that all fields are non-null. These integrity constraints are invaluable tools in detecting errors during loading and they aid tools that automatically navigate the database.", and since our own database design has in its roots many of the same parts as the SDSS database, we also adopt this convention of non-null fields.


%Some of the Flag tables are of type \texttt{BIGINT}.  Care should be taken when doing bitmask queries with a \texttt{BIGINT}. Specifically, the bitmask needs to be recast as a BIGINT to force it to be of a proper size. 

%For example, suppose one want to find \ippstage{stack} detections in g band where the PEAK\_OFF\_CHIP bit (2147483648) is set.  

%SELECT TOP 10\ippdbcolumn{objID}, gInfoFlag FROM StackObjectThin WHERE  ginfoFlag \& CAST(2147483648 AS BIGINT) > 0

\subsection{Tables and Views}
\label{sec:schemaviews}

 The PSPS has defined several views to aid the user in making database queries.  A view is a virtual table that is based on the results from an SQL statement, and looks like a table to the user.  These views are constructed to aid the user, to alleviate the need for common joins, and produce query results faster than joins. Table~\ref{table:views} describes the views currently in PSPS. 

%FIXME these views are certainly wrong and need help. UGH.

\input{viewstable.tex}

\section{The $3\pi$ Database}
\label{sec:threepidatabase}

The $3\pi$ Survey, described in detail in \citet{Chambers2017}, covers 3/4 of the sky (Dec $> -30\degrees$) in 5 bands (\grizy), with approximately 60 exposures per patch of sky. For various reasons, a very tiny fraction of the data does not make it into the PSPS database.  Some data was intentionally skipped because of poor data quality or other problems; some data failed to process due to glitches or software bugs, some of which may be addressed in a future re-analysis (PV4 or other).  We present here the different causes (of which we are aware) for data to be skipped or missed. This section lists the numbers of exposures, skycells, or batches that were processed in each stage, including counts for what were expected and as well as counts for known faults and quality issues (see also Tables~\ref{table:ippcounts} and \ref{table:ipptopspscounts}).

%\subsection{IPP Processing stages}

%{\color{red} needs more words and preface, also is it in the right place (data products for 3pi)}
% A subset of these products are to be released in DR1, and the rest will be released in DR2. These include, for DR1, unconvolved images from the \ippstage{stack} stage for 3$\pi$.  
%DR2 will include warp images for all of the 3$\pi$ exposures.  Catalog data will be available via the PSPS database, it will include for DR1 stack measurements for unconvolved and convolved stacks, available in the \ippdbtable{Stack*} tables, and mean properties from the \ippstage{camera} stage (\ippdbtable{ObjectThin} and \ippdbtable{MeanObject}).  DR2 will include single exposure catalogs from the \ippstage{camera} stage (as \ippdbtable{Detection} tables), all measurements from the \ippstage{forced photometry} stage (as \ippdbtable{Forced*} tables), and all measurements from the \ippstage{diff} stage (as \ippdbtable{Diff*} tables). 

%\subsection{Known Issues with the database}
%\label{sec:knownissues}

% For various reasons, a very tiny fraction of the data does not make it into the PSPS database.  Some of the data will be ingested at a later time (DR2 and beyond), however some will not be ingested at all.  We present the different sources of missing data that we are aware of. This list is not exhaustive and will be added to at this link ( ) .

\subsubsection{IPP Processing stages}
\label{sec:3piprocessing}

All of the $3\pi$ data was reprocessed in a consistent way with the same version of IPP code, internally called Processing Version 3 (PV3) and described in Paper II. 

% Small fractions of the raw image data were simply not processed at all, or failed at processing and were not recovered.  This can happen at various stages of processing, and we can report the expected numbers here. A more detailed accounting of the various causes that lead to data being filtered out of PV3 requires further documentation and is beyond the scope of this section.
%FIXME

%I SEEM TO REMEMBER THAT THERE ARE SOME EXTRA EXPOSURES ON SOME OF THE MD AREAS WHICH REALLY SHOULDNT BE IN THE 3PI - MAYBE GENE CAN REMEMBER THE DETAILS? - NM 10 Dec 2018

% FIXME

\parheading{Raw Exposure} A total of 388,177 raw exposures were taken between 2009-06-03 and 2015-02-25 as part of the 3$\pi$ survey. However, only 381,279 ($98.2\%$) of these were queued for the first stage of processing, the \ippstage{chip} stage. Exposures were excluded because they did not meet various requirements: they were flagged as invalid by the observers, or they failed to be processed by nightly science processing because of bad seeing, camera issues, or other observational or telescope conditions that can ruin an exposure. 

\parheading{Chip Stage} Of the 381,279 exposures queued for \ippstage{chip} processing, 375,573 ($98.5\%$) completed PV3 processing with good quality: no issues detected while detrending or finding sources and performing photometry.  

\parheading{Camera Stage} The \ippstage{camera} stage started with these 375,573 exposures, of which 374,521 ($99.7\%$) completed processing.  The other exposures failed due to: insufficient stars for the astrometric analysis, failure of single chip astrometry to converge, or failure of mosaic astrometry, usually too many failed chips. %Of those, 374446 were ingested into the DVO. These are the number of exposures we expect to see in the PSPS after loading.

\parheading{Warp Stage} The \ippstage{warp} stages started off with a larger number of exposures than expected: 379,973 instead of 374,521.  This was due from some challenges in managing the remote processing on the clusters at Los Alamos National Laboratory and the University of Hawaii computer cluster (see Paper II).  Data transfer failures between the remote clusters and the IPP main cluster required re-queuing and re-running the analysis for some warps in a way that resulted in temporary double-counting.  Of the 379,973 exposures processed, 374,339 ($98.5\%$) are unique, and 1,234 are duplicates. Of the 379,973 exposures, 379,551 ($99.9\%$) have good quality. The \ippstage{warp} stage is the first stage that repartitions the exposures into the skycell tessellation, and since all later stages process on a skycell level rather than an exposure level, we note that the \ippstage{warp} stage yields 206,177 distinct skycells, with multiple warp skycell images from the different exposures for each skycell.

\parheading{Stack to Skycal Stages} The \ippstage{stack} stage operates on 200,730 distinct skycells with up to five filter images per skycell.  A total of 200,725 stack skycells have good quality. There are fewer stack skycells than the 206,177 warp skycells listed above because stacks are not generated for skycells with Declination $< -30\degrees$.  Stacks generated below this Declination limit would have significantly poorer coverage and are of limited utility.  A total of 200,720 distinct skycells were processed by the static sky stage and all have good quality. The \ippstage{skycal} stage processed 200,722 skycells, of which 2 were essentially duplicate \ippstage{stacks} (same inputs, same skycells), of which 200,684 completed with good quality.

% \note{EAM: get the stack ID info for the duplicate stacks}

The \ippstage{stack} stages have a couple of additional inconsistencies.  First, of the 200,684 \ippstage{stacks} which completed through \ippstage{skycal}, 409 \ippstage{stacks} ($0.2\%$) include duplicate exposures, i.e. the same exposure appears in a \ippstage{stack} twice.  Second, 130 \ippstage{stacks} unintentionally include test exposures (short exposures, 1 second, which were mislabeled as 3$\pi$ data) which slightly degrade the stack.  These artifacts were discovered during the \ippstage{IppToPsps} and PSPS phases, and are thus present in the database.  In addition the two \ippstage{stack} duplicates mentioned above (i.e. two \ippstage{stacks} for the same filter and skycell), are also present in the PSPS. 
%\ippstage{IppToPsps} expected to generate 200684 \ippstage{stack} batches.  It created 200681 batches (missing 3), of those that are expected, 1940 partially loaded, and 14 failed to load into PSPS by the DR1 deadline.  These missing batches (1957) will not be included in DR1; they will be added shortly after DR1.

\parheading{Forced Warp Stage} Forced warps are queued by skycell and filter.  The 994,890 queued \ippstage{forced warp} skycell sets resulted in 19,266,450 cmf files (one per exposure per skycell) from 373,743 exposures and 199,151 distinct skycells, consistent with expectations.   There are slightly fewer distinct forced warp skycells than for the stack stages due to the varying coverage at the survey limit of -30\degrees: skycells with insufficient numbers of fully-filled warps were not queued for forced photometry processing.

%add diff at some point
%FIX ME needs to be organized better, and for DR1 vs DR2 UGH
%{\color{red} I have the bulk of the information here, but I do not know the best way to organize what is missing}

% {\em Missing from ObjectThin/MeanObject}: These were loaded via OB batches, there were 116252 batches, subdivided by individual DVO files (each DVO file covers specific RA/Dec ranges).  Of the 116252 batches, 2902 batches were only partially ingested into PSPS; this represents 2.5\% of the total number of batches, and 1.2\% of the total number of objects.  The missing batch data will be released shortly after DR1.

% {\em Missing Forced Objects}: We expect 113665 \ippdbtable{Forced Object} batches.  There are 7086 batches that have been partially loaded into PSPS, the rest of the batches are fully loaded.  These missing batches will not be included in DR1, they will be added shortly after DR1.

% {\em Missing from Forced Warp}: We expect 994890 \ippdbtable{Forced Warp} batches. These have not yet been generated by \ippstage{IppToPsps}, and therefore have not been loaded into PSPS. These will be released in DR2. 

% {\em Missing Forced Galaxy Objects}: We expect 113665 \ippdbtable{Forced Galaxy Object} batches. These have not yet been generated by \ippstage{IppToPsps}, and therefore have not been loaded into PSPS. These will be released in DR2. 

% {\em Missing Diff and Diff Objects}:  We expect 113665 \ippdbtable{Diff Object} batches and 374521 \ippdbtable{Diff} Detection batches. These have not yet been generated by \ippstage{IppToPsps}, and therefore have not been loaded into PSPS. These will be released in DR2. 

%(or a few less) for diffs (but right now I am finding it to be higher) - 20264363 good warp skycells, 392210 good warp images... hang on... 

\subsection{Building the 3$\pi$ DVO Database}
\label{sec:building3pi}

The $3\pi$ database was built in stages, with many checks to verify all of the data was included. Full details of the construction and final calibration are in \citet{Magnier2017c}.  The $3\pi$ database contains the following counts of data for various processing stages, ordered by how they were ingested into the database:

\parheading{Stack/skycal cmf} The end product from the skycal stage produces 1 cmf file per stack skycell per filter. There are 1-5 cmfs per skycell, corresponding to different filters.  All 998,101 skycal cmfs, in 200,684 distinct skycells were successfully ingested into the DVO.

\parheading{Camera smfs} The camera stage produces 1 smf file per exposure, with extensions for each of the 60 chips. Of the 374,521 available camera stage smf files, 374,446 were ingested with no faults.  The remaining 75 failed to be ingested in the DVO either due to bad data quality (poor astrometry) or in a few cases data corruption in the disk file.  These smfs will not be included in the PSPS. 

\parheading{Forced warp cmfs}  The forced warp photometry stage produces many cmf files: each of the exposures that are within a given skycell will produce a cmf that is ingested into the database.  There are 19,266,450 of these cmf files, they come from 373,743 exposures, and are in 994,890 skycells. 

\parheading{Forced warp summary cmfs} The forced warp photometry stage also produces a summary cmf of the mean properties for a given skycell and filter, based on the forced photometry results for all of the included exposures that are within a given skycell.  There are 994,890 of these cmfs, in 199,151 distinct skycells. There are 1-5 cmfs per skycell, corresponding to different filters.

Very tiny amounts of data were not ingested due to quality issues, and there are very minor duplicate issues with processing resulting in some duplicate files being ingested.  It is possible to remove those duplicates, but then the mean properties must be recalculated.  There are a small number of duplicates that were discovered in \ippstage{ippToPsps} and PSPS, and it was not possible to remove and recalibrate them at this time.  %These are described in more detail in Section\ref{sec:knownissues}. 

\subsubsection{Polar Astrometry Issues}

After delivery of the DR2 data to STScI, internal consistency tests
revealed some problems for data in the vicinity of the celestial north
pole.  This issues is described in some detail in Paper IV.  In short,
the on-the-fly astrometric calibration performed during the PV3
analysis (Section~\ref{sec:chipandcamera}) relied on an astrometric
reference catalog generated from the PV2 analysis of the PS1 dataset
which contained some errors.  In that earlier analysis, some exposures
were poorly calibrated due to large rotator errors near the pole, but
the failures were not recognized.  These poorly calibrated images were
included in the reference database providing a set of invalid
reference stars.  In the PV3 analysis, exposures in the vicinity of
these problem areas sometimes latch onto the invalid stars resulting
in poorly calibrated images.  Individual chips may have solutions with
offsets of up to 2 arcseconds.

These astrometry failures cause errors with the mean astrometry for
objects in this region.  They also result in misaligned warp images
and therefore stacks with smeared or doubled stellar images.  The
photometry for warps and stacks are also corrupted.  We identified the
warps and stack skycells affected by this issue and provide warnings to users
who attempt to download these images from MAST.  Stack properties from
the affected images are set to {\tt NULL} as these values cannot
be trusted.  A list of the affected skycells is provided at MAST and
users are advised to be cautious of measurements from these regions.
A reprocessing of the polar regions north of Dec = 70\degrees\ is
underway (Nov 2019) and will be released to users in the future.

%{\color{red} The diff DVO database }

\subsection{IppToPsps Stage}
%THIS SUBSECTION NEEDS UPDATING FOR DR2 - NM 11 Dec 2018
% FIXME
IppToPsps generates batches that includes all of the smf/cmf files categorized by stage of processing, and generates batches corresponding to each DVO file.  It is straightforward to verify all the data is accounted for and has been processed through ippToPsps, and easy to regenerate missing batches. This section describes the batch types and expected numbers.

\parheading{Stacks} \ippstage{IppToPsps} expected to generate 200,684 \ippstage{stack} batches.  It initially created 200,681 batches for DR1, and two of the missing batches were created and added after the original DR1 date.  For DR2, it generated 200,683 batches.  The 1 missing stack batch ended up being unsuitable data quality for the database.

\parheading{ObjectThin/MeanObject} \ippstage{IppToPsps} generated all of the expected 116,252 batches for DR1, and 111,505 for DR2.  There are fewer batches for DR2 because it explicitly avoids the ragged edge of the survey and excludes those with Dec $<-30$.

\parheading{GaiaFrameCoordinate} \ippstage{IppToPsps} generated all of the expected 116,252 batches for DR1. This batch type was not relevant for DR2.

\parheading{Forced Mean Objects} \ippstage{IppToPsps} generated all of the expected 113,665 \ippdbtable{Forced Object} batches for DR1, and 113,167 batches for DR2.  There are fewer of these batches for than for ObjectThin because it explicitly avoids the ragged edge of the survey at Dec $= -30\degrees$. %% HAF needs to add more words here/ more checks... The small differences between DR1 and DR2 are

\parheading{Detection Table} We expect 374,446 \ippdbtable{Detection} batches, and we generated 374,344. The 102 missing batches were incorrectly marked as good exposures but in fact are not of sufficient quality and will not be added into the database.

\parheading{ForcedWarp Tables} We expect 994,890 \ippdbtable{Forced Warp} batches, and we generated 994,826. %%HAF needs to add more words here/more checks%, and therefore have not been loaded into PSPS. These will be released in DR2. 

\parheading{Forced Galaxy Objects} We expect 57,758 \ippdbtable{Forced Galaxy Objects} and we generated 57758 \ippdbtable{Forced Galaxy Object} batches. Not all areas of sky will have forced galaxy objects measured, so although the batches are subdivided in the sky the same way as for \ippdbtable{ObjectThin/MeanObject} and \ippdbtable{ForcedMeanObject}, we should expect a smaller number (57,758) than for the other Object types (typically $>$ 110 thousand).

%\parheading{Diff and Diff Objects}  We expect 113665 \ippdbtable{Diff Object} batches and 374521 \ippdbtable{Diff} Detection batches. These have not yet been generated by \ippstage{IppToPsps}, and therefore have not been loaded into PSPS. These will be released in DR2. 

\subsection{Loading into PSPS}

The PSPS loaded the tables for DR1 and DR2, however there are a few inconsistencies discovered:

% \note{what happened in the end with DR1? with DR2?}

\ippstage{IppToPsps} expected to generate 200,684 \ippstage{stack}
batches.  It initially created 200,681 batches (missing 3), of those
that are expected, 1,940 partially loaded, and 14 failed to load into
PSPS by the DR1 deadline.  These missing batches (1957) were not
included in the initial DR1 release, but were added over the months
after the initial release.  Similar gaps were present in the initial
DR2 release and largely been filled in as of this time.  However,
users should be cautious of possible gaps in the database and consult
the MAST website.

%\parheading{Missing from ObjectThin/MeanObject} \ippstage{ippToPsps} generated 116,252 batches.  Of the 116,252 batches, 2,902 batches were only partially ingested into PSPS; this represents 2.5\% of the total number of batches, and 1.2\% of the total number of objects.  The missing batch data will be released shortly after DR1.

%\parheading{Missing Forced Objects} We expect 113,665 \ippdbtable{Forced Object} batches.  There are 7,086 batches that have been partially loaded into PSPS, the rest of the batches are fully loaded.  These missing batches will not be included in DR1, they will be added shortly after DR1.

%%\noindent {\em Missing from DR2}
%%FIXME HERE

\subsubsection{Queries to find holes}
\label{sec:pspsholes}

It is possible to use the PSPS database to verify data and to check there is no missing data.  The table \ippdbtable{GaiaFrameCoordinate} is complete and has no missing data. It can be used to do quick integrity checks on other tables within PSPS. Finding missing objects from \ippdbtable{ObjectThin} is straightforward: Do a \texttt{FULL OUTER JOIN} for \ippdbtable{GaiaFrameCoordinate} and \ippdbtable{ObjectThin} using \ippdbcolumn{objID}.  Objects with a \texttt{NULL} \ippdbtable{ObjectThin}.\ippdbcolumn{batchID} are missing. Missing objects from \ippdbtable{ForcedMeanObject} can be found in a similar way as those in \ippdbtable{ObjectThin}, do a \texttt{FULL OUTER JOIN} between \ippdbtable{GaiaFrameCoordinate} and \ippdbtable{ForcedMeanObject}.  Objects with a NULL \ippdbtable{ForcedMeanObject}.\ippdbcolumn{batchID} are missing. Finding missing objects in \ippdbtable{StackObjectThin} is trickier, because not all objects have \ippstage{stack} photometry.  This requires a \texttt{FULL OUTER JOIN} on \ippdbtable{StackObjectThin} to \ippdbtable{ObjectThin} to \ippdbtable{GaiaFrameCoordinate}.  Missing \ippstage{stacks} will have valid \ippdbtable{ObjectThin}.\ippdbcolumn{raStack} and \ippdbtable{ObjectThin}.\ippdbcolumn{decStack} and \texttt{NULL} \ippdbtable{StackObjectThin}.\ippdbcolumn{objID}.


%For DR2 and beyond, we have not yet loaded the PSPS database, but we know what numbers to expect from the DVO and from IppToPsps.  We report these numbers here.

%Missing Single Exposures: We expect XXX Detection batches; XXX have been generated by IppToPsps.
%Missing Forced \ippstage{warp} Exposures: We expect xxxx Forced Warps.  Of those, xxx have bad quality and are not ingested into the DVO database. 

%We expect 113665 Forced Galaxy batches.  \ippstage{diffs} are unknown at this time; the \ippstage{diff} DVO database has not yet been created. 

%Images in 3pi PV3 reprocessing were taken between 2009-06-03   and  2015-02-25 . 

\begin{table}
\caption{\noindent Exposure count for various stages of IPP processing}
\begin{center}
%\resizebox{.70\textwidth}{!}{
\begin{tabular}{lll}
\hline
\hline
IPP stage & queued & successful \\
\hline
raw exposures        & 388,177  & ...  \\
chip stage           & 381,279  & 375,573  \\
cam stage            & 375,573  & 374,521\\
fake/warp (exp)      & 379,973  & 379,551 \\
fake/warp (skycells) &          & 206,177 \\ 
stack                & 200,730  & 200,725    \\ 
staticsky            & 200,720  & 200,720      \\
skycal               & 200,722  & 200,684 \\
fullforce            & 200,684  & 200,684    \\
%forced galaxy       &         &     \\
%diff                &         &   \\
\hline
\end{tabular}
\end{center}
\label{table:ippcounts}
\end{table}%

\begin{table}
\caption{Batch count for database ingest stages}
\begin{center}
%\resizebox{.70\textwidth}{!}{
\begin{tabular}{lllll}
\hline
\hline
IPP stage & IPP done & DVO & \ippstage{IppToPsps} & PSPS \\
\hline
cam stage     & 374,521 & 374,446 &         &         \\
skycal        & 200,684 & 200,684 & 200,681 & 198,727 \\
fullforce     & 200,684 & 200,684 & not yet &         \\
forced galaxy & 113,665 & 113,665 & not yet &         \\
object        & 116,252 & 116,252 & 116,252 & 113,350 \\
gaia          & 116,252 & 116,252 & 116,252 & 116,252 \\
%diff         &         &         &         &         \\
forced object & 113,665 & 113,665 & 106,579 &         \\
\hline
\end{tabular}
\end{center}
\label{table:ipptopspscounts}
\end{table}%

\section{Conclusion}
\label{sec:conclusion}
The Pan-STARRS database contains 10,723,304,629 objects. It is the largest data release from the largest digital sky survey to date, distilling the information from 1.6 petabytes of images and tables into a form that is accessible to the astronomical community through MAST. Nevertheless, sifting through such a large database can prove daunting, and this work is intended to describe the primary tables and quantities within the database, together with example queries. Data from Pan-STARRS has been used for myriad purposes including detecting moving objects within the solar system (and in the case of ‘Oumuamua, from outside it!), the analysis of tens of thousands of high-energy transient events, mapping the 3D structure of dust within our Galaxy, and studies of the large scale structure of our Universe. Yet these only scratch the surface, and it is likely that mining the database will lead to discoveries that were missed and correlations that were overlooked. As we enter the era of multi-messenger astrophysics, the Pan-STARRS data products will be essential to identifying the host galaxies and electromagnetic counterparts of events detected by gravitational wave, high-energy particle, neutrino and radio observatories. While we have provided various tools to work with this data release, we anticipate that it will spur the development of new interfaces and ways of working with high-dimensional datasets. This work will be critical to science with future surveys such as LSST. Combining this Pan-STARRS data release with other large catalogs such as \emph{GALEX}, 2MASS and \emph{Gaia} will provide a rich, high-dimensional dataset that will enable new scientific studies, and may yield astronomical treasures that we have not even begun to imagine.

{\color{red} }

%FIXME
\acknowledgments

{\it Facilities:} \facility{PS1 (GPC1)}

The Pan-STARRS1 Surveys (PS1) have been made possible through
contributions of the Institute for Astronomy, the University of
Hawaii, the Pan-STARRS Project Office, the Max-Planck Society and its
participating institutes, the Max Planck Institute for Astronomy,
Heidelberg, and the Max Planck Institute for Extraterrestrial Physics,
Garching, The Johns Hopkins University, Durham University, the
University of Edinburgh, Queen's University Belfast, the
Harvard-Smithsonian Center for Astrophysics, the Las Cumbres
Observatory Global Telescope Network Incorporated, the National
Central University of Taiwan, the Space Telescope Science Institute,
the National Aeronautics and Space Administration under Grant
No. NNX08AR22G issued through the Planetary Science Division of the
NASA Science Mission Directorate, the National Science Foundation
under Grant No. AST-1238877, the University of Maryland, Eotvos Lorand
University (ELTE), the Los Alamos National Laboratory and the Gordon
and Betty Moore foundation.

This work has made use of data from the European Space Agency (ESA)
mission {\em Gaia} (\url{http://www.cosmos.esa.int/gaia}), processed by
the {\em Gaia} Data Processing and Analysis Consortium (DPAC,
\url{http://www.cosmos.esa.int/web/gaia/dpac/consortium}). Funding
for the DPAC has been provided by national institutions, in particular
the institutions participating in the {\em Gaia} Multilateral Agreement.

HF has some more acknowledgments to add but for now would especially like to thank G.~Hasinger for extensive \LaTeX{} help, G.~Narayan for magical \LaTeX{} ninja skills, and S.~Isani (Ministry of Fonts) for checking \LaTeX{} for typos (he disagrees with my font choice).  

\bibliographystyle{apj}
% \bibliography{main}{}
\input{main.bbl}

\appendix
%should I use \chapter or section in appendix? I can't get the  references to work.  
%so chapter makes appendix numbers, and section makes appendix letters.

% Do you have an idea, why the appendix is only one-column?
% no
\section{Query Examples}
\label{sec:query}

This section shows example queries for the \PS\ database. The
progression will be from simple queries to more complicated queries.
SQL has no requirements on case.  We adopt the standard convention of
using \texttt{CAPITAL LETTERS} for SQL reserved words and functions,
and \texttt{CamelCase} for the tables and columns within the PSPS
database schema.  The queries given below may all be run from the
CasJobs tab on the MAST web site.  Note the some of the later queries
rely on myDB tables generated in the earlier queries.
 
%\noindent Unless otherwise specified, assume that these queries are run off of the PSI query page ({\color{red} arrrgh this needs to be updated because we aren't using psi, right? what do I do KCC? } \url{http:\/\/panstarrs.stsci.edu/PSI/query\_page.php} ), under 'select database' use a database that starts with 'PanSTARRS\_3PI' (this will be updated as future data releases occur), paste the query in the Query box, and select the 'slow queue'.  Set 'MyDB table for slow queue results:' to be query1, query2, etc as applicable. The progression will be from simple queries to more complicated queries, with a focus on queries for DR1 followed by queries applicable to later data releases.

\begin{enumerate}
\item \textbf{Counting the number of rows in a large table}

This is an example of a simple query, it needs to be run in the slow queue. The difference between \texttt{COUNT\_BIG()} and \texttt{COUNT()} is that \texttt{COUNT\_BIG()} returns a \texttt{BIGINT}, while \texttt{COUNT()} returns an \texttt{INT}.  The PSPS tables are so large that \texttt{COUNT()}, which goes up to 2.14 billion, is too small of a number. Users should choose the method of counting rows that is appropriate for their data ranges. Unless it involves large tables and large areas of sky, \texttt{COUNT()} is recommended.

%% careful with these: underscores from PDFs convert to spaces when copy-paste-ing

%% QUERY 01
\texttt{SELECT COUNT\_BIG(objID) FROM ObjectThin}

% EAM : 2019.11.08 : OK, result: 10560724292
% (requires long queue.)

\item \textbf{Return mean PSF magnitudes and errors for all filters (grizy) for a rectangular patch of sky}

%% QUERY 02
\texttt{SELECT ObjectThin.objID, nDetections, raMean, decMean, \\
gMeanPSFMag, gMeanPSFMagErr, rMeanPSFMag, rMeanPSFMagErr, \\
iMeanPSFMag, iMeanPSFMagErr, zMeanPSFMag, zMeanPSFMagErr, \\
yMeanPSFMag, yMeanPSFMagErr \\
FROM ObjectThin \\
INNER JOIN MeanObject ON ObjectThin.objID = MeanObject.objID \\
WHERE \\
raMean > 100.0 \\ 
AND raMean < 100.1 \\
AND decMean > 0.0 \\
AND decMean <  0.1 \\
}
% EAM : 2019.11.08 : OK, I get 3867 objects against DR2

This returns 3867 objects. The majority of these objects have only been detected once.  

\item \textbf{Make a simple text histogram of ObjectThin.nDetections for a rectangular patch of sky}

It is possible to save queries into your own personal MyDB, as well as
to make queries on your MyDB. Do the query from above, but save it to
your MyDB as 'MyDBtest'.  Run the following query on your MyDB to make
a histogram of \ippdbcolumn{nDetections}.

%Verify that the query is complete from the queued jobs page.  Run the following query in the fast queue, but select the Database to be 'MyDB'

% QUERY 03
\texttt{SELECT nDetections, COUNT(nDetections) FROM MyDBtest GROUP BY nDetections ORDER BY nDetections}
% EAM : 2019.11.08 : OK

The results are ordered by \ippdbcolumn{nDetections}, and it is apparent
that most of the objects have 0-2 detections.  The
\ippdbcolumn{nDetections} column refers to the number of times something is
detected from the the individual exposures.  Objects that have 0
detections are so faint that they are not visible in the individual
exposures but are detected in the stacks.  Objects with 1-2 (or a few
detections), might be spurious detections, moving objects, or faint
objects.  If the user is interested in objects that are more likely to
be well measured in several epochs and also of astrophysical nature,
it is best to add a restriction on \ippdbcolumn{nDetections}.  If the user
is interested in the static sky, and in \ippstage{stack} photometry, it is
best to do a \texttt{JOIN} on \ippdbtable{StackObjectThin}. See the next 2
queries for examples of each of those types of queries.

\item \textbf{Select mean PSF magnitudes and errors for filters griyz and for a rectangular patch of sky, with a restriction of $>$ 10 \ippdbcolumn{nDetections}}

This is an example of a query to get mean PSF magnitudes and errors for all filters in a rectangular patch of sky, for objects with $>$ 10 \ippdbcolumn{nDetections}. The reason we chose 10 detections is somewhat arbitrary, and can be adjusted, but is used primarily to cut out objects for which there are only a few detections. Objects with very few detections might not be astrophysical, or they might be too faint to be seen multiple times.

% QUERY 04
\texttt{SELECT ObjectThin.objID, raMean,decMean, \\
gMeanPSFMag, gMeanPSFMagErr, rMeanPSFMag, rMeanPSFMagErr, \\
iMeanPSFMag, iMeanPSFMagErr, zMeanPSFMag, zMeanPSFMagErr, \\
yMeanPSFMag, yMeanPSFMagErr \\
FROM ObjectThin \\
INNER JOIN MeanObject ON ObjectThin.objID = MeanObject.objID \\
WHERE\\
nDetections > 10 \\
AND raMean >100.0 \\ 
AND raMean < 100.1 \\
AND decMean > 0.0 \\
AND decMean <  0.1 
}
% EAM : 2019.11.08 : OK, I get 747 objects from DR2

This returns 747 objects, a significant reduction from the 3867 returned in query \# 2. 

\item \textbf{Select \ippstage{stack} PSF magnitudes for all filters for a rectangular patch of sky}

This is an example of a query to get \ippstage{stack} PSF magnitudes for the same rectangular patch of sky. No restrictions on \ippdbcolumn{nDetections} is necessary, the expectation is that sources on \ippstage{stacks} are more likely to be astrophysical.

% QUERY 05
\texttt{SELECT ObjectThin.objID, raStack, decStack, \\
gPSFMag, gPSFMagErr, rPSFMag, rPSFMagErr,iPSFMag, iPSFMagErr, \\ 
zPSFMag, zPSFMagErr, yPSFMag, yPSFMagErr \\
FROM ObjectThin \\
INNER JOIN StackObjectThin ON ObjectThin.objID = StackObjectThin.objID \\
WHERE raMean >100.0 \\
AND raMean < 100.1 \\
AND decMean > 0.0 \\
AND decMean <  0.1 \\
}
% EAM : 2019.11.08 : OK, I get 1805 objects from DR2

This returns 1805 objects. 

\item \textbf{An example of finding rows with \texttt{NULL} values, using \texttt{TOP} to limit results}

The PSPS uses \texttt{-999} to denote \texttt{NULL} values. The following query returns some objects that are detected in single exposures but not in the stacks. The numbers are limited by TOP to return the first 10 rows.

%{\color{red} its's tested and all is good}

% QUERY 06
\texttt{
SELECT TOP 10 \\
objectThin.objID, raMean, decMean, raStack, decStack, \\
nDetections, ng, nr, ni, nz, ny, imeanpsfmag \\
FROM objectThin \\
JOIN MeanObject on objectThin.objID = meanObject.objid \\
WHERE raStack = -999\\
}
% EAM : 2019.11.08 : OK

\item \textbf{Basic search using \texttt{BETWEEN} to limit ranges}
 
Similar to query \# 5, except uses \texttt{BETWEEN} to limit RA and Dec ranges as well as iPSFMag ranges.

% QUERY 07
\texttt{
SELECT ObjectThin.objID, raStack, decStack, \\
gPSFMag, gPSFMagErr, rPSFMag, rPSFMagErr,iPSFMag, iPSFMagErr, \\ 
zPSFMag, zPSFMagErr, yPSFMag, yPSFMagErr \\
FROM ObjectThin \\
INNER JOIN StackObjectThin ON ObjectThin.objID = StackObjectThin.objID \\
WHERE raMean BETWEEN 100.0 AND 100.1\\
AND decMean  BETWEEN 0.0 AND 0.1  \\
AND iPSFMag  BETWEEN 18.0 AND 21.0  \\
}
% EAM : 2019.11.08 : OK, I get 645 objects from DR2

\item \textbf{Using built-in functions to do a box search}

ObjectThin contains Hierarchical triangular mesh information, making it possible to use the built in function dbo.fGetObjFromRectEq(minra, mindec, maxra, maxdec) to do a rectangular search. Tables which have htm, cx,cy, cz can use this built in function.

% QUERY 08
\texttt{
SELECT o.objID, o.raMean, o.decMean\\
FROM ObjectThin o, dbo.fGetObjFromRectEq(56.65, 23.92, 57.05, 24.32) AS r \\
WHERE o.objID = r.objID \\
}
% EAM : 2019.11.08 : OK, I get 87655 objects from DR2

%% Note the AS is optional 

\item \textbf{Using built in functions to do a cone search}

ObjectThin contains Hierarchical triangular mesh information, making it possible to use the built in function dbo.fGetNearbyObjEq(ra, dec, conesize(deg)) to do a radial search for objects near a given ra and dec (cone search). Tables which have htm, cx,cy, cz can use this built in function.

% QUERY 09
\texttt{
SELECT o.objID, raMean, decMean, gMeanPSFMag, gMeanPSFMagErr \\
FROM ObjectThin AS o \\
JOIN MeanObject AS m ON o.objID = m.objID  \\
JOIN dbo.fGetNearbyObjEq(56.85 , 24.12, 0.2) AS n \\
ON o.objID = n.objID
}
% EAM : 2019.11.10 : OK, I get 40 objects from DR2

\item \textbf{Cone search of high fidelity stellar-like objects}

We want to get all objects with R degrees of a given position that are high fidelity stellar-like objects.
We get all objects within 0.2 degree of RA=334.0 and Dec=0.0 which have mean magnitudes in griz (i.e. at least 1 detection in each band that can be used for the mean mag). In addition, we require QfPerfect $> 0.85$ in all bands. We select stars with small ($<0.05$) difference between Kron and PSF magnitudes.

% QUERY 10
\texttt{
SELECT o.objID,  
o.raMean, o.decMean, o.raMeanErr, o.decMeanErr, 
o.qualityFlag,
o.gMeanPSFMag, o.gMeanPSFMagErr, o.gMeanPSFMagNpt,
o.rMeanPSFMag, o.rMeanPSFMagErr, o.rMeanPSFMagNpt,
o.iMeanPSFMag, o.iMeanPSFMagErr, o.iMeanPSFMagNpt,
o.zMeanPSFMag, o.zMeanPSFMagErr, o.zMeanPSFMagNpt,
o.yMeanPSFMag, o.yMeanPSFMagErr, o.yMeanPSFMagNpt, 
o.rMeanKronMag, o.rMeanKronMagErr,
o.nDetections, o.ng, o.nr, o.ni, o.nz,o.ny,
o.gFlags, o.gQfPerfect,
o.rFlags, o.rQfPerfect,
o.iFlags, o.iQfPerfect,
o.zFlags, o.zQfPerfect,
o.yFlags, o.yQfPerfect,
soa.primaryDetection, soa.bestDetection
INTO mydb.[HighFidelityStarsDR2]
FROM dbo.fGetNearbyObjEq(334, 0.0, 0.2*60.0) as x
JOIN MeanObjectView o on o.objID=x.ObjId
LEFT JOIN StackObjectAttributes AS soa ON soa.objID = x.objID
WHERE o.nDetections>5 
AND soa.primaryDetection>0 
AND o.gQfPerfect>0.85 and o.rQfPerfect>0.85 and o.iQfPerfect>0.85 and o.zQfPerfect>0.85 
AND (o.rmeanpsfmag - o.rmeankronmag < 0.05)
}
% EAM : 2019.11.10 : OK, I get 698 objects from DR2 

\item \textbf{Galaxy Candidates for K2 SN Search}

The Kepler Extra-Galactic Survey (KEGS) is a program using the Kepler telescope to search for supernovae, active galactic nuclei, and other transients in galaxies. We identify galaxies in a suitable redshift range ($z \leq 0.12$) a priori, which will be monitored by K2. Here is an example to select galaxies for Campaign 14. We only select objects with $r \leq 19.5$, and we make a cut on (rmeanpsfmag - rmeankronmag) $\geq 0.05$ in order to remove stars. We only want to use objects for which the majority of pixels were not masked, thus the cut on QFperfect $\geq 0.95$. We also obtain the Petrosian radii in order to be able to select galaxies by size.

% QUERY 11
\texttt{
SELECT  o.objID,
ot.raStack, ot.decStack, ot.raMean, ot.decMean, 
ot.ng,  o.gMeanPSFMag,o.gMeanPSFMagErr,o.gMeanKronMag,o.gMeanKronMagErr,
ot.nr,  o.rMeanPSFMag,o.rMeanPSFMagErr,o.rMeanKronMag,o.rMeanKronMagErr,
ot.ni,  o.iMeanPSFMag,o.iMeanPSFMagErr,o.iMeanKronMag,o.iMeanKronMagErr,
ot.nz,  o.zMeanPSFMag,o.zMeanPSFMagErr,o.zMeanKronMag,o.zMeanKronMagErr,
ot.ny,  o.yMeanPSFMag,o.yMeanPSFMagErr,o.yMeanKronMag,o.yMeanKronMagErr,
o.gQfPerfect, o.rQfPerfect, o.iQfPerfect, o.zQfPerfect, o.yQfPerfect,
ot.qualityFlag, ot.objInfoFlag,
sp.gpetRadius, sp.rpetRadius, sp.ipetRadius, sp.zpetRadius, sp.ypetRadius,
sp.gpetR50,sp.rpetR50,sp.ipetR50,sp.zpetR50,sp.ypetR50,
soa.primaryDetection, soa.bestDetection
       INTO mydb.[C14]
FROM MeanObject AS o
JOIN fgetNearbyObjEq(160.68333, 6.85167 , 8.5*60.0) cone ON cone.objid = o.objID 
JOIN ObjectThin AS ot ON ot.objID = o.objID
LEFT JOIN StackPetrosian AS sp ON sp.objID = o.objID
LEFT JOIN StackObjectAttributes AS soa ON soa.objID = o.objID
 WHERE ot.ni >= 3
     AND ot.ng >= 3
     AND ot.nr >= 3
     AND soa.primaryDetection>0 
     AND (o.rMeanKronMag > 0 AND o.rMeanKronMag <= 19.5 )
     AND (o.gQfPerfect >= 0.95)
     AND (o.rQfPerfect >= 0.95)
     AND (o.iQfPerfect >= 0.95)
     AND (o.zQfPerfect >= 0.95)
     AND (o.rmeanpsfmag - o.rmeankronmag > 0.05)
}
% EAM : 2019.11.10 : OK, I get 162,046 rows from DR2

\item \textbf{Find the objID of a single object}

Star CSS J030521.9+013231 (Catalina Sky Survey), 584630948352256
(GAIA) is an RR Lyrae with period = 0.55547 days and coordinates RA =
46.341468915923 and DEC = 1.54199810825252 (ref. GAIA DR2,
2018yCat.1345....0G). In the following, we obtain the PSF and aperture
photometry light-curves, both forced and unforced, for this star.

First, we generate a myDB table containing the Gaia information for this source by running
the following query against the Gaia DR2 database at MAST:

\texttt{
 SELECT
   source\_id AS ID\_GAIA,
   ra AS RA\_GAIA, dec AS DEC\_GAIA,
   phot\_g\_mean\_mag AS Gmag
   INTO mydb.RRL\_584630948352256
   FROM gaia\_source
   WHERE source\_id = 584630948352256
}

Now we run the following query to extract the Pan-STARRS DR2 information:

% QUERY 12
\texttt{
  SELECT
d.ID\_GAIA,
d.RA\_GAIA as GAIARA,
d.DEC\_GAIA as GAIADec,
d.Gmag,
o.objID,  
o.raMean, o.decMean, o.raMeanErr, o.decMeanErr, 
o.qualityFlag,
o.gMeanPSFMag, o.gMeanPSFMagErr, o.gMeanPSFMagNpt,
o.rMeanPSFMag, o.rMeanPSFMagErr, o.rMeanPSFMagNpt,
o.iMeanPSFMag, o.iMeanPSFMagErr, o.iMeanPSFMagNpt,
o.zMeanPSFMag, o.zMeanPSFMagErr, o.zMeanPSFMagNpt,
o.yMeanPSFMag, o.yMeanPSFMagErr, o.yMeanPSFMagNpt, 
o.rMeanKronMag, o.rMeanKronMagErr,
o.nDetections, o.ng, o.nr, o.ni, o.nz, o.ny,
o.gFlags, o.gQfPerfect,
o.rFlags, o.rQfPerfect,
o.iFlags, o.iQfPerfect,
o.zFlags, o.zQfPerfect,
o.yFlags, o.yQfPerfect,
soa.primaryDetection, soa.bestDetection
 INTO mydb.[RRL\_584630948352256\_PS1]
 FROM mydb.[RRL\_584630948352256] d
CROSS APPLY dbo.fGetNearbyObjEq(46.341468915923, 1.54199810825252, 1.0/60.0) as x
JOIN MeanObjectView o on o.objID=x.ObjId
LEFT JOIN StackObjectAttributes AS soa ON soa.objID = x.objID
WHERE o.nDetections>8 
AND soa.primaryDetection>0 
AND o.gQfPerfect>0.85 and o.rQfPerfect>0.85 and o.iQfPerfect>0.85 and o.zQfPerfect>0.85 
AND (o.rmeanpsfmag - o.rmeankronmag < 0.05)}
% EAM : 2019.11.10 : OK, if we generate the mydb for the RR Lyra star

\item \textbf{Obtain lightcurve for a given object (Detections)}

The query above gives an objID of 109850463414820867 for that RRLyrae star. Knowing the objID it is possible to query to get the lightcurve.  

% QUERY 13
\texttt{
SELECT o.ID\_GAIA, o.GAIARA, o.GAIADec, o.Gmag,
o.objID, o.raMean, o.decMean,
d.ra, d.dec, d.raErr, d.decErr, 
d.detectID, d.obstime, d.exptime, d.airmass, d.psfflux, d.psffluxErr, 
d.psfQf, d.psfQfPerfect, d.psfLikelihood, d.psfChiSq, d.extNSigma, d.zp, d.apFlux, d.apFluxErr,
d.imageID, d.filterID,
d.sky, d.skyerr, d.infoflag, d.infoflag2, d.infoflag3,
o.qualityFlag,
o.gMeanPSFMag, o.gMeanPSFMagErr, o.gMeanPSFMagNpt,
o.rMeanPSFMag, o.rMeanPSFMagErr, o.rMeanPSFMagNpt,
o.iMeanPSFMag, o.iMeanPSFMagErr, o.iMeanPSFMagNpt,
o.zMeanPSFMag, o.zMeanPSFMagErr, o.zMeanPSFMagNpt,
o.yMeanPSFMag, o.yMeanPSFMagErr, o.yMeanPSFMagNpt, 
o.rMeanKronMag, o.rMeanKronMagErr,
o.nDetections, o.ng, o.nr, o.ni, o.nz,o.ny,
o.gFlags, o.gQfPerfect,
o.rFlags, o.rQfPerfect,
o.iFlags, o.iQfPerfect,
o.zFlags, o.zQfPerfect,
o.yFlags, o.yQfPerfect,
o.primaryDetection, o.bestDetection 
INTO mydb.[RRL\_584630948352256\_PS1det]
FROM mydb.[RRL\_584630948352256\_PS1] o
JOIN Detection d on d.objID = o.objID
}
% EAM : 2019.11.10 : OK, 91 detections

\showfigure{rrlyrae_PS1.tex}

\item \textbf{Obtain lightcurve for a given object (Forced photometry)}

Similar to the query above, except this one provides the forced photometry for the star with objID = 109850463414820867.

% QUERY 14
\texttt{
SELECT o.ID\_GAIA,o.GAIARA, o.GAIADec, o.Gmag, 
o.objID, o.raMean, o.decMean,
fwm.detectID, fwm.obstime, fwm.exptime, fwm.airmass, fwm.Fpsfflux, fwm.FpsffluxErr, fwm.FpsfQf, fwm.FpsfQfPerfect, fwm.FpsfChiSq, fwm.zp, fwm.FapFlux, fwm.FapFluxErr,
fwm.forcedWarpID, fwm.filterID,
fwm.Fsky, fwm.Fskyerr, fwm.Finfoflag, fwm.Finfoflag2, fwm.Finfoflag3,
o.qualityFlag,
o.gMeanPSFMag, o.gMeanPSFMagErr, o.gMeanPSFMagNpt,
o.rMeanPSFMag, o.rMeanPSFMagErr, o.rMeanPSFMagNpt,
o.iMeanPSFMag, o.iMeanPSFMagErr, o.iMeanPSFMagNpt,
o.zMeanPSFMag, o.zMeanPSFMagErr, o.zMeanPSFMagNpt,
o.yMeanPSFMag, o.yMeanPSFMagErr, o.yMeanPSFMagNpt,
o.rMeanKronMag, o.rMeanKronMagErr,
o.nDetections, o.ng, o.nr, o.ni, o.nz,o.ny,
o.gFlags, o.gQfPerfect,
o.rFlags, o.rQfPerfect,
o.iFlags, o.iQfPerfect,
o.zFlags, o.zQfPerfect,
o.yFlags, o.yQfPerfect,
o.primaryDetection, o.bestDetection
INTO mydb.[RRL\_584630948352256\_PS1forced]
FROM mydb.[RRL\_584630948352256\_PS1] o
JOIN ForcedWarpMeasurement fwm on fwm.objID = o.objID
}
% EAM : 2019.11.10 : OK, 84 detections (why fewer than #13?)


%\item \textbf{Different kinds of joins}

%SQL Server INNER JOIN (or sometimes called simple join)
%SQL Server LEFT OUTER JOIN (or sometimes called LEFT JOIN)
%SQL Server RIGHT OUTER JOIN (or sometimes called RIGHT JOIN)
%SQL Server FULL OUTER JOIN (or sometimes called FULL JOIN)

%\item selection of random rows using rand() 

%\item selection of random rows using randomId

%\item group by 

%\item order by 

%\item Using Multiple Joins to get \ippstage{stack} information

%\item flag methods

%\item {\color{red} query to download the catalog (stacks) EAM / KCC}
 
%\item {\color{red} query to download the catalog (mean) EAM / KCC}


%\item \textbf{Extracting a light curve for an object with a known \ippdbcolumn{objID} using the Detection table(DR2)}

%The detection table has the measurements for the single epoch images.  Searching by the \ippdbcolumn{objID} is the fastest method to return a lightcurve.

%{\color{red}(TEST XXX)}

%\texttt{SELECT filterID, obstime, expTime, zp, psfFlux, psfFluxErr, infoFlag, infoFlag2, infoFlag3 FROM Detection WHERE objID = (number XXX ) 
%}

%\item extracting a light curve for an object by RA and Dec using the Detection table (DR2)

%If the \ippdbcolumn{objID} of the object is not know, it is necessary to do a join on \ippdbtable{ObjectThin} to search by RA and Dec.  This method is much slower than to search by the \ippdbcolumn{objID}.

%\item extracting a light curve for an object  with a known \ippdbcolumn{objID} using the \ippdbtable{ForcedWarpMeasurement} table(DR2)

%\item extracting a light curve for an object by RA and Dec using the \ippdbtable{ForcedWarpMeasurement} table (DR2)

%\item extracting a light curve for an object  with a known \ippdbcolumn{objID} using the \ippdbtable{DiffDetection} table(DR2)

%\item extracting a light curve for an object by RA and Dec using the \ippdbtable{DiffDetection} table (DR2)

\end{enumerate}

%\end{document}

%1.3.3.1 Choosing the appropriate photometric measurement
%1.3.3.1.1 chip,stack,warp
%1.3.3.1.2 psf, kron, etc
%1.3.3.2 Cone search
%1.3.3.3 complex extraction
%1.3.3.4 SQL quick guide 
%1.3.3.5 CAS Jobs


%HAF taken out for now, becus not even attempted at being flshed out
%\section{Glossary}
%\label{sec:glossary}

%\begin{description}

%\item[chip]  refers to either one of the 60 OTAs that makes up the gigapixel camera, or to the stage of processing within IPP which does basic astrometry and photometry on 

%\item[detrend] depends on the use. Detrends in general refer to flats / biases / darks etc necessary to correct raw images.  Detrending is the process to remove effects from flats/ biases / darks etc from raw science images.  Detrended images are the images that have been corrected with flats/ biases/ darks/ etc. 

%\item[forced photometry ]

%\item[forced warp]

%\item[skycell]

%\item[stack] 

%\item[ubercal]

%\item[warp]

%\item[cmf/smf files]

%\end{description}

\section{Abbreviations and Acronyms}
\label{sec:acronyms}

\begin{description}

\item[3pi or 3$\pi$] Three Pi Survey. This survey covers 3 pi steradians of the sky (3/4 of the sky), everything with declination greater than -30 degrees.

\item[DR1]  Data Release 1.  Covers 3$\pi$ data release for ObjectThin, MeanObject, Stack*, ForcedMean* and related metadata tables. Covers the static sky.

\item[DR2]  Data Release 2. 3$\pi$ data release of time domain tables, including Detection, ForcedWarp*, Diff* and related metadata.

\item[DVO]  Desktop Virtual Observatory - written by Eugene Mangier, IPP uses this to store and manipulate catalog data. 

\item[GPC1]  Giga Pixel Camera 1.  This is the name of the camera that is part of the \PS\ telescope.  1.4 gigapixels, and sees 7 square degrees per exposure.  It is made up of 60 orthogonal transfer arrays (OTA), each with 64 cells per OTA.  

\item[IPP]  Image Processing Pipeline.  Code developed to process and manage all aspects of \PS processing, starting from downloading the images to the summit to generating data in the final database schema form.

\item[MD]  Short for Medium Deep fields. A set of 10 fields, each of which is 7 square degrees, observed at a high cadence primarily to be used for searches for transient objects.  These will be released at a later time.

\item[MOPS]  Short for Medium Deep fields. A set of 10 fields, each of which is 7 square degrees, observed at a high cadence primarily to be used for searches for transient objects.  These will be released at a later time.

\item[OTA]  orthogonal transfer array, the name of the devices that make up the GPC1 camera

\item[PSI]  \PS\ Science interface. The interface used by consortium members to access earlier versions of the data.

\item[PSPS]  Published Science Products Subsystem - the \PS\ databases

%\item[PSVO]  \PS\ Virtual Observatory - one of several ways to access the \PS\ databases, see (link xxx) for details.  Uses a TopCat front end.

\item[PV3]  Processing Version 3, refers to the processing / code iteration, this is the processing version of the first public \PS data release (covers DR1-DR2).

\end{description}

\newpage

\section{Flag Tables}
\label{sec:FlagTables}
 
%% EAM : these descriptions duplicate section 7.2.1

There are 8 different classes of Flag tables for the database schema.
This section lists the different flags as well as their descriptions.
See Section~\ref{sec:schemaflagsbitmasks} for more details on flags and
bitmasks, and Appendix~\ref{sec:query} for some example queries.

%% \begin{description}
%% \item[ObjectInfoFlags] Describes the flag bits used for: ObjectThin.objectInfoFlag, GaiaFrameCoordinate.gaiaFlag, DiffDetObject.objectInfoFlag, ForcedMeanObject.gFlag, ForcedMeanObject.rFlag, ForcedMeanObject.iFlag, ForcedMeanObject.zFlag, ForcedMeanObject.yFlag.
%% See Table~\ref{table:objectinfoflags}
%% 
%% 
%% \item[ObjectQualityFlags] Describes the flags used for: ObjectThin.qualityFlag, DiffDetObject.qualityFlag.
%% See Table~\ref{table:objectqualityflags}
%% 
%% 
%% \item[ObjectFilterFlags] Describes the flags used for: MeanObject.gFlags, MeanObject.rFlags, MeanObject.iFlags, MeanObject.zFlags, MeanObject.yFlags, StackObjectThin.gInfoFlag4, StackObjectThin.rInfoFlag4, StackObjectThin.iInfoFlag4, StackObjectThin.zInfoFlag4, StackObjectThin.yInfoFlag4,.
%% See Table~\ref{table:objectfilterflags}
%% 
%% \item[ImageFlags] Describes the flags used for: ImageMeta.qaFlags.
%% See Table~\ref{table:imageflags}
%% 
%% \item[DetectionFlags] Describes the flags used for: Detection.infoFlag, StackObjectThin.ginfoFlag, StackObjectThin.rinfoFlag , StackObjectThin.iinfoFlag, StackObjectThin.zinfoFlag, StackObjectThin.yinfoFlag, DiffDetection.DinfoFlag, ForcedWarpMeasurement.FinfoFlag.
%% See Table~\ref{table:detectionflags}
%% 
%% \item[DetectionFlags2] Describes the flags used for: Detection.infoFlag2, StackObjectThin.ginfoFlag2, StackObjectThin.rinfoFlag2 , StackObjectThin.iinfoFlag2, StackObjectThin.zinfoFlag2, StackObjectThin.yinfoFlag2,  DiffDetection.DinfoFlag2,ForcedWarpMeasurement.FinfoFlag2.
%% See Table~\ref{table:detectionflags2}
%% 
%% \item[DetectionFlags3] Describes the flags used for: Detection.infoFlag3, StackObjectThin.ginfoFlag3, StackObjectThin.rinfoFlag3 , StackObjectThin.iinfoFlag3, StackObjectThin.zinfoFlag3, StackObjectThin.yinfoFlag3,  DiffDetection.DinfoFlag3,ForcedWarpMeasurement.FinfoFlag3.
%% See Table~\ref{table:detectionflags3}
%% 
%% \item[ForcedGalaxyShapeFlags] Describes the flags used for: ForcedGalaxyShape.gGalFlags, ForcedGalaxyShape.rGalFlags, ForcedGalaxyShape.iGalFlags, ForcedGalaxyShape.zGalFlags, ForcedGalaxyShape.yGalFlags. 
%% See Table~\ref{table:forcedgalaxyshapeflags}
%% 
%% \end{description}
%% 
%% \note{table order is a bit funny; compare with text}

\begin{table}[b]
\caption{ObjectInfoFlags}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{llll}
\hline
\hline
Name & Hexadecimal & Value & Description \\
\hline
DEFAULT & 0x00000000 & 0 & Initial value; resets all bits. \\
FEW&0x00000001&1&Used within relphot; skip star.\\
POOR&0x00000002&2&Used within relphot; skip star.\\
ICRF\_QSO&0x00000004&4&Object IDed with known ICRF quasar \\
       &    &     & (may have ICRF position measurement)\\
HERN\_QSO\_P60&0x00000008&8&Identified as likely QSO (Hernitschek et al 2015);  \\
      &     &      & P\_QSO $>=$ 0.60\\
HERN\_QSO\_P05&	0x00000010&	16& 	Identified as possible QSO (Hernitschek et al 2015), P\_QSO $>=$ 0.05\\ 
HERN\_RRL\_P60&	0x00000020&	32 &	Identified as likely RR Lyra (Hernitschek et al 2015), P\_RRLyra $>=$ 0.60\\
HERN\_RRL\_P05&	0x00000040&	64 &	Identified as possible RR Lyra (Hernitschek et al 2015), P\_RRLyra $>=$ 0.05\\
HERN\_VARIABLE&	0x00000080&	128 &	Identified as a variable based on ChiSq? (Hernitschek et al 2015)\\
TRANSIENT&	0x00000100&	256& 	Identified as a non-periodic (stationary) transient\\
HAS\_SOLSYS\_DET&	0x00000200&	512& 	At least one detection identified with a known solar-system object (asteroid or other).\\
MOST\_SOLSYS\_DET&	0x00000400&	1024 &	Most detections identified with a known solar-system object (asteroid or other). \\
LARGE\_PM&0x00000800&2048&Star with large proper motion\\
RAW\_AVE&0x00001000&4096&Simple weighted average position was used (no IRLS fitting)\\
FIT\_AVE&0x00002000&8192&Average position was fitted\\
FIT\_PM&0x00004000&16384&Proper motion model was fitted\\
FIT\_PAR&0x00008000&32768&Parallax model was fitted\\
USE\_AVE&0x00010000&65536&Average position used (not PM or PAR)\\
USE\_PM&0x00020000&131072&Proper motion used (not AVE or PAR)\\
USE\_PAR&0x00040000&262144&Parallax used (not AVE or PM)\\
NO\_MEAN\_ASTROM&0x00080000&524288&Mean astrometry could not be measured\\
STACK\_FOR\_MEAN&0x00100000&1048576&Stack position used for mean astrometry\\
MEAN\_FOR\_STACK&0x00200000&2097152&Mean astrometry used for \ippstage{stack} position\\
BAD\_PM&0x00400000&4194304&Failure to measure proper-motion model\\
EXT&0x00800000&8388608&Extended in our data (eg; PS)\\
EXT\_ALT&0x01000000&16777216&Extended in external data (eg; 2MASS)\\
GOOD&0x02000000&33554432&Good-quality measurement in our data (eg; PS)\\
GOOD\_ALT&0x04000000&67108864&Good-quality measurement in  external data (eg; 2MASS)\\
GOOD\_STACK&0x08000000&134217728&Good-quality object in the \ippstage{stack} ($>$ 1 good stack measurement)\\
BEST\_STACK&0x10000000&268435456&The primary \ippstage{stack} measurements are the best measurements\\
SUSPECT\_STACK&0x20000000&536870912&Suspect object in the \ippstage{stack}\\
     &   &    &  (no more than 1 good measurement, 2 or more suspect or good stack measurement)\\
BAD\_STACK&0x40000000&1073741824&Poor-quality \ippstage{stack} object (no more than 1 good or suspect measurement)\\
\hline
\end{tabular}%}
\end{center}
\label{table:objectinfoflags}
\end{table}%
% \FloatBarrier

% \FloatBarrier
\begin{table}[b]
\caption{ObjectQualityFlags}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{llll}
\hline
\hline
Name & Hexadecimal & Value & Description \\
\hline
DEFAULT&0x00000000&0&Initial value; resets all bits. \\
QF\_OBJ\_EXT&0x00000001&1&Extended in our data (eg; PS). \\
QF\_OBJ\_EXT\_ALT&0x00000002&2&Extended in external data (eg; 2MASS). \\
QF\_OBJ\_GOOD&0x00000004&4&Good-quality measurement in our data (eg; PS). \\
QF\_OBJ\_GOOD\_ALT&0x00000008&8&Good-quality measurement in  external data (eg; 2MASS). \\
QF\_OBJ\_GOOD\_STACK&0x00000010&16&Good-quality object in the \ippstage{stack} ($>$ 1 good stack measurement). \\
QF\_OBJ\_BEST\_STACK&0x00000020&32&The primary stack measurements are the best measurements.\\
QF\_OBJ\_SUSPECT\_STACK&0x00000040&64&Suspect object in the \ippstage{stack}\\
& & & (no more than 1 good measurement, 2 or more suspect or good stack measurement). \\
QF\_OBJ\_BAD\_STACK&0x00000080&128&Poor-quality \ippstage{stack} object (no more than 1 good or suspect measurement). \\
\hline
\end{tabular}%}
\end{center}
\label{table:objectqualityflags}
\end{table}%

\begin{table}[b]
\caption{ObjectFilterFlags}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{llll}
\hline
\hline
Name & Hexadecimal & Value & Description \\
\hline
DEFAULT&0x00000000&0&Initial value; resets all bits.\\
SECF\_STAR\_FEW&0x00000001&1&Used within relphot: skip star.\\
SECF\_STAR\_POOR&0x00000002&2&Used within relphot: skip star.\\
SECF\_USE\_SYNTH&0x00000004&4&Synthetic photometry used in average measurement.\\
SECF\_USE\_UBERCAL&0x00000008&8&Ubercal photometry used in average measurement.\\
SECF\_HAS\_PS1&0x00000010&16&PS1 photometry used in average measurement.\\
SECF\_HAS\_PS1\_STACK&0x00000020&32&PS1 \ippstage{stack} photometry exists.\\
SECF\_HAS\_TYCHO&0x00000040&64&Tycho photometry used for synthetic magnitudes.\\
SECF\_FIX\_SYNTH&0x00000080&128&Synthetic magnitudes repaired with zeropoint map.\\
SECF\_RANK\_0&0x00000100&256&Average magnitude calculated in 0th pass.\\
SECF\_RANK\_1&0x00000200&512&Average magnitude calculated in 1st pass.\\
SECF\_RANK\_2&0x00000400&1024&Average magnitude calculated in 2nd pass.\\
SECF\_RANK\_3&0x00000800&2048&Average magnitude calculated in 3rd pass.\\
SECF\_RANK\_4&0x00001000&4096&Average magnitude calculated in 4th pass.\\
SECF\_STACK\_PRIMARY&0x00004000&16384&PS1 \ippstage{stack} photometry comes from primary skycell.\\
SECF\_STACK\_BESTDET&0x00008000&32768&PS1 \ippstage{stack} best measurement is a detection (not forced).\\
SECF\_STACK\_PRIMDET&0x00010000&65536&PS1 stack primary measurement is a detection (not forced).\\
SECF\_STACK\_PRIMARY\_MULTIPLE &0x00020000&131072&PS1 stack object has multiple primary measurements (DR2).\\
SECF\_HAS\_SDSS&0x00100000&1048576&This photcode has SDSS photometry.\\
SECF\_HAS\_HSC& 0x00200000&2097152&This photcode has HSC photometry.\\
SECF\_HAS\_CFH& 0x00400000&4194304&This photcode has CFH photometry (mostly megacam).\\
SECF\_HAS\_DES& 0x00800000&8388608&This photcode has DES photometry.\\
SECF\_OBJ\_EXT& 0x01000000&16777216&Extended in this band.\\
\hline
\end{tabular}%}
\end{center}
\label{table:objectfilterflags}
\end{table}%

\begin{table}[b]
\caption{ImageFlags}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{llll}
\hline
\hline
Name & Hexadecimal & Value & Description \\
\hline
NEW&0x00000000&0&No relphot / relastro attempted. \\
PHOTOM\_NOCAL&0x00000001&1&Used within relphot to mean 'don't apply fit'. \\
PHOTOM\_POOR&0x00000002&2&Relphot says image is bad (dMcal $>$ limit). \\
PHOTOM\_SKIP&0x00000004&4&External information image has bad photometry. \\
PHOTOM\_FEW&0x00000008&8&Currently too few measurements for good value for photometry. \\
ASTROM\_NOCAL&0x00000010&16&User-set value used within relastro: ignore. \\
ASTROM\_POOR &0x00000020&32&Relastro says image is bad (dR,dD $>$ limit). \\
ASTROM\_FAIL &0x00000040&64&Relastro fit diverged, fit not applied.\\
ASTROM\_SKIP &0x00000080&128&External information image has bad astrometry.\\
ASTROM\_FEW& 0x00000100&256&Currently too few measurements for good value for astrometry.\\
PHOTOM\_UBERCAL&0x00000200&512&Externally-supplied photometry zero point from ubercal analysis.\\ 
ASTROM\_GMM &0x00000400&1024&Image was fitted to positions corrected by the galaxy motion model.\\
\hline
\end{tabular}%}
\end{center}
\label{table:imageflags}
\end{table}%

\begin{table}[b]
\caption{ForcedGalaxyShapeFlags}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{llll}
\hline
\hline
Name & Hexadecimal & Value & Description \\
\hline
NO\_ERROR&0x00000000&0&No error condition raised. \\
FAIL\_FIT&0x00000001&1&Fit failed to converge or was degenerate \\
TOO\_FEW&0x00000002&2&Not enough points to fit the model \\
OUT\_OF\_RANGE&0x00000004&4&Fit minimum too far outside data range \\
BAD\_ERROR&0x00000008&8&Invalid size error (nan or inf) \\
\hline
\end{tabular}%}
\end{center}
\label{table:forcedgalaxyshapeflags}
\end{table}%

\begin{table}[b]
\caption{DetectionFlags}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{llll}
\hline
\hline
Name & Hexadecimal & Value & Description \\
\hline
DEFAULT&0x00000000&0&Initial value; resets all bits.\\
PSFMODEL&0x00000001&1&Source fitted with a psf model (linear or non-linear).\\
EXTMODEL&0x00000002&2&Source fitted with an extended-source model.\\
FITTED&0x00000004&4&Source fitted with non-linear model (PSF or EXT; good or bad).\\
FAIL&0x00000008&8&Fit (non-linear) failed (non-converge; off-edge; run to zero).\\
POOR&0x00000010&16&Fit succeeds; but low-S/N; high-Chisq; or large (for PSF -- drop?).\\
PAIR&0x00000020&32&Source fitted with a double PSF.\\
PSFSTAR&0x00000040&64&Source used to define PSF model.\\
SATSTAR&0x00000080&128&Source model peak is above saturation.\\
BLEND&0x00000100&256&Source is a blend with other sources.\\
EXTERNAL&0x00000200&512&Source based on supplied input position.\\
BADPSF&0x00000400&1024&Failed to get good estimate of object's PSF.\\
DEFECT&0x00000800&2048&Source is thought to be a defect.\\
SATURATED&0x00001000&4096&Source is thought to be saturated pixels (bleed trail).\\
CR\_LIMIT&0x00002000&8192&Source has crNsigma above limit.\\
EXT\_LIMIT&0x00004000&16384&Source has extNsigma above limit.\\
MOMENTS\_FAILURE&0x00008000&32768&Could not measure the moments.\\
SKY\_FAILURE&0x00010000&65536&Could not measure the local sky.\\
SKYVAR\_FAILURE&0x00020000&131072&Could not measure the local sky variance.\\
BELOW\_MOMENTS\_SN&0x00040000&262144&Moments not measured due to low S/N.\\
UNDEF\_1&0x00080000&524288&Unused bit value.\\
BIG\_RADIUS&0x00100000&1048576&Poor moments for small radius; try large radius.\\
AP\_MAGS&0x00200000&2097152&Source has an aperture magnitude.\\
BLEND\_FIT&0x00400000&4194304&Source was fitted as a blend.\\
EXTENDED\_FIT&0x00800000&8388608&Full extended fit was used.\\
EXTENDED\_STATS&0x01000000&16777216&Extended aperture stats calculated.\\
LINEAR\_FIT&0x02000000&33554432&Source fitted with the linear fit.\\
NONLINEAR\_FIT&0x04000000&67108864&Source fitted with the non-linear fit.\\
RADIAL\_FLUX&0x08000000&134217728&Radial flux measurements calculated.\\
SIZE\_SKIPPED&0x10000000&268435456&Size could not be determined.\\
PEAK\_ON\_SPIKE&0x20000000&536870912&Peak lands on diffraction spike.\\
PEAK\_ON\_GHOST&0x40000000&1073741824&Peak lands on ghost or glint.\\
PEAK\_OFF\_CHIP&0x80000000&2147483648&Peak lands off edge of chip.\\
\hline
\end{tabular}%}
\end{center}
\label{table:detectionflags}
\end{table}%

\begin{table}[b]
\caption{DetectionFlags2}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{llll}
\hline
\hline
Name & Hexadecimal & Value & Description \\
\hline
DEFAULT&0x00000000&0&Initial value; resets all bits.\\
DIFF\_WITH\_SINGLE&0x00000001&1&Difference source matched to a single positive detection.\\
DIFF\_WITH\_DOUBLE&0x00000002&2&Difference source matched to positive detections in both images.\\
MATCHED&0x00000004&4&Source generated based on another image (forced photometry \\
&&&at source location).\\
ON\_SPIKE&0x00000008&8&More than 25\% of (PSF-weighted) pixels land on diffraction spike.\\
ON\_STARCORE&0x00000010&16&More than 25\% of (PSF-weighted) pixels land on starcore.\\
ON\_BURNTOOL&0x00000020&32&More than 25\% of (PSF-weighted) pixels land on burntool.\\
ON\_CONVPOOR&0x00000040&64&More than 25\% of (PSF-weighted) pixels land on convpoor.\\
PASS1\_SRC&0x00000080&128&Source detected in first pass analysis\\
HAS\_BRIGHTER\_NEIGHBOR&0x00000100&256&Peak is not the brightest in its footprint\\
BRIGHT\_NEIGHBOR\_1&0x00000200&512& Flux\_negative $/$ ($r^2$ flux\_positive) $>$  1.\\
BRIGHT\_NEIGHBOR\_10&0x00000400&1024&Flux\_negative $/$ ($r^2$ flux\_positive) $ >$ 10.\\
DIFF\_SELF\_MATCH&0x00000800&2048&Positive detection match is probably this source.\\
SATSTAR\_PROFILE&0x00001000&4096&Saturated source is modeled with a radial profile.\\
ECONTOUR\_FEW\_PTS&0x00002000&8192&Too few points to measure the elliptical contour.\\
RADBIN\_NAN\_CENTER&0x00004000&16384&Radial bins failed with too many NaN center bin.\\
PETRO\_NAN\_CENTER&0x00008000&32768&Petrosian (1976) radial bins failed with too many NaN center bin.\\
PETRO\_NO\_PROFILE&0x00010000&65536&Petrosian (1976) not built becaues radial bins missing.\\
PETRO\_INSIG\_RATIO&0x00020000&131072&Insignificant measurement of Petrosian (1976) ratio.\\
PETRO\_RATIO\_ZEROBIN&0x00040000&262144&Petrosian (1976) ratio in the 0th bin (likely bad).\\
EXT\_FITS\_RUN&0x00080000&524288&Attempted to run extended fits on this source.\\
EXT\_FITS\_FAIL&0x00100000&1048576&At least one of the model fits failed.\\
EXT\_FITS\_RETRY&0x00200000&2097152&One of the model fits was retried with new window.\\
EXT\_FITS\_NONE&0x00400000&4194304&All of the model fits failed. \\
\hline
\end{tabular}%}
\end{center}
\label{table:detectionflags2}
\end{table}%

\begin{table}[b]
\caption{DetectionFlags3}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{llll}
\hline
\hline
Name & Hexadecimal & Value & Description \\
\hline
DEFAULT&0x00000000&0&Initial value; resets all bits.\\
NOCAL&0x00000001&1&Detection ignored for this analysis (photcode; time range) -- internal only.\\
POOR\_PHOTOM&0x00000002&2&Detection is photometry outlier.\\
SKIP\_PHOTOM&0x00000004&4&Detection was ignored for photometry measurement.\\
AREA&0x00000008&8&Detection near image edge.\\
POOR\_ASTROM&0x00000010&16&Detection is astrometry outlier.\\
SKIP\_ASTROM&0x00000020&32&Detection was ignored for astrometry measurement.\\
USED\_OBJ&0x00000040&64&Detection was used during update objects\\
USED\_CHIP&0x00000080&128&Detection was used during update chips to measure astrometry with IRLS fit.\\
BLEND\_MEAS&0x00000100&256&Detection is within radius of multiple objects.\\
BLEND\_OBJ&0x00000200&512&Multiple detections within radius of object.\\
WARP\_USED&0x00000400&1024&Measurement used to find mean \ippstage{warp} photometry.\\
UNMASKED\_ASTRO&0x00000800&2048&Detection was unmasked in update chips to determine astrometry parameter errors.\\
BLEND\_MEAS\_X&0x00001000&4096&Detection is within radius of multiple objects across catalogs.\\
ARTIFACT&0x00002000&8192&Detection is thought to be non-astronomical.\\
SYNTH\_MAG&0x00004000&16384&Magnitude is synthetic.\\
PHOTOM\_UBERCAL&0x00008000&32768&Externally-supplied zero point from ubercal analysis.\\
STACK\_PRIMARY&0x00010000&65536&This \ippstage{stack} measurement is in the primary skycell.\\
STACK\_PHOT\_SRC&0x00020000&131072&This measurement supplied the \ippstage{stack} photometry.\\
ICRF\_QSO&0x00040000&262144&This measurement is an ICRF reference position.\\
IMAGE\_EPOCH&0x00080000&524288&This measurement is registered to the image epoch \\
&  &   & (not tied to the reference catalog epoch).\\
PHOTOM\_PSF&0x00100000&1048576&This measurement is used for the mean PSF magnitude.\\
PHOTOM\_APER&0x00200000&2097152&This measurement is used for the mean aperture magnitude.\\
PHOTOM\_KRON&0x00400000&4194304&This measurement is used for the mean Kron (1980) magnitude.\\
MASKED\_PSF& 0x01000000&16777216&This measurement is masked based on IRLS weights for the mean PSF magnitude.\\
MASKED\_APER&0x02000000&33554432&This measurement is masked based on IRLS weights for the mean aperture magnitude.\\
MASKED\_KRON&     0x04000000&67108864&This measurement is masked based on IRLS weights for the mean Kron (1980) magnitude.\\
OBJECT\_HAS\_2MASS&0x10000000&268435456&This measurement comes from an object with 2MASS data.\\
OBJECT\_HAS\_GAIA& 0x20000000&536870912&This measurement comes from an object with Gaia data.\\
OBJECT\_HAS\_TYCHO&0x40000000&1073741824&This measurement comes from an object with Tycho data.\\
\hline
\end{tabular}%}
\end{center}
\label{table:detectionflags3}
\end{table}%

%removing this section

%\section{System Metadata Tables}
%\label{sec:systemmetadatatables}
%The system metadata tables are small and fixed.  To aid the user, we include them in the appendix. They can also be queried for directly in the database via \texttt{SELECT * FROM (tablename)}.


%\begin{itemize}
%\item Filter
%\item FitModel
%%\item Survey
%\item PhotoCal
%\item StackType
%\item DiffType
%\item TessellationType
%\end{itemize}

% EAM : 2019.11.11 : not needed
% \begin{table}
% \caption{Filter}
% \begin{center}
% %\resizebox{\textwidth}{!}{%
% \begin{tabular}{ll}
% \hline
% \hline
% FilterID & Filter \\
% \hline
% 1 & g\\
% 2 & r\\
% 3 &  i\\
% 4 & z\\
% 5 & y\\
% \hline
% \end{tabular}
% \end{center}
% \label{table:filters}
% \end{table}%

%setting aside for now
%\begin{table}
%\caption{FitModel}
%\begin{center}
%%\resizebox{\textwidth}{!}{%
%\begin{tabular}{lllllllllllll}
%\hline
%\hline
%fitModelID&name&description&param1&param2&param3&param4&param5&param6&param7&param8&param9&param10\\
%\hline
%0&PS\_MODEL\_GAUSS&Gaussian Profile&local sky&Io (normalization)&X position&Y position&Sigma\_XX&Sigma\_YY&Sigma\_XY&-999&-999&-999\\
%1&PS\_MODEL\_PGAUSS&Pseudo-Gaussian Profile (Waussian)&local sky&Io (normalization)&X position&Y position&Sigma\_XX&Sigma\_YY&Sigma\_XY&-999&-999&-999\\
%2&PS\_MODEL\_QGAUSS&Power-law with $r^{4.5}$&local sky&Io (normalization)&X position&Y position&Sigma\_XX&Sigma\_YY&Sigma\_XY&k (core scale)&-999&-999\\
%3&PS\_MODEL\_PS1\_V1&Power-law with $r^{3.33}$&local sky&Io (normalization)&X position&Y position&Sigma\_XX&Sigma\_YY&Sigma\_XY&k (core scale)&-999&-999\\
%4&PS\_MODEL\_RGAUSS&Power-law with fitted radial exponent&local sky&Io (normalization)&X position&Y position&Sigma\_XX&Sigma\_YY&Sigma\_XY&power-law slope&-999&-999\\
%5&PS\_MODEL\_SERSIC&\citet{Sersic1963} Galaxy Model Fit&local sky&Io (normalization)&X position&Y position&Sigma\_XX&Sigma\_YY&Sigma\_XY&Sersic index&-999&-999\\
%6&PS\_MODEL\_EXP&Exponential Galaxy Model&local sky&Io (normalization)&X position&Y position&Sigma\_XX&Sigma\_YY&Sigma\_XY&-999&-999&-999\\
%7&PS\_MODEL\_DEV&deVaucouleur (1948) Galaxy Model Fit&local sky&Io (normalization)&X position&Y position&Sigma\_XX&Sigma\_YY&Sigma\_XY&-999&-999&-999\\
%8&PS\_MODEL\_TRAIL&Trailed Asteroid Fit&local sky&Io (normalization)&X position&Y position&Length&position angle&PSF sigma&-999&-999&-999\\
%\hline
%\end{tabular}}
%\end{center}
%\label{table:psmodel}
%\end{table}%


%% HAF removing this for now, MH suggests it's not useful
%\begin{table}
%\caption{Survey}
%\begin{center}
%\resizebox{\textwidth}{!}{%
%\begin{tabular}{lll}
%\hline
%\hline
%surveyID&name&description\\
%\hline
%0&3PI&PS1 3PI Survey\\
%1&MD01&PS1 MD01 XMM-LSS-DXS 022224-043000\\
%2&MD02&PS1 MD02 CDFS/GOODS/GEMS 033224-274800\\
%3&MD03&PS1 MD03 IFA/Lynx 084300+444000\\
%4&MD04&PS1 MD04 COSMOS 100000+021200\\
%5&MD05&PS1 MD05 Lockman-DXS 110000+570000\\
%6&MD06&PS1 MD06 NGC 4258 121857+471814\\
%7&MD07&PS1 MD07 VISTA-Video1 140000+050000\\
%8&MD08&PS1 MD08 EliasN1-DXS 160000+570000\\
%9&MD09&PS1 MD09 Vimos4-DXS-SSA 220000+003000\\
%10&MD10&PS1 MD10 Deep2 233000+000000\\
%11&M31&PS1 M31 Andromeda 004242+411600\\
%12&STS1&PS1 STS1 Outskirts of Bulge 195048+170339\\
%13&CAL01&PS1 Cal North Pole 000000+900000\\
%14&CAL02&PS1 Cal SA92 Dense Landolt Std Field 005808+004232\\
%15&CAL03&PS1 Cal Perseus Cluster / Abell 426 031900+413300\\
%16&CAL04&PS1 Cal SA95 Dense Landolt Std Field 065207+001710\\
%17&CAL05&PS1 Cal Taurus dark cloud (diverse extinction) 043000+250000\\
%18&CAL06&PS1 Cal SA98 Densle Landolt Std Field 065207+001710\\
%19&CAL07&PS1 Cal M81-M82-HolmIX (Local Group) 095640+692200\\
%20&CAL08&PS1 Cal Virgo Cluster (Center) 123000+130000\\
%21&CAL09&PS1 Cal Hercules Cluster (Center) 160508+1745+28\\
%22&CAL10&PS1 Cal M17-M24 Region 181400+000544\\
%23&CAL11&PS1 Cal SA110 Dense Landolt Std Field 184207+000544\\
%24&CAL12&PS1 Cal Kepler Mission Astrometric field 192240+443000\\
%25&CAL13&PS1 Cal 3C454.1 (Northern field) 225033+712919\\
%26&STS2&PS1 STS2 Hyades 004000+150000\\
%27&STS3&PS1 STS3 Praesepe 083000+200000\\
%28&SSS&PS1 Solar System Sweet Spot Survey\\
%29&CNP&PS1 Celestial North Pole Survey\\
%30&SAS&PS1 SAS\\
%254&UNK&PS1 undefined\\
%\hline
%\end{tabular}
%\end{center}
%\label{table:surveys}
%\end{table}%



%% HAF removing this for now, MH suggests its not usefule
%\begin{table}
%\caption{Photcal: this is a truncated version of the table. Photcodes 10001-10476 contain entries for each of the 64 OTAs. The information is the same, the only thing that changes is the photoCalID and the filterID, it follows the form of photoCalID = 100(XY), filterID = GPC1.g.XY(XY) where (XY) is the OTA number. See Chambers et. al. 2016 for more information.}
%\begin{center}
%\resizebox{\textwidth}{!}{%
%\begin{tabular}{lllllllllll}
%\hline
%\hline
%(a)&(b)&(c)&(d)&(e)&(f)&(g)&(h)&(i)&(j)&(k)\\
%\hline
%10001&1&GPC1.g.XY01&0&24.58&-0.15&0&0&0&0&54000 \\
%.... &1& .... &0&24.58&-0.15&0&0&0&0&54000\\
%10076&1&GPC1.g.XY76&0&24.58&-0.15&0&0&0&0&54000 \\
%10101&2&GPC1.r.XY01&0&24.8&-0.1&0&0&0&0&54000 \\
%....&2& .... &0&24.8&-0.1&0&0&0&0&54000 \\
%10176&2&GPC1.r.XY76&0&24.8&-0.1&0&0&0&0&54000 \\
%10201&3&GPC1.i.XY01&0&24.74&-0.04&0&0&0&0&54000 \\
%....&3&....&0&24.74&-0.04&0&0&0&0&54000 \\
%10276&3&GPC1.i.XY76&0&24.74&-0.04&0&0&0&0&54000 \\
%%10301&4&GPC1.z.XY01&0&24.26&-0.03&0&0&0&0&54000 \\
%.... &4&....&0&24.26&-0.03&0&0&0&0&54000 \\
%10376&4&GPC1.z.XY76&0&24.26&-0.03&0&0&0&0&54000 \\
%10401&5&GPC1.y.XY01&0&23.41&-0.03&0&0&0&0&54000 \\
%.... &5&....&0&23.41&-0.03&0&0&0&0&54000\\
%10476&5&GPC1.y.XY76&0&23.41&-0.03&0&0&0&0&54000 \\
%11000&1&GPC1.g.SkyChip&0&25&0&0&0&0&0&54000 \\
%11100&2&GPC1.r.SkyChip&0&25&0&0&0&0&0&54000 \\
%11200&3&GPC1.i.SkyChip&0&25&0&0&0&0&0&54000 \\
%11300&4&GPC1.z.SkyChip&0&25&0&0&0&0&0&54000 \\
%11400&5&GPC1.y.SkyChip&0&25&0&0&0&0&0&54000 \\
%12000&1&GPC1.g.ForcedWarp&0&25&0&0&0&0&0&54000 \\
%12100&2&GPC1.r.ForcedWarp&0&25&0&0&0&0&0&54000 \\
%12200&3&GPC1.i.ForcedWarp&0&25&0&0&0&0&0&54000 \\
%12300&4&GPC1.z.ForcedWarp&0&25&0&0&0&0&0&54000 \\
%12400&5&GPC1.y.ForcedWarp&0&25&0&0&0&0&0&54000 \\
%\hline
%\end{tabular}
%\end{center}

%(a) photoCalID \\
%(b) filterID \\
%(c) photoCodeDesc \\
%(d) AB \\
%(e) zeropoint \\
%(f) extinction \\
%%(g) colorterm \\
%(h) colorExtn \\
%(i) orphanCalColor \\
%(j) orphanCalColorErr\\
%\label{table:photcal}
%\end{table}%

%%%HAF removing this for now, MH says not useufl

%\begin{table}
%\caption{StackType}
%\begin{center}
%\resizebox{\textwidth}{!}{%
%\begin{tabular}{lll}
%\hline
%\hline
%stackTypeID&name&description\\
%\hline
%0&NIGHTLY\_STACK&Nightly stack\\
%1&DEEP\_STACK&Deep stack\\
%2&IQ\_STACK&IQ stack\\
%3&REF\_S1\_STACK&Reference \ippstage{stack} excluding data from season 1\\
%4&REF\_S2\_STACK&Reference \ippstage{stack} excluding data from season 2\\
%5&REF\_S3\_STACK&Reference \ippstage{stack} excluding data from season 3\\
%6&REF\_S4\_STACK&Reference \ippstage{stack} excluding data from season 4\\
%7&REF\_S5\_STACK&Reference \ippstage{stack} excluding data from season 5\\
%\hline
%\end{tabular}
%\end{center}
%\label{table:stacktype}
%\end{table}%

%%HAF removing this for now, mark says not useful
%\begin{table}
%\caption{DiffType}
%\begin{center}
%\resizebox{\textwidth}{!}{%
%\begin{tabular}{lll}
%\hline
%\hline
%diffTypeID&name&description\\
%\hline
%1&WARP\_WARP&warp-warp difference image\\
%2&WARP\_STACK&warp-stack difference image\\
%3&STACK\_WARP&stack-warp difference image\\
%\hline
%\end{tabular}
%\end{center}
%\label{table:difftype}
%\end{table}%


%%HAF removing this for now, mark says not helfpul
%\begin{table}
%\caption{TessellationType}
%\begin{center}
%\resizebox{\textwidth}{!}{%
%\begin{tabular}{lll}
%\hline
%\hline
%tessID&name&description\\
%\hline
%1&CNP.LAP&Tessellation for the 3$\pi$ survey pole regions (LOCAL)\\
%2&RINGS.V3&Tessellation for the 3pi survey; ex pole regions\\
%3&MD01.V3&Tessellation for MD01 field (LOCAL)\\
%4&MD02.V3&Tessellation for MD02 field (LOCAL)\\
%5&MD03.V3&Tessellation for MD03 field (LOCAL)\\
%6&MD04.V3&Tessellation for MD04 field (LOCAL)\\
%7&MD05.V3&Tessellation for MD05 field (LOCAL)\\
%8&MD06.V3&Tessellation for MD06 field (LOCAL)\\
%9&MD07.V3&Tessellation for MD07 field (LOCAL)\\
%10&MD08.V3&Tessellation for MD08 field (LOCAL)\\
%11&MD09.V3&Tessellation for MD09 field (LOCAL)\\
%12&MD10.V3&Tessellation for MD10 field (LOCAL)\\
%13&M31.V4&Tessellation for M31 (LOCAL)\\
%\hline
%\end{tabular}
%\end{center}%
%\label{table:tessellationtype}
%\end{table}%

%\end{document}
\clearpage

\section{Schema}
\label{sec:schema}

%\subsection{System Metadata Tables}
%
%{\color{red} needs to be added}

\subsection{Object / Mean Object Tables}

\begin{table}[b]

\caption{ObjectThin: Contains the positional information for objects
  in a number of coordinate systems.  The objects associate single
  epoch detections and the stacked detections within a one arcsecond
  radius.  The mean position from the single epoch data is used as the
  basis for coordinates when available, or the position of an object
  in the \ippstage{stack} when it is not.  The right ascension and
  declination for both the \ippstage{stack} and single epoch mean is
  provided.  The number of detections in each filter from single epoch
  data is listed, along with which filters the object has a
  \ippstage{stack} detection \citep[see]{Szalay2007}.}

\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objName & - & VARCHAR(32) & NA  &IAU name for this object.\\
objNameHMS & - & VARCHAR(32) & NA  & Alternate sexigesimal name for this object (DR2 only).\\
objPSOName & - & VARCHAR(32) & NA  &Alternate Pan-STARRS name for this object (DR1 only).\\
objAltName1 & - & VARCHAR(32) & NA  &Alternate name for this object.\\
objAltName2 & - & VARCHAR(32) &   &Altername name for this object.\\
objAltName3 & - & VARCHAR(32) &   &Altername name for this object.\\
objPopularName & - & VARCHAR(140) &   &Well known name for this object.\\
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsOBid & - & BIGINT & NA  &Unique internal PSPS object identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
surveyID & - & TINYINT & NA  &Survey identifier.  Details in the Survey table.\\
htmID & - & BIGINT & NA  &Hierarchical triangular mesh (Szalay 2007) index.\\
zoneID & - & INT & NA  &Local zone index, found by dividing the sky into bands of declination 1/2\\  
&   &     &     & arcminute in height: zoneID=floor((90+Dec)/0.0083333).\\
tessID & - & TINYINT & 0  &Tessellation identifier.  Details in the TessellationType table.\\
projectionID & - & SMALLINT & -1  &Projection cell identifier.\\
skyCellID & - & TINYINT & 255  &Skycell region identifier.\\
randomID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
batchID & - & BIGINT & NA  &Internal database batch identifier.\\
dvoRegionID & - & INT & -1  &Internal DVO region identifier.\\
processingVersion & - & TINYINT & NA  &Data release version.\\
objInfoFlag & - & INT & 0  &Information flag bitmask indicating details of the photometry.  Values\\ 
& & & & listed in ObjectInfoFlags.\\
qualityFlag & - & TINYINT & 0  &Subset of objInfoFlag denoting whether this object is real or a likely\\
& & & &false positive.  Values listed in ObjectQualityFlags.\\
raStack & degrees & FLOAT & -999  &Right ascension from \ippstage{stack} detections, weighted mean value across \\
& & & & filters, in equinox J2000.  See StackObjectThin for \ippstage{stack} epoch information.\\
decStack & degrees & FLOAT & -999  &Declination from \ippstage{stack} detections, weighted mean value across\\
& & & & filters, in equinox J2000.  See StackObjectThin for \ippstage{stack} epoch information.\\
raStackErr & arcsec & REAL & -999  &Right ascension standard deviation from \ippstage{stack} detections.\\
decStackErr & arcsec & REAL & -999  &Declination standard deviation from \ippstage{stack} detections.\\
raMean & degrees & FLOAT & -999  &Right ascension from single epoch detections (weighted mean) in \\
& & & & equinox J2000 at the mean epoch given by epochMean.\\
decMean & degrees & FLOAT & -999  &Declination from single epoch detections (weighted mean) in equinox\\
& & & & J2000 at the mean epoch given by epochMean.\\
raMeanErr & arcsec & REAL & -999  &Right ascension standard deviation from single epoch detections.\\
decMeanErr & arcsec & REAL & -999  &Declination standard deviation from single epoch detections.\\
epochMean & days & FLOAT & -999  &Modified Julian Date of the mean epoch corresponding to raMean,\\
& & & & decMean (equinox J2000).\\
posMeanChisq & - & REAL & -999  &Reduced chi squared value of mean position.\\
cx & - & FLOAT & NA  &Cartesian x on a unit sphere. \\
cy & - & FLOAT & NA  &Cartesian y on a unit sphere. \\
cz & - & FLOAT & NA  &Cartesian z on a unit sphere. \\
lambda & degrees & FLOAT & -999  &Ecliptic longitude.\\
beta & degrees & FLOAT & -999  &Ecliptic latitude.\\
l & degrees & FLOAT & -999  &Galactic longitude.\\
b & degrees & FLOAT & -999  &Galactic latitude.\\
nStackObjectRows & - & SMALLINT & -999  &Nr. of independent StackObjectThin rows associated with this object.\\
nStackDetections & - & SMALLINT & -999  &Number of \ippstage{stack} detections.\\
nDetections & - & SMALLINT & -999  &Number of single epoch detections in all filters.\\
ng & - & SMALLINT & -999  &Number of single epoch detections in g filter.\\
nr & - & SMALLINT & -999  &Number of single epoch detections in r filter.\\
ni & - & SMALLINT & -999  &Number of single epoch detections in i filter.\\
nz & - & SMALLINT & -999  &Number of single epoch detections in z filter.\\
ny & - & SMALLINT & -999  &Number of single epoch detections in y filter.\\
\hline
\end{tabular}
\end{center}
\label{table:ObjectThin}
\end{table}%

\begin{table}[b]
\caption{MeanObject: Contains the mean photometric information for objects based on the single epoch data, calculated as described in \citet{Magnier2013}.  To be included in this table, an object must be bright enough to have been detected at least once in an individual exposure.  PSF, Kron (1980), and aperture magnitudes and statistics are listed for all filters.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsOBid & - & BIGINT & NA  &Unique internal PSPS object identifier.\\
gQfPerfect & - & REAL & -999  &Maximum PSF weighted fraction of pixels totally unmasked\\
& & & & from g filter detections.\\
gMeanPSFMag & AB & REAL & -999  &Mean PSF magnitude from g filter detections.\\
gMeanPSFMagErr & AB & REAL & -999  &Error in mean PSF magnitude from g filter \\
& & & & detections.\\
gMeanPSFMagStd & AB & REAL & -999  &Standard deviation of PSF magnitudes from g filter\\
& & & & detections.\\
gMeanPSFMagNpt & - & SMALLINT & -999  &Number of measurements included in mean PSF\\
& & & & magnitude from g filter detections.\\
gMeanPSFMagMin & AB & REAL & -999  &Minimum PSF magnitude from g filter detections.\\
gMeanPSFMagMax & AB & REAL & -999  &Maximum PSF magnitude from g filter detections.\\
gMeanKronMag & AB & REAL & -999  &Mean Kron (1980) magnitude from g filter detections.\\
gMeanKronMagErr & AB & REAL & -999  &Error in mean Kron (1980) magnitude from g filter\\
& & & & detections.\\
gMeanKronMagStd & AB & REAL & -999  &Standard deviation of Kron (1980) magnitudes from\\
& & & & g filter detections.\\
gMeanKronMagNpt & - & SMALLINT & -999  &Number of measurements included in mean Kron\\
& & & & (1980) magnitude from g filter detections.\\
gMeanApMag & AB & REAL & -999  &Mean aperture magnitude from g filter detections.\\
gMeanApMagErr & AB & REAL & -999  &Error in mean aperture magnitude from g filter \\
& & & & detections.\\
gMeanApMagStd & AB & REAL & -999  &Standard deviation of aperture magnitudes from g\\
& & & & filter detections.\\
gMeanApMagNpt & - & SMALLINT & -999  &Number of measurements included in mean aperture\\
& & & & magnitude from g filter detections.\\
gFlags & - & INT & 0  &Information flag bitmask for mean object from g filter\\
& & & & detections.  Values listed in ObjectFilterFlags.\\
rQfPerfect \\
... & & & & same entries repeated for r, i, z, and y filters \\
yFlags \\
\hline
\end{tabular}
\end{center}
\label{table:MeanObject}
\end{table}%

%\end{document}

\begin{table}[b]
\caption{GaiaFrameCoordinate: PSPS objects calibrated against Gaia astrometry}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsGOid & - & BIGINT & NA  &Unique internal PSPS object identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
batchID & - & BIGINT & NA  &Internal database batch identifier.\\
gaiaFlag & - & INT &   &Information flag bitmask.\\
ra & degrees & FLOAT & -999  &Right ascension from single epoch detections (weighted mean) in\\
& & & & equinox J2000 at the mean epoch given by epochMean and calibrated against Gaia.\\
dec & degrees & FLOAT & -999  &Declination from single epoch detections (weighted mean) in equinox\\
& & & & J2000 at the mean epoch given by epochMean and calibrated against Gaia.\\
raErr & arcsec & REAL & -999  &Right ascension standard deviation from single epoch detections.\\
decErr & arcsec & REAL & -999  &Declination standard deviation from single epoch detections.\\
\hline
\end{tabular}
\end{center}
\label{table:GaiaFrameCoordinate}
\end{table}%

\clearpage

\subsection{Single Exposure Detection Tables}

\begin{table}[b]
\caption{FrameMeta: Contains metadata related to an individual exposure.  A "Frame" refers to the collection of all images obtained by the 60 OTA devices in the camera in a single exposure. The camera configuration, telescope pointing, observation time, and astrometric solution from the detector focal plane (L,M) to the sky (RA,Dec) is provided.}
\begin{center}
\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
frameID & - & INT & NA  &Unique frame/exposure identifier.\\
frameName & - & VARCHAR(32) & NA  &Frame/exposure name provided by the camera software.\\
surveyID & - & TINYINT & NA  &Survey identifier.  Details in the Survey table.\\
filterID & - & TINYINT & NA  &Filter identifier.  Details in the Filter table.\\
ippChipID & - & INT & NA  &IPP chipRun identifier.\\
ippCamID & - & INT & NA  &IPP camRun identifier.\\
ippWarpID & - & INT & NA  &IPP warpRun identifier.\\
cameraID & - & SMALLINT & NA  &Camera identifier.  Details in the CameraConfig table.\\
cameraConfigID & - & SMALLINT & NA  &Camera configuration identifier.  Details in the CameraConfig table.\\
telescopeID & - & SMALLINT & NA  &Telescope identifier.\\
analysisVer & - & VARCHAR(100) &   &IPP software analysis release version.\\
md5sum & - & VARCHAR(100) &   &IPP MD5 Checksum.\\
nOTA & - & SMALLINT & -999  &Number of valid OTA images in this frame/exposure.\\
photoScat & magnitudes & REAL & -999  &Photometric scatter relative to reference catalog across the full FOV.\\
nPhotoRef & - & INT & -999  &Number of photometric reference sources.\\
expStart & days & FLOAT & -999  &Modified Julian Date at the start of the exposure.\\
expTime & seconds & REAL & -999  &Exposure time of the frame/exposure.  Necessary for converting listed\\
& & & & fluxes and magnitudes back to measured ADU counts.\\
airmass & - & REAL & 0  &Airmass at midpoint of the exposure.  Necessary for converting listed \\
& & & & fluxes and magnitudes back to measured ADU counts.\\
raBore & degrees & FLOAT & -999  &Right ascension of telescope boresight.\\
decBore & degrees & FLOAT & -999  &Declination of telescope boresight.\\
ctype1 & - & VARCHAR(100) &   &Name of astrometric projection in RA.\\
ctype2 & - & VARCHAR(100) &   &Name of astrometric projection in Dec.\\
crval1 & degrees & FLOAT & -999  &Right ascension corresponding to reference pixel.\\
crval2 & degrees & FLOAT & -999  &Declination corresponding to reference pixel.\\
crpix1 & pixels & FLOAT & -999  &Reference pixel for RA.\\
crpix2 & pixels & FLOAT & -999  &Reference pixel for Dec.\\
cdelt1 & degrees/pixel & FLOAT & -999  &Pixel scale in RA.\\
cdelt2 & degrees/pixel & FLOAT & -999  &Pixel scale in Dec.\\
pc001001 & - & FLOAT & -999  &Linear transformation matrix element between focal plane pixel L and RA.\\
pc001002 & - & FLOAT & -999  &Linear transformation matrix element between focal plane pixel M and RA.\\
pc002001 & - & FLOAT & -999  &Linear transformation matrix element between focal plane pixel L and Dec.\\
pc002002 & - & FLOAT & -999  &Linear transformation matrix element between focal plane pixel M and Dec.\\
polyOrder & - & TINYINT & 255  &Polynomial order of astrometric fit between detector focal plane and sky.\\
pca1x3y0 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^3$ $y^0$) for RA.\\
pca1x2y1 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^2$ $y^1$) for RA.\\
pca1x1y2 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^1$ $y^2$) for RA.\\
pca1x0y3 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^0$ $y^3$) for RA.\\
pca1x2y0 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^2$ $y^0$) for RA.\\
pca1x1y1 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^1$ $y^1$) for RA.\\
pca1x0y2 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^0$ $y^2$) for RA.\\
pca2x3y0 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^3$ $y^0$) for Dec.\\
pca2x2y1 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^2$ $y^1$) for Dec.\\
pca2x1y2 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^1$ $y^2$) for Dec.\\
pca2x0y3 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^0$ $y^3$) for Dec.\\
pca2x2y0 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^2$ $y^0$) for Dec.\\
pca2x1y1 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^1$ $y^1$) for Dec.\\
pca2x0y2 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^0$ $y^2$) for Dec.\\
batchID & - & BIGINT & NA  &Internal database batch identifier.\\
processingVersion & - & TINYINT & NA  &Data release version.\\
\hline
\end{tabular}}
\end{center}
\label{table:FrameMeta}
\end{table}%

\begin{table}[b]
\caption{ImageMeta: Contains metadata related to an individual OTA image that comprises a portion of the full exposure.  The characterization of the image quality, the detrends applied, and the astrometric solution from the raw pixels (X,Y) to the detector focal plane (L,M) is provided.}
\begin{center} %cheaing here, if I do resizebox it compiles
\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
imageID & - & BIGINT & NA  &Unique image identifier.  Constructed as (100 * frameID + ccdID).\\
frameID & - & INT & NA  &Unique frame/exposure identifier.\\
ccdID & - & SMALLINT & NA  &OTA identifier based on location in the focal plane, specific to an individual device.\\
photoCalID & - & INT & NA  &Photometric calibration identifier.  Details in the PhotoCal table.\\
filterID & - & TINYINT & NA  &Filter identifier.  Details in the Filter table.\\
bias & adu & REAL & -999  &OTA bias level.\\
biasScat & adu & REAL & -999  &Scatter in bias level.\\
sky & $Jy/arcsec^2$ & REAL & -999  &Mean sky brightness.\\
skyScat & $Jy/arcsec^2$ & REAL & -999  &Scatter in mean sky brightness.\\
nDetect & - & INT & -999  &Number of detections in this image.\\
detectionThreshold & magnitudes & REAL & -999  &Reference magnitude for detection efficiency calculation.\\
astroScat & arcsec & REAL & -999  &Measurement of the calibration (not astrometric error) defined to be the sum in quadrature of the \\
& & & & standard deviations in the X and Y directions.\\
photoScat & magnitudes & REAL & -999  &Photometric scatter relative to reference catalog.\\
nAstroRef & - & INT & -999  &Number of astrometric reference sources.\\
nPhotoRef & - & INT & -999  &Number of photometric reference sources.\\
recalAstroScatX & arcsec & REAL & -999  &Measurement of the re-calibration (not astrometric error) in the X direction.\\
recalAstroScatY & arcsec & REAL & -999  &Measurement of the re-calibration (not astrometric error) in the Y direction.\\
recalNAstroStars & - & INT & -999  &Number of astrometric reference sources used in recalibration.\\
recalphotoScat & magnitudes & REAL & -999  &Photometric scatter relative to reference catalog.\\
recalNPhotoStars & - & INT & -999  &Number of astrometric reference sources used in recalibration.\\
nAxis1 & pixels & SMALLINT & -999  &Image dimension in x.\\
nAxis2 & pixels & SMALLINT & -999  &Image dimension in y.\\
psfModelID & - & INT & -999  &PSF model identifier.\\
psfFWHM & arcsec & REAL & -999  &Mean PSF full width at half maximum at image center.\\
psfWidMajor & arcsec & REAL & -999  &PSF major axis FWHM at image center.\\
psfWidMinor & arcsec & REAL & -999  &PSF minor axis FWHM at image center.\\
psfTheta & degrees & REAL & -999  &PSF major axis orientation at image center.\\
momentMajor & arcsec & REAL & -999  &PSF major axis second moment.\\
momentMinor & arcsec & REAL & -999  &PSF minor axis second moment.\\
momentM2C & $arcsec^2$ & REAL & -999  &Moment $M2C = M_{xx} - M_{yy}$.\\
momentM2S & $arcsec^2$ & REAL & -999  &Moment $M2S = 2 * M_{xy}$.\\
momentM3 & $arcsec^2$ & REAL & -999  &trefoil second moment = $sqrt( (M_{xxx} - 3 * M_{xyy})^2 + (3 * M_{xxy} - M_{yyy})^2 )$.\\
momentM4 & $arcsec^2$ & REAL & -999  &quadrupole second moment = $sqrt( (M_{xxxx} - 6 * M_{xxyy} + M_{yyyy})^2 + (4 * M_{xxxy} - 4 * M_{xyyy})^2 )$.\\
apResid & magnitudes & REAL & -999  &Residual of aperture corrections.\\
dapResid & magnitudes & REAL & -999  &Scatter of aperture corrections.\\
detectorID & - & VARCHAR(100) &   &Identifier for each individual OTA detector device.\\
qaFlags & - & BIGINT & -999  &Q/A flags for this image.  Values listed in ImageFlags.\\
detrend1 & - & VARCHAR(100) &   &Identifier for detrend image 1, the static mask.\\
detrend2 & - & VARCHAR(100) &   &Identifier for detrend image 2, the dark model.\\
detrend3 & - & VARCHAR(100) &   &Identifier for detrend image 3, the flat.\\
detrend4 & - & VARCHAR(100) &   &Identifier for detrend image 4, the fringe.\\
detrend5 & - & VARCHAR(100) &   &Identifier for detrend image 5, the noisemap.\\
detrend6 & - & VARCHAR(100) &   &Identifier for detrend image 6, the non-linearity correction.\\
detrend7 & - & VARCHAR(100) &   &Identifier for detrend image 7, the video dark model.\\
detrend8 & - & VARCHAR(100) &   &Identifier for detrend image 8.\\
photoZero & magnitudes & REAL & -999  &Locally derived photometric zero point for this image.\\
ctype1 & - & VARCHAR(100) &   &Name of astrometric projection in focal plane L.\\
ctype2 & - & VARCHAR(100) &   &Name of astrometric projection in focal plane M.\\
crval1 & focal plane pixels & FLOAT & -999  &Focal plane L corresponding to reference pixel.\\
crval2 & focal plane pixels & FLOAT & -999  &Focal plane M corresponding to reference pixel.\\
crpix1 & raw pixels & FLOAT & -999  &Reference pixel for focal plane L.\\
crpix2 & raw pixels & FLOAT & -999  &Reference pixel for focal plane M.;\\
cdelt1 & focal plane pixels/raw pixel & FLOAT & -999  &Pixel scale in focal plane x.\\
cdelt2 & focal plane pixels/raw pixel & FLOAT & -999  &Pixel scale in focal plane y.\\
pc001001 & - & FLOAT & -999  &Linear transformation matrix element between image pixel x and focal plane pixel L.\\
pc001002 & - & FLOAT & -999  &Linear transformation matrix element between image pixel y and focal plane pixel L.\\
pc002001 & - & FLOAT & -999  &Linear transformation matrix element between image pixel x and focal plane pixel M.\\
pc002002 & - & FLOAT & -999  &Linear transformation matrix element between image pixel y and focal plane pixel M.\\
polyOrder & - & TINYINT & 255  &Polynomial order of astrometric fit between the image pixels and the detector focal plane.\\
pca1x3y0 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^3$ $y^0$) for focal plane L.\\
pca1x2y1 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^2$ $y^1$) for focal plane L.\\
pca1x1y2 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^1$ $y^2$) for focal plane L.\\
pca1x0y3 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^0$ $y^3$) for focal plane L.\\
pca1x2y0 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^2$ $y^0$) for focal plane L.\\
pca1x1y1 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^1$ $y^1$) for focal plane L.\\
pca1x0y2 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^0$ $y^2$) for focal plane L.\\
pca2x3y0 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^3$ $y^0$) for focal plane M.\\
pca2x2y1 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^2$ $y^1$) for focal plane M.\\
pca2x1y2 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^1$ $y^2$) for focal plane M.\\
pca2x0y3 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^0$ $y^3$) for focal plane M.\\
pca2x2y0 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^2$ $y^0$) for focal plane M.\\
pca2x1y1 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^1$ $y^1$) for focal plane M.\\
pca2x0y2 & - & FLOAT & -999  &Polynomial coefficient for the astrometric fit component ($x^0$ $y^2$) for focal plane M.\\
processingVersion & - & TINYINT & NA  &Data release version.\\
\hline
\end{tabular}}
\end{center}
\label{table:ImageMeta}
\end{table}%





\begin{table}[b]
\caption{Detection: Contains single epoch photometry of individual detections from a single exposure.  The identifiers connecting the detection back to the original image and to the object association are provided.  PSF, aperture, and \citet{Kron1980} photometry are included, along with sky and detector coordinate positions.}
\begin{center}
\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsP2id & - & BIGINT & NA  &Unique internal PSPS detection identifier.\\
detectID & - & BIGINT & NA  &Unique detection identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
ippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
filterID & - & TINYINT & NA  &Filter identifier.  Details in the Filter table.\\
surveyID & - & TINYINT & NA  &Survey identifier.  Details in the Survey table.\\
imageID & - & BIGINT & NA  &Unique image identifier.  Constructed as (100 * frameID + ccdID).\\
randomDetID & - & FLOAT & NA  &Random value drawn from the interval between zero and one. \\
dvoRegionID & - & INT & -1  &Internal DVO region identifier.\\
obsTime & days & FLOAT & -999  &Modified Julian Date at the midpoint of the observation.\\
xPos & raw pixels & REAL & -999  &PSF x center location.\\
yPos & raw pixels & REAL & -999  &PSF y center location.\\
xPosErr & raw pixels & REAL & -999  &Error in PSF x center location.\\
yPosErr & raw pixels & REAL & -999  &Error in PSF y center location.\\
pltScale & arcsec/pixel & REAL & -999  &Local plate scale at this location.\\
posAngle & degrees & REAL & -999  &Position angle (sky-to-chip) at this location.\\
ra & degrees & FLOAT & -999  &Right ascension.\\
dec & degrees & FLOAT & -999  &Declination.\\
raErr & arcsec & REAL & -999  &Right ascension error.\\
decErr & arcsec & REAL & -999  &Declination error.\\
extNSigma & - & REAL & 0  &An extendedness measure based on the deviation between PSF and Kron\\
& & & & magnitudes, normalized by the PSF magnitude uncertainty.\\
zp & magnitudes & REAL & 0  &Photometric zeropoint.  Necessary for converting listed fluxes and \\
& & & & magnitudes back to measured ADU counts.\\
telluricExt & magnitudes & REAL & NA  &Estimated Telluric extinction due to non-photometric observing conditions.\\
& & & & Necessary for converting listed fluxes and magnitudes back to measured ADU counts.\\
expTime & seconds & REAL & -999  &Exposure time of the frame/exposure.  Necessary for converting listed \\
& & & & fluxes and magnitudes back to measured ADU counts.\\
airMass & - & REAL & 0  &Airmass at midpoint of the exposure.  Necessary for converting listed \\
& & & & fluxes and magnitudes back to measured ADU counts.\\
psfFlux & Jy & REAL & -999  &Flux from PSF fit.\\
psfFluxErr & Jy & REAL & -999  &Error on flux from PSF fit.\\
psfMajorFWHM & arcsec & REAL & -999  &PSF major axis FWHM.\\
psfMinorFWHM & arcsec & REAL & -999  &PSF minor axis FWHM.\\
psfTheta & degrees & REAL & -999  &PSF major axis orientation.\\
psfCore & - & REAL & -999  &PSF core parameter k, where $F = F0 / (1 + k r^2 + r^{3.33})$.\\
psfQf & - & REAL & -999  &PSF coverage factor.\\
psfQfPerfect & - & REAL & -999  &PSF weighted fraction of pixels totally unmasked.\\
psfChiSq & - & REAL & -999  &Reduced chi squared value of the PSF model fit.\\
psfLikelihood & - & REAL & -999  &Likelihood that this detection is best fit by a PSF.\\
momentXX & $arcsec^2$ & REAL & -999  &Second moment $M_{xx}$.\\
momentXY & $arcsec^2$ & REAL & -999  &Second moment $M_{xy}$.\\
momentYY & $arcsec^2$ & REAL & -999  &Second moment $M_{yy}$.\\
momentR1 & arcsec & REAL & -999  &First radial moment.\\
momentRH & $arcsec^{0.5}$ & REAL & -999  &Half radial moment ($r^{0.5}$ weighting).\\
momentM3C & $arcsec^2$ & REAL & -999  &Cosine of trefoil second moment term: $r^2 cos(3 theta) = M_{xxx} - 3 * M_{xyy}$.\\
momentM3S & $arcsec^2$ & REAL & -999  &Sine of trefoil second moment: $r^2 sin (3 theta) = 3 * M_{xxy} - M_{yyy}$.\\
momentM4C & $arcsec^2$ & REAL & -999  &Cosine of quadrupole second moment: $r^2 cos (4 theta) = M_{xxxx} - 6 * M_{xxyy} + M_{yyyy}.$\\
momentM4S & $arcsec^2$ & REAL & -999  &Sine of quadrupole second moment: $r^2 sin (4 theta) = 4 * M_{xxxy} - 4 * M_{xyyy}$.\\
apFlux & Jy & REAL & -999  &Flux in seeing-dependent aperture.\\
apFluxErr & Jy & REAL & -999  &Error on flux in seeing-dependent aperture.\\
apFillF & - & REAL & -999  &Aperture fill factor.\\
apRadius & arcsec & REAL & -999  &Aperture radius.\\
kronFlux & Jy & REAL & -999  &Kron (1980) flux.\\
kronFluxErr & Jy & REAL & -999  &Error on Kron (1980) flux.\\
kronRad & arcsec & REAL & -999  &Kron (1980) radius.\\
sky & $Jy/arcsec^2$ & REAL & -999  &Background sky level.\\
skyErr & $Jy/arcsec^2$ & REAL & -999  &Error in background sky level.\\
infoFlag & - & BIGINT & 0  &Information flag bitmask indicating details of the photometry.  \\
& & & & Values listed in DetectionFlags.\\
infoFlag2 & - & INT & 0  &Information flag bitmask indicating details of the photometry.  \\
& & & & Values listed in DetectionFlags2.\\
infoFlag3 & - & INT & 0  &Information flag bitmask indicating details of the photometry.  \\
& & & & Values listed in DetectionFlags3.\\
processingVersion & - & TINYINT & NA  &Data release version.\\
\hline
\end{tabular}}
\end{center}
\label{table:Detection}
\end{table}%


\begin{table}[b]
\caption{ImageDetEffMeta: Contains the detection efficiency information for a given individual OTA image.  Provides the number of recovered sources out of 500 injected fake source and statistics about the magnitudes of the recovered sources for a range of magnitude offsets.}
\begin{center}
\resizebox{\textwidth}{!}{
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
imageID & - & BIGINT & NA  &Unique image identifier.  Constructed as (100 * frameID + ccdID).\\
frameID & - & INT & NA  &Unique frame/exposure identifier.\\
magref & magnitudes & REAL & NA  &Detection efficiency reference magnitude.\\
nInjected & - & INT & NA  &Number of fake sources injected in each magnitude bin.\\
offset01 & magnitudes & REAL & NA  &Detection efficiency magnitude offset for bin 1.\\
counts01 & - & REAL & NA  &Detection efficiency count of recovered sources in bin 1.\\
diffMean01 & magnitudes & REAL & NA  &Detection efficiency mean magnitude difference in bin 1.\\
diffStdev01 & magnitudes & REAL & NA  &Detection efficiency standard deviation of magnitude differences in bin 1.\\
errMean01 & magnitudes & REAL & NA  &Detection efficiency mean magnitude error in bin 1.\\
offset02 & magnitudes & REAL & NA  &Detection efficiency magnitude offset for bin 2.\\
counts02 & - & REAL & NA  &Detection efficiency count of recovered sources in bin 2.\\
diffMean02 & magnitudes & REAL & NA  &Detection efficiency mean magnitude difference in bin 2.\\
diffStdev02 & magnitudes & REAL & NA  &Detection efficiency standard deviation of magnitude differences in bin 2.\\
errMean02 & magnitudes & REAL & NA  &Detection efficiency mean magnitude error in bin 2.\\
offset03 & magnitudes & REAL & NA  &Detection efficiency magnitude offset for bin 3.\\
counts03 & - & REAL & NA  &Detection efficiency count of recovered sources in bin 3.\\
diffMean03 & magnitudes & REAL & NA  &Detection efficiency mean magnitude difference in bin 3.\\
diffStdev03 & magnitudes & REAL & NA  &Detection efficiency standard deviation of magnitude differences in bin 3.\\
errMean03 & magnitudes & REAL & NA  &Detection efficiency mean magnitude error in bin 3.\\
...\\
offset13 & magnitudes & REAL & NA  &Detection efficiency magnitude offset for bin 13.\\
counts13 & - & REAL & NA  &Detection efficiency count of recovered sources in bin 13.\\
diffMean13 & magnitudes & REAL & NA  &Detection efficiency mean magnitude difference in bin 13.\\
diffStdev13 & magnitudes & REAL & NA  &Detection efficiency standard deviation of magnitude differences in bin 13.\\
errMean13 & magnitudes & REAL & NA  &Detection efficiency mean magnitude error in bin 13.\\
\hline
\end{tabular}}
\end{center}
\label{table:ImageDetEffMeta}
\end{table}%

\clearpage

\subsection{Stack Tables}

\begin{table}[b]
\caption{StackMeta: Contains the metadata describing the stacked image produced from the combination of a set of single epoch exposures.  The nature of the \ippstage{stack} is given by the StackTypeID.  The astrometric and photometric calibration of the stacked image are listed.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
stackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier.\\
batchID & - & BIGINT & NA  &Internal database batch identifier.\\
surveyID & - & TINYINT & NA  &Survey identifier.  Details in the Survey table.\\
filterID & - & TINYINT & NA  &Filter identifier.  Details in the Filter table.\\
stackTypeID & - & TINYINT & 0  &Stack type identifier.  Details in the StackType table.\\
tessID & - & TINYINT & 0  &Tessellation identifier.  Details in the TessellationType table.\\
projectionID & - & SMALLINT & -1  &Projection cell identifier.\\
skyCellID & - & TINYINT & 255  &Skycell region identifier.\\
photoCalID & - & INT & NA  &Photometric calibration identifier.  Details in the PhotoCal table.\\
analysisVer & - & VARCHAR(100) &   &IPP software analysis release version.\\
md5sum & - & VARCHAR(100) &   &IPP MD5 Checksum.\\
expTime & seconds & REAL & -999  &Exposure time of the stack.  Necessary for converting listed\\
& & & & fluxes and magnitudes back to measured ADU counts.\\
nP2Images & - & SMALLINT & -999  &Number of input exposures/frames contributing to this stack.\\
detectionThreshold & magnitudes & REAL & -999  &Reference magnitude for detection efficiency calculation.\\
astroScat & - & REAL & -999  &Measurement of the calibration (not astrometric error) defined to\\
& & & & be the sum in quadrature of the standard deviations in the X and\\
& & & & Y directions.\\
photoScat & - & REAL & -999  &Photometric scatter relative to reference catalog.\\
nAstroRef & - & INT & -999  &Number of astrometric reference sources.\\
nPhotoRef & - & INT & -999  &Number of photometric reference sources.\\
recalAstroScatX & arcsec & REAL & -999  &Measurement of the re-calibration (not astrometric error)\\
& & & & in the X direction.\\
recalAstroScatY & arcsec & REAL & -999  &Measurement of the re-calibration (not astrometric error)\\
& & & & in the Y direction.\\
recalNAstroStars & - & INT & -999  &Number of astrometric reference sources used in\\
& & & & recalibration.\\
recalphotoScat & magnitudes & REAL & -999  &Photometric scatter relative to reference catalog.\\
recalNPhotoStars & - & INT & -999  &Number of astrometric reference sources used in\\
& & & & recalibration.\\
psfModelID & - & INT & -999  &PSF model identifier.\\
psfFWHM & arcsec & REAL & -999  &Mean PSF full width at half maximum at image center.\\
psfWidMajor & arcsec & REAL & -999  &PSF major axis FWHM at image center.\\
psfWidMinor & arcsec & REAL & -999  &PSF minor axis FWHM at image center.\\
psfTheta & degrees & REAL & -999  &PSF major axis orientation at image center.\\
photoZero & magnitudes & REAL & -999  &Locally derived photometric zero point for this stack.\\
photoZeroAperture & magnitudes & REAL & -999 & Locally derived photometric zero point for this stack\\
& & & & (Aperture-like measurements only) (DR2).\\
ctype1 & - & VARCHAR(100) &   &Name of astrometric projection in right ascension.\\
ctype2 & - & VARCHAR(100) &   &Name of astrometric projection in declination.\\
crval1 & degrees & FLOAT & -999  &Right ascension corresponding to reference pixel.\\
crval2 & degrees & FLOAT & -999  &Declination corresponding to reference pixel.\\
crpix1 & sky pixels & FLOAT & -999  &Reference pixel for right ascension.\\
crpix2 & sky pixels & FLOAT & -999  &Reference pixel for declination.\\
cdelt1 & degrees/pixel & FLOAT & -999  &Pixel scale in right ascension.\\
cdelt2 & degrees/pixel & FLOAT & -999  &Pixel scale in declination.\\
pc001001 & - & FLOAT & -999  &Linear transformation matrix element between image pixel x and \\
& & & & right ascension.\\
pc001002 & - & FLOAT & -999  &Linear transformation matrix element between image pixel y and \\
& & & & right ascension.\\
pc002001 & - & FLOAT & -999  &Linear transformation matrix element between image pixel x and \\
& & & & declination.\\
pc002002 & - & FLOAT & -999  &Linear transformation matrix element between image pixel y and \\
& & & & declination.\\
processingVersion & - & TINYINT & NA  &Data release version.\\
\hline
\end{tabular}
\end{center}
\label{table:StackMeta}
\end{table}%

\begin{table}[b]
\caption{StackObjectThin: Contains the positional and photometric information for point-source photometry of \ippstage{stack} detections.  The information for all filters are joined into a single row, with metadata indicating if this \ippstage{stack} object represents the primary detection.  Due to overlaps in the \ippstage{stack} tessellations, an object may appear in multiple \ippstage{stack} images.  The primary detection is the unique detection from the \ippstage{stack} image that provides the best coverage with minimal projection stretching.  All other detections of the object in that filter are secondary, regardless of their properties.  The detection flagged as best is the primary detection if that detection has a psfQf value greater than 0.98;  if that is not met, then any of the primary or secondary detections with the highest psfQf value is flagged as best.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsSTid & - & BIGINT & NA  &Unique internal PSPS \ippstage{stack} identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
surveyID & - & TINYINT & NA  &Survey identifier.  Details in the Survey table.\\
tessID & - & TINYINT & 0  &Tessellation identifier.  Details in the TessellationType table.\\
projectionID & - & SMALLINT & -1  &Projection cell identifier.\\
skyCellID & - & TINYINT & 255  &Skycell region identifier.\\
randomStackObjID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
primaryDetection & - & TINYINT & 255  &Identifies if this row is the
primary \ippstage{stack} detection (incorrectly set in DR1 \& DR2). \\
bestDetection & - & TINYINT & 255  &Identifies if this row is the best
detection  (incorrectly set in DR1 \& DR2).\\
dvoRegionID & - & INT & -1  &Internal DVO region identifier.\\
processingVersion & - & TINYINT & NA  &Data release version.\\
gippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
gstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
gstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for g filter detection.\\
gra & degrees & FLOAT & -999  &Right ascension from g filter \ippstage{stack} detection.\\
gdec & degrees & FLOAT & -999  &Declination from g filter \ippstage{stack} detection.\\
graErr & arcsec & REAL & -999  &Right ascension error from g filter \ippstage{stack} detection.\\
gdecErr & arcsec & REAL & -999  &Declination error from g filter \ippstage{stack} detection.\\
gEpoch & days & FLOAT & -999  &Modified Julian Date of the mean epoch of images contributing to the\\
& & & & g-band \ippstage{stack} (equinox J2000).\\
gPSFMag & AB & REAL & -999  &PSF magnitude from g filter \ippstage{stack} detection.\\
gPSFMagErr & AB & REAL & -999  &Error in PSF magnitude from g filter \ippstage{stack} detection.\\
gApMag & AB & REAL & -999  &Aperture magnitude from g filter \ippstage{stack} detection.\\
gApMagErr & AB & REAL & -999  &Error in aperture magnitude from g filter \ippstage{stack} detection.\\
gKronMag & AB & REAL & -999  &Kron (1980) magnitude from g filter \ippstage{stack} detection.\\
gKronMagErr & AB & REAL & -999  &Error in Kron (1980) magnitude from g filter \ippstage{stack} detection.\\
ginfoFlag & - & BIGINT & 0  &Information flag bitmask indicating details of the g filter \ippstage{stack}\\
& & & & photometry.  Values listed in DetectionFlags.\\
ginfoFlag2 & - & INT & 0  &Information flag bitmask indicating details of the g filter \ippstage{stack}\\
& & & & photometry.  Values listed in DetectionFlags2.\\
ginfoFlag3 & - & INT & 0  &Information flag bitmask indicating details of the g filter \ippstage{stack}\\
& & & & photometry.  Values listed in DetectionFlags3.\\
ginfoFlag4 & - & INT & 0 & Information flag bitmask indicating details of the g filter stack photometry.\\
& & & &  Values listed in ObjectFilterFlags. (DR2)\\
gnFrames & - & INT & -999  &Number of input frames/exposures contributing to the g filter \ippstage{stack}\\
& & & & detection.\\
rippDetectID \\
... & & & & same entries repeated for r, i, z, and y filters \\
ynFrames \\
\hline
\end{tabular}
\end{center}
\label{table:StackObjectThin}
\end{table}%

\begin{table}[b]
\caption{StackObjectAttributes: Contains the PSF, \citet{Kron1980}, and aperture fluxes for all filters in a single row, along with point-source object shape parameters.  See \ippdbtable{StackObjectThin} table for discussion of primary, secondary, and best detections.
}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsSTid & - & BIGINT & NA  &Unique internal PSPS \ippstage{stack} identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
randomStackObjID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
primaryDetection & - & TINYINT & 255  &Identifies if this row is the primary \ippstage{stack} detection.\\
bestDetection & - & TINYINT & 255  &Identifies if this row is the best detection.\\
gippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
gstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
gstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for g filter detection.\\
gxPos & sky pixels & REAL & -999  &PSF x center location from g filter \ippstage{stack} detection.\\
gyPos & sky pixels & REAL & -999  &PSF y center location from g filter \ippstage{stack} detection.\\
gxPosErr & sky pixels & REAL & -999  &Error in PSF x center location from g filter \ippstage{stack} detection.\\
gyPosErr & sky pixels & REAL & -999  &Error in PSF y center location from g filter \ippstage{stack} detection.\\
gpsfMajorFWHM & arcsec & REAL & -999  &PSF major axis FWHM from g filter \ippstage{stack} detection.\\
gpsfMinorFWHM & arcsec & REAL & -999  &PSF minor axis FWHM from g filter \ippstage{stack} detection.\\
gpsfTheta & degrees & REAL & -999  &PSF major axis orientation from g filter \ippstage{stack} detection.\\
gpsfCore & - & REAL & -999  &PSF core parameter k from g filter \ippstage{stack} detection, where \\
& & & & $F = F0 / (1 + k r^2 + r^{3.33})$.\\
gpsfLikelihood & - & REAL & -999  &Likelihood that this g filter \ippstage{stack} detection is best fit\\
& & & & by a PSF.\\
gpsfQf & - & REAL & -999  &PSF coverage factor for g filter \ippstage{stack} detection.\\
gpsfQfPerfect & - & REAL & -999  &PSF-weighted fraction of pixels totally unmasked for g filter \ippstage{stack} detection.\\
gpsfChiSq & - & REAL & -999  &Reduced chi squared value of the PSF model fit for g filter \ippstage{stack} detection.\\
gmomentXX & $arcsec^2$ & REAL & -999  &Second moment $M_{xx}$ for g filter \ippstage{stack} detection.\\
gmomentXY & $arcsec^2$ & REAL & -999  &Second moment $M_{xy}$ for g filter \ippstage{stack} detection.\\
gmomentYY & $arcsec^2$ & REAL & -999  &Second moment $M_{yy}$ for g filter \ippstage{stack} detection.\\
gmomentR1 & arcsec & REAL & -999  &First radial moment for g filter \ippstage{stack} detection.\\
gmomentRH & $arcsec^{0.5}$ & REAL & -999  &Half radial moment ($r^{0.5}$ weighting) for g filter \ippstage{stack} detection.\\
gPSFFlux & Jy & REAL & -999  &PSF flux from g filter \ippstage{stack} detection.\\
gPSFFluxErr & Jy & REAL & -999  &Error in PSF flux from g filter \ippstage{stack} detection.\\
gApFlux & Jy & REAL & -999  &Aperture flux from g filter \ippstage{stack} detection.\\
gApFluxErr & Jy & REAL & -999  &Error in aperture flux from g filter \ippstage{stack} detection.\\
gApFillFac & - & REAL & -999  &Aperture fill factor from g filter \ippstage{stack} detection.\\
gApRadius & arcsec & REAL & -999  &Aperture radius for g filter \ippstage{stack} detection.\\
gKronFlux & Jy & REAL & -999  &Kron (1980) flux from g filter \ippstage{stack} detection.\\
gKronFluxErr & Jy & REAL & -999  &Error in Kron (1980) flux from g filter \ippstage{stack} detection.\\
gKronRad & arcsec & REAL & -999  &Kron (1980) radius from g filter \ippstage{stack} detection.\\
gexpTime & seconds & REAL & -999  &Exposure time of the g filter stack.  Necessary for converting \\
& & & & listed fluxes and magnitudes back to measured ADU counts.\\
gExtNSigma & - & REAL & -999  &An extendedness measure for the g filter \ippstage{stack} detection based on\\
& & & & the deviation between PSF and Kron (1980) magnitudes, normalized \\
& & & & by the PSF magnitude uncertainty.\\
gsky & $Jy/arcsec^2$ & REAL & -999  &Residual background sky level at the g filter \ippstage{stack} detection.\\
gskyErr & $Jy/arcsec^2$ & REAL & -999  &Error in residual background sky level at the g filter \ippstage{stack} detection.\\
gzp & magnitudes & REAL & 0  &Photometric zeropoint for the g filter stack.  Necessary for converting\\
& & & & listed fluxes and magnitudes back to measured ADU counts.\\
gzpAPER & magnitudes & REAL & 0 & Photometric zeropoint for the g filter stack (APERTURE-like magnitudes only).\\  
& & & & Needed to convert fluxes or magnitudes back to measured ADU counts. (DR2)\\
gPlateScale & arcsec/pixel & REAL & 0  &Local plate scale for the g filter stack.\\
rippDetectID \\
... & & & & same entries repeated for r, i, z, and y filters \\
yPlateScale \\
\hline
\end{tabular}
\end{center}
\label{table:StackObjectAttributes}
\end{table}%

\begin{table}[b]
\caption{StackApFlx: Contains the unconvolved fluxes within the SDSS R5 (r = 3.00 arcsec), R6 (r = 4.63 arcsec), and R7 (r = 7.43 arcsec) apertures \citep{Stoughton2002}.  Convolved fluxes within these same apertures are also provided for images convolved to 6 sky pixels (1.5 arcsec) and 8 sky pixels (2.0 arcsec).  All filters are matched into a single row.  See \ippdbtable{StackObjectThin} table for discussion of primary, secondary, and best detections.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsSTid & - & BIGINT & NA  &Unique internal PSPS \ippstage{stack} identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
randomStackObjID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
primaryDetection & - & TINYINT & 255  &Identifies if this row is the primary \ippstage{stack} detection.\\
bestDetection & - & TINYINT & 255  &Identifies if this row is the best detection.\\
gstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
gstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for g filter detection.\\
gippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
gflxR5 & Jy & REAL & -999  &Flux from g filter detection within an aperture of radius r = 3.00 arcsec.\\
gflxR5Err & Jy & REAL & -999  &Error in flux from g filter detection within an aperture of radius r = 3.00 arcsec.\\
gflxR5Std & Jy & REAL & -999  &Standard deviation of g filter flux within an aperture of radius r = 3.00 arcsec.\\
gflxR5Fill & - & REAL & -999  &Aperture fill factor for g filter detection within an aperture of radius r = 3.00 arcsec.\\
gflxR6 & Jy & REAL & -999  &Flux from g filter detection within an aperture of radius r = 4.63 arcsec.\\
gflxR6Err & Jy & REAL & -999  &Error in flux from g filter detection within an aperture of radius r = 4.63 arcsec.\\
gflxR6Std & Jy & REAL & -999  &Standard deviation of g filter flux within an aperture of radius r = 4.63 arcsec.\\
gflxR6Fill & - & REAL & -999  &Aperture fill factor for g filter detection within an aperture of radius r = 4.63 arcsec.\\
gflxR7 & Jy & REAL & -999  &Flux from g filter detection within an aperture of radius r = 7.43 arcsec.\\
gflxR7Err & Jy & REAL & -999  &Error in flux from g filter detection within an aperture of radius r = 7.43 arcsec.\\
gflxR7Std & Jy & REAL & -999  &Standard deviation of g filter flux within an aperture of radius r = 7.43 arcsec.\\
gflxR7Fill & - & REAL & -999  &Aperture fill factor for g filter detection within an aperture of radius r = 7.43 arcsec.\\
gc6flxR5 & Jy & REAL & -999  &Flux from g filter detection convolved to a target of 6 sky pixels\\
& & & & (1.5 arcsec) within an aperture of radius r = 3.00 arcsec.\\
gc6flxR5Err & Jy & REAL & -999  &Error in flux from g filter detection convolved to a target of \\
& & & & 6 sky pixels (1.5 arcsec) within an aperture of radius r = 3.00 arcsec.\\
gc6flxR5Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection convolved to \\
& & & & a target of 6 sky pixels (1.5 arcsec) within an aperture of radius r = 3.00 arcsec.\\
gc6flxR5Fill & - & REAL & -999  &Aperture fill factor for g filter detection convolved to a \\
& & & & target of 6 sky pixels (1.5 arcsec) within an aperture of radius r = 3.00 arcsec.\\
gc6flxR6 & Jy & REAL & -999  &Flux from g filter detection convolved to a target of 6 sky pixels\\
& & & & (1.5 arcsec) within an aperture of radius r = 4.63 arcsec.\\
gc6flxR6Err & Jy & REAL & -999  &Error in flux from g filter detection convolved to a target of \\
& & & & 6 sky pixels (1.5 arcsec) within an aperture of radius r = 4.63 arcsec.\\
gc6flxR6Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection convolved to \\
& & & & a target of 6 sky pixels (1.5 arcsec) within an aperture of radius r = 4.63 arcsec.\\
gc6flxR6Fill & - & REAL & -999  &Aperture fill factor for g filter detection convolved to a target of \\
& & & & 6 sky pixels (1.5 arcsec) within an aperture of radius r = 4.63 arcsec.\\
gc6flxR7 & Jy & REAL & -999  &Flux from g filter detection convolved to a target of 6 sky pixels\\
& & & & (1.5 arcsec) within an aperture of radius r = 7.43 arcsec.\\
gc6flxR7Err & Jy & REAL & -999  &Error in flux from g filter detection convolved to a target of \\
& & & & 6 sky pixels (1.5 arcsec) within an aperture of radius r = 7.43 arcsec.\\
gc6flxR7Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection convolved to a target of \\
& & & & 6 sky pixels (1.5 arcsec) within an aperture of radius r = 7.43 arcsec.\\
gc6flxR7Fill & - & REAL & -999  &Aperture fill factor for g filter detection convolved to a target of 6 sky \\
& & & & pixels (1.5 arcsec) within an aperture of radius r = 7.43 arcsec.\\
gc8flxR5 & Jy & REAL & -999  &Flux from g filter detection convolved to a target of 8 sky pixels\\
& & & & (2.0 arcsec) within an aperture of radius r = 3.00 arcsec.\\
gc8flxR5Err & Jy & REAL & -999  &Error in flux from g filter detection convolved to a target of 8 sky pixels \\
& & & & (2.0 arcsec) within an aperture of radius r = 3.00 arcsec.\\
gc8flxR5Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection convolved to a target of 8 sky \\
& & & & pixels (2.0 arcsec) within an aperture of radius r = 3.00 arcsec.\\
gc8flxR5Fill & - & REAL & -999  &Aperture fill factor for g filter detection convolved to a target of 8 sky \\
& & & & pixels (2.0 arcsec) within an aperture of radius r = 3.00 arcsec.\\
gc8flxR6 & Jy & REAL & -999  &Flux from g filter detection convolved to a target of 8 sky pixels\\
& & & & (2.0 arcsec) within an aperture of radius r = 4.63 arcsec.\\
gc8flxR6Err & Jy & REAL & -999  &Error in flux from g filter detection convolved to a target of 8 sky pixels\\
& & & & (2.0 arcsec) within an aperture of radius r = 4.63 arcsec.\\
gc8flxR6Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection convolved to a target of \\
& & & & 8 sky pixels (2.0 arcsec) within an aperture of radius r = 4.63 arcsec.\\
gc8flxR6Fill & - & REAL & -999  &Aperture fill factor for g filter detection convolved to a target of 8 sky pixels \\
& & & & (2.0 arcsec) within an aperture of radius r = 4.63 arcsec.\\
gc8flxR7 & Jy & REAL & -999  &Flux from g filter detection convolved to a target of 8 sky pixels (2.0 arcsec) \\
& & & & within an aperture of radius r = 7.43 arcsec.\\
gc8flxR7Err & Jy & REAL & -999  &Error in flux from g filter detection convolved to a target 8 sky pixels \\
& & & & (2.0 arcsec) within an aperture of radius r = 7.43 arcsec.\\
gc8flxR7Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection convolved to a target of \\
& & & & 8 sky pixels (2.0 arcsec) within an aperture of radius r = 7.43 arcsec.\\
gc8flxR7Fill & - & REAL & -999  &Aperture fill factor for g filter detection convolved to a target of 8 sky pixels \\
& & & & (2.0 arcsec) within an aperture of radius r = 7.43 arcsec.\\
rstackDetectID \\
... & & & & same entries repeated for r, i, z, and y filters \\
yc8flxR7Fill\\
\hline
\end{tabular}
\end{center}
\label{table:StackApFlx}
\end{table}%


%HAF commented out because stackmodelfitextra is junk: not in DR1 or DR2?
%\begin{table}[b]
%\caption{StackModelFitExtra: Contains the galaxy shape and concentration parameters measured from the \ippstage{stack} detections.  See \ippdbtable{StackObjectThin} table for discussion of primary, secondary, and best detections \citep[see]{Blakeslee2006,Cheng2011,Schade1995,Simard2011,Simard2002}}
%\begin{center}
%\resizebox{\textwidth}{!}{%
%\begin{tabular}{lllll}
%\hline
%\hline
%column name & units & data type & default & description\\
%\hline
%objID & - & BIGINT & NA  &Unique object identifier.\\
%uniquePspsSTid & - & BIGINT & NA  &Unique internal PSPS \ippstage{stack} identifier.\\
%ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
%randomStackObjID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
%primaryDetection & - & TINYINT & 255  &Identifies if this row is the primary \ippstage{stack} detection.\\
%bestDetection & - & TINYINT & 255  &Identifies if this row is the best detection. \\
%gippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%gstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
%gstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for g filter detection.\\
%gS2 & - & REAL & -999  &Smoothness parameter s2 from g filter \ippstage{stack} detection\\
%& & & & \citep{Cheng2011,Simard2002}.\\
%glogRT & - & REAL & -999  &Total residual from elliptically symmetric model from g filter \ippstage{stack}\\
%& & & & detection \citep{Cheng2011,Simard2002,Schade1995}.\\
%glogRA & - & REAL & -999  &Asymmetric residual from elliptically symmetric model from g filter \\
%& & & & \ippstage{stack} detection \citep{Cheng2011,Simard2002,Schade1995}.\\
%gbumpy & - & REAL & -999  &Bumpiness parameter from g filter \ippstage{stack} detection\\
%& & & & \citep{Blakeslee2006}.\\
%ghalfLightRad & arcsec & REAL & -999  &Half-light radius from g filter \ippstage{stack} detection.\\
%rippDetectID\\
%... & & & & same entries repeated for r, i, z, and y filters \\
%yhalfLightRad\\
%\hline
%\end{tabular}
%\end{center}
%\label{table:StackModelFitExtra}
%\end{table}%

\begin{table}[b]
\caption{StackModelFitExp: Contains the exponential fit parameters to extended sources.  See \ippdbtable{StackObjectThin} table for discussion of primary, secondary, and best detections. }
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsSTid & - & BIGINT & NA  &Unique internal PSPS \ippstage{stack} identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
randomStackObjID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
primaryDetection & - & TINYINT & 255  &Identifies if this row is the primary \ippstage{stack} detection.\\
bestDetection & - & TINYINT & 255  &Identifies if this row is the best detection.\\
gippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
gstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
gstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for g filter detection.\\
gExpRadius & arcsec & REAL & -999  &Exponential fit radius for g filter \ippstage{stack} detection.\\
gExpRadiusErr & arcsec & REAL & -999  &Error in exponential fit radius for g filter \ippstage{stack} detection.\\
gExpMag & AB & REAL & -999  &Exponential fit magnitude for g filter \ippstage{stack} detection.\\
gExpMagErr & AB & REAL & -999  &Error in exponential fit magnitude for g filter \ippstage{stack} detection.\\
gExpAb & - & REAL & -999  &Exponential fit axis ratio for g filter \ippstage{stack} detection.\\
gExpAbErr & - & REAL & -999  &Error in exponential fit axis ratio for g filter \ippstage{stack} detection.\\
gExpPhi & degrees & REAL & -999  &Major axis position angle, phi, of exponential fit for g \\
& & & & filter \ippstage{stack} detection.\\
gExpPhiErr & degrees & REAL & -999  &Error in major axis position angle of exponential fit for g\\
& & & & filter \ippstage{stack} detection.\\
gExpRa & degrees & FLOAT & -999  &Right ascension of exponential fit center for g filter \\
& & & & \ippstage{stack} detection.\\
gExpDec & degrees & FLOAT & -999  &Declination of exponential fit center for g filter \\
& & & & \ippstage{stack} detection.\\
gExpRaErr & arcsec & REAL & -999  &Error in right ascension of exponential fit center for g \\
& & & & filter \ippstage{stack} detection.\\
gExpDecErr & arcsec & REAL & -999  &Error in declination of exponential fit center for g \\
& & & & filter \ippstage{stack} detection.\\
gExpChisq & - & REAL & -999  &Exponential fit reduced chi squared for g filter \ippstage{stack}
detection.\\
rippDetectID \\
... & & & & same entries repeated for r, i, z, and y filters \\
%rippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%rstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
%rstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for r filter detection.\\
%rExpRadius & arcsec & REAL & -999  &Exponential fit radius for r filter \ippstage{stack} detection.\\
%rExpRadiusErr & arcsec & REAL & -999  &Error in exponential fit radius for r filter \ippstage{stack} detection.\\
%rExpMag & AB & REAL & -999  &Exponential fit magnitude for r filter \ippstage{stack} detection.\\
%rExpMagErr & AB & REAL & -999  &Error in exponential fit magnitude for r filter \ippstage{stack} detection.\\
%rExpAb & - & REAL & -999  &Exponential fit axis ratio for r filter \ippstage{stack} detection.\\
%rExpAbErr & - & REAL & -999  &Error in exponential fit axis ratio for r filter \ippstage{stack} detection.\\
%rExpPhi & degrees & REAL & -999  &Major axis position angle, phi, of exponential fit for r filter \ippstage{stack} detection.\\
%rExpPhiErr & degrees & REAL & -999  &Error in major axis position angle of exponential fit for r filter \ippstage{stack} detection.\\
%rExpRa & degrees & FLOAT & -999  &Right ascension of exponential fit center for r filter \ippstage{stack} detection.\\
%rExpDec & degrees & FLOAT & -999  &Declination of exponential fit center for r filter \ippstage{stack} detection.\\
%rExpRaErr & arcsec & REAL & -999  &Error in right ascension of exponential fit center for r filter \ippstage{stack} detection.\\
%rExpDecErr & arcsec & REAL & -999  &Error in declination of exponential fit center for r filter \ippstage{stack} detection.\\
%rExpChisq & - & REAL & -999  &Exponential fit reduced chi squared for r filter \ippstage{stack} detection.\\
%iippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%istackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
%istackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for i filter detection.\\
%iExpRadius & arcsec & REAL & -999  &Exponential fit radius for i filter \ippstage{stack} detection.\\
%iExpRadiusErr & arcsec & REAL & -999  &Error in exponential fit radius for i filter \ippstage{stack} detection.\\
%iExpMag & AB & REAL & -999  &Exponential fit magnitude for i filter \ippstage{stack} detection.\\
%iExpMagErr & AB & REAL & -999  &Error in exponential fit magnitude for i filter \ippstage{stack} detection.\\
%iExpAb & - & REAL & -999  &Exponential fit axis ratio for i filter \ippstage{stack} detection.\\
%iExpAbErr & - & REAL & -999  &Error in exponential fit axis ratio for i filter \ippstage{stack} detection.\\
%iExpPhi & degrees & REAL & -999  &Major axis position angle, phi, of exponential fit for i filter \ippstage{stack} detection.\\
%iExpPhiErr & degrees & REAL & -999  &Error in major axis position angle of exponential fit for i filter \ippstage{stack} detection.\\
%iExpRa & degrees & FLOAT & -999  &Right ascension of exponential fit center for i filter \ippstage{stack} detection.\\
%iExpDec & degrees & FLOAT & -999  &Declination of exponential fit center for i filter \ippstage{stack} detection.\\
%iExpRaErr & arcsec & REAL & -999  &Error in right ascension of exponential fit center for i filter \ippstage{stack} detection.\\
%iExpDecErr & arcsec & REAL & -999  &Error in declination of exponential fit center for i filter \ippstage{stack} detection.\\
%iExpChisq & - & REAL & -999  &Exponential fit reduced chi squared for i filter \ippstage{stack} detection.\\
%zippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%zstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
%zstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for z filter detection.\\
%zExpRadius & arcsec & REAL & -999  &Exponential fit radius for z filter \ippstage{stack} detection.\\
%zExpRadiusErr & arcsec & REAL & -999  &Error in exponential fit radius for z filter \ippstage{stack} detection.\\
%zExpMag & AB & REAL & -999  &Exponential fit magnitude for z filter \ippstage{stack} detection.\\
%zExpMagErr & AB & REAL & -999  &Error in exponential fit magnitude for z filter \ippstage{stack} detection.\\
%zExpAb & - & REAL & -999  &Exponential fit axis ratio for z filter \ippstage{stack} detection.\\
%zExpAbErr & - & REAL & -999  &Error in exponential fit axis ratio for z filter \ippstage{stack} detection.\\
%zExpPhi & degrees & REAL & -999  &Major axis position angle, phi, of exponential fit for z filter \ippstage{stack} detection.\\
%zExpPhiErr & degrees & REAL & -999  &Error in major axis position angle of exponential fit for z filter \ippstage{stack} detection.\\
%zExpRa & degrees & FLOAT & -999  &Right ascension of exponential fit center for z filter \ippstage{stack} detection.\\
%zExpDec & degrees & FLOAT & -999  &Declination of exponential fit center for z filter \ippstage{stack} detection.\\
%zExpRaErr & arcsec & REAL & -999  &Error in right ascension of exponential fit center for z filter \ippstage{stack} detection.\\
%zExpDecErr & arcsec & REAL & -999  &Error in declination of exponential fit center for z filter \ippstage{stack} detection.\\
%zExpChisq & - & REAL & -999  &Exponential fit reduced chi squared for z filter \ippstage{stack} detection.\\
%yippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%ystackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
%ystackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for y filter detection.\\
%yExpRadius & arcsec & REAL & -999  &Exponential fit radius for y filter \ippstage{stack} detection.\\
%yExpRadiusErr & arcsec & REAL & -999  &Error in exponential fit radius for y filter \ippstage{stack} detection.\\
%yExpMag & AB & REAL & -999  &Exponential fit magnitude for y filter \ippstage{stack} detection.\\
%yExpMagErr & AB & REAL & -999  &Error in exponential fit magnitude for y filter \ippstage{stack} detection.\\
%yExpAb & - & REAL & -999  &Exponential fit axis ratio for y filter \ippstage{stack} detection.\\
%yExpAbErr & - & REAL & -999  &Error in exponential fit axis ratio for y filter \ippstage{stack} detection.\\
%yExpPhi & degrees & REAL & -999  &Major axis position angle, phi, of exponential fit for y filter \ippstage{stack} detection.\\
%yExpPhiErr & degrees & REAL & -999  &Error in major axis position angle of exponential fit for y filter \ippstage{stack} detection.\\
%yExpRa & degrees & FLOAT & -999  &Right ascension of exponential fit center for y filter \ippstage{stack} detection.\\
%yExpDec & degrees & FLOAT & -999  &Declination of exponential fit center for y filter \ippstage{stack} detection.\\
%yExpRaErr & arcsec & REAL & -999  &Error in right ascension of exponential fit center for y filter \ippstage{stack} detection.\\
%yExpDecErr & arcsec & REAL & -999  &Error in declination of exponential fit center for y filter \ippstage{stack} detection.\\
%yExpChisq & - & REAL & -999  &Exponential fit reduced chi squared for y filter \ippstage{stack} detection.\\
yExpChisq \\
\hline
\end{tabular}
\end{center}
\label{table:StackModelFitExp}
\end{table}%

\begin{table}[b]
\caption{StackModelFitDeV: Contains the \citet{deVaucouleurs1948} fit parameters to extended sources.  See \ippdbtable{StackObjectThin} table for discussion of primary, secondary, and best detections.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsSTid & - & BIGINT & NA  &Unique internal PSPS \ippstage{stack} identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
randomStackObjID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
primaryDetection & - & TINYINT & 255  &Identifies if this row is the primary \ippstage{stack} detection.\\
bestDetection & - & TINYINT & 255  &Identifies if this row is the best detection.\\
gippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
gstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
gstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for g filter detection.\\
gDeVRadius & arcsec & REAL & -999  &\citet{deVaucouleurs1948} fit radius for g filter \ippstage{stack} detection.\\
gDeVRadiusErr & arcsec & REAL & -999  &Error in \citet{deVaucouleurs1948} fit radius for g filter \ippstage{stack} detection.\\
gDeVMag & AB & REAL & -999  &\citet{deVaucouleurs1948} fit magnitude for g filter \ippstage{stack} detection.\\
gDeVMagErr & AB & REAL & -999  &Error in \citet{deVaucouleurs1948} fit magnitude for g filter \ippstage{stack} detection.\\
gDeVAb & - & REAL & -999  &\citet{deVaucouleurs1948} fit axis ratio for g filter \ippstage{stack} detection.\\
gDeVAbErr & - & REAL & -999  &Error in \citet{deVaucouleurs1948} fit axis ratio for g filter \ippstage{stack} detection.\\
gDeVPhi & degrees & REAL & -999  &Major axis position angle, phi, of \citet{deVaucouleurs1948} fit for g filter \\
& & & & \ippstage{stack} detection.\\
gDeVPhiErr & degrees & REAL & -999  &Error in major axis position angle of \citet{deVaucouleurs1948} fit for g filter\\
& & & & \ippstage{stack} detection.\\
gDeVRa & degrees & FLOAT & -999  &Right ascension of \citet{deVaucouleurs1948} fit center for g filter \ippstage{stack} \\
& & & & detection.\\
gDeVDec & degrees & FLOAT & -999  &Declination of \citet{deVaucouleurs1948} fit center for g filter \\
& & & & \ippstage{stack} detection.\\
gDeVRaErr & arcsec & REAL & -999  &Error in right ascension of \citet{deVaucouleurs1948} fit center for g filter \ippstage{stack} \\
& & & & detection.\\
gDeVDecErr & arcsec & REAL & -999  &Error in declination of \citet{deVaucouleurs1948} fit center for g filter \ippstage{stack} detection.\\
gDeVChisq & - & REAL & -999  &\citet{deVaucouleurs1948} fit reduced chi squared for g filter \ippstage{stack} detection.\\
rippDetectID \\
... & & & & same entries repeated for r, i, z, and y filters \\
%rippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%rstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
%rstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for r filter detection.\\
%rDeVRadius & arcsec & REAL & -999  &\citet{deVaucouleurs1948} fit radius for r filter \ippstage{stack} detection.\\
%rDeVRadiusErr & arcsec & REAL & -999  &Error in \citet{deVaucouleurs1948} fit radius for r filter \ippstage{stack} detection.\\
%rDeVMag & AB & REAL & -999  &\citet{deVaucouleurs1948} fit magnitude for r filter \ippstage{stack} detection.\\
%rDeVMagErr & AB & REAL & -999  &Error in \citet{deVaucouleurs1948} fit magnitude for r filter \ippstage{stack} detection.\\
%rDeVAb & - & REAL & -999  &\citet{deVaucouleurs1948} fit axis ratio for r filter \ippstage{stack} detection.\\
%rDeVAbErr & - & REAL & -999  &Error in \citet{deVaucouleurs1948} fit axis ratio for r filter \ippstage{stack} detection.\\
%rDeVPhi & degrees & REAL & -999  &Major axis position angle, phi, of \citet{deVaucouleurs1948} fit for r filter \ippstage{stack} detection.\\
%rDeVPhiErr & degrees & REAL & -999  &Error in major axis position angle of \citet{deVaucouleurs1948} fit for r filter \ippstage{stack} detection.\\
%rDeVRa & degrees & FLOAT & -999  &Right ascension of \citet{deVaucouleurs1948} fit center for r filter \ippstage{stack} detection.\\
%rDeVDec & degrees & FLOAT & -999  &Declination of \citet{deVaucouleurs1948} fit center for r filter \ippstage{stack} detection.\\
%rDeVRaErr & arcsec & REAL & -999  &Error in right ascension of \citet{deVaucouleurs1948} fit center for r filter \ippstage{stack} detection.\\
%rDeVDecErr & arcsec & REAL & -999  &Error in declination of \citet{deVaucouleurs1948} fit center for r filter \ippstage{stack} detection.\\
%rDeVChisq & - & REAL & -999  &\citet{deVaucouleurs1948} fit reduced chi squared for r filter \ippstage{stack} detection.\\
%iippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%istackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
%istackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for i filter detection.\\
%iDeVRadius & arcsec & REAL & -999  &\citet{deVaucouleurs1948} fit radius for i filter \ippstage{stack} detection.\\
%iDeVRadiusErr & arcsec & REAL & -999  &Error in \citet{deVaucouleurs1948} fit radius for i filter \ippstage{stack} detection.\\
%iDeVMag & AB & REAL & -999  &\citet{deVaucouleurs1948} fit magnitude for i filter \ippstage{stack} detection.\\
%iDeVMagErr & AB & REAL & -999  &Error in \citet{deVaucouleurs1948} fit magnitude for i filter \ippstage{stack} detection.\\
%iDeVAb & - & REAL & -999  &\citet{deVaucouleurs1948} fit axis ratio for i filter \ippstage{stack} detection.\\
%iDeVAbErr & - & REAL & -999  &Error in \citet{deVaucouleurs1948} fit axis ratio for i filter \ippstage{stack} detection.\\
%iDeVPhi & degrees & REAL & -999  &Major axis position angle, phi, of \citet{deVaucouleurs1948} fit for i filter \ippstage{stack} detection.\\
%iDeVPhiErr & degrees & REAL & -999  &Error in major axis position angle of \citet{deVaucouleurs1948} fit for i filter \ippstage{stack} detection.\\
%iDeVRa & degrees & FLOAT & -999  &Right ascension of \citet{deVaucouleurs1948} fit center for i filter \ippstage{stack} detection.\\
%iDeVDec & degrees & FLOAT & -999  &Declination of \citet{deVaucouleurs1948} fit center for i filter \ippstage{stack} detection.\\
%iDeVRaErr & arcsec & REAL & -999  &Error in right ascension of \citet{deVaucouleurs1948} fit center for i filter \ippstage{stack} detection.\\
%iDeVDecErr & arcsec & REAL & -999  &Error in declination of \citet{deVaucouleurs1948} fit center for i filter \ippstage{stack} detection.\\
%iDeVChisq & - & REAL & -999  &\citet{deVaucouleurs1948} fit reduced chi squared for i filter \ippstage{stack} detection.\\
%zippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%zstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
%zstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for z filter detection.\\
%zDeVRadius & arcsec & REAL & -999  &\citet{deVaucouleurs1948} fit radius for z filter \ippstage{stack} detection.\\
%zDeVRadiusErr & arcsec & REAL & -999  &Error in \citet{deVaucouleurs1948} fit radius for z filter \ippstage{stack} detection.\\
%zDeVMag & AB & REAL & -999  &\citet{deVaucouleurs1948} fit magnitude for z filter \ippstage{stack} detection.\\
%zDeVMagErr & AB & REAL & -999  &Error in \citet{deVaucouleurs1948} fit magnitude for z filter \ippstage{stack} detection.\\
%zDeVAb & - & REAL & -999  &\citet{deVaucouleurs1948} fit axis ratio for z filter \ippstage{stack} detection.\\
%zDeVAbErr & - & REAL & -999  &Error in \citet{deVaucouleurs1948} fit axis ratio for z filter \ippstage{stack} detection.\\
%zDeVPhi & degrees & REAL & -999  &Major axis position angle, phi, of \citet{deVaucouleurs1948} fit for z filter \ippstage{stack} detection.\\
%zDeVPhiErr & degrees & REAL & -999  &Error in major axis position angle of \citet{deVaucouleurs1948} fit for z filter \ippstage{stack} detection.\\
%zDeVRa & degrees & FLOAT & -999  &Right ascension of \citet{deVaucouleurs1948} fit center for z filter \ippstage{stack} detection.\\
%zDeVDec & degrees & FLOAT & -999  &Declination of \citet{deVaucouleurs1948} fit center for z filter \ippstage{stack} detection.\\
%zDeVRaErr & arcsec & REAL & -999  &Error in right ascension of \citet{deVaucouleurs1948} fit center for z filter \ippstage{stack} detection.\\
%zDeVDecErr & arcsec & REAL & -999  &Error in declination of \citet{deVaucouleurs1948} fit center for z filter \ippstage{stack} detection.\\
%zDeVChisq & - & REAL & -999  &\citet{deVaucouleurs1948} fit reduced chi squared for z filter \ippstage{stack} detection.\\
%yippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%ystackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
%ystackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for y filter detection.\\
%yDeVRadius & arcsec & REAL & -999  &\citet{deVaucouleurs1948} fit radius for y filter \ippstage{stack} detection.\\
%yDeVRadiusErr & arcsec & REAL & -999  &Error in \citet{deVaucouleurs1948} fit radius for y filter \ippstage{stack} detection.\\
%yDeVMag & AB & REAL & -999  &\citet{deVaucouleurs1948} fit magnitude for y filter \ippstage{stack} detection.\\
%yDeVMagErr & AB & REAL & -999  &Error in \citet{deVaucouleurs1948} fit magnitude for y filter \ippstage{stack} detection.\\
%yDeVAb & - & REAL & -999  &\citet{deVaucouleurs1948} fit axis ratio for y filter \ippstage{stack} detection.\\
%yDeVAbErr & - & REAL & -999  &Error in \citet{deVaucouleurs1948} fit axis ratio for y filter \ippstage{stack} detection.\\
%yDeVPhi & degrees & REAL & -999  &Major axis position angle, phi, of \citet{deVaucouleurs1948} fit for y filter \ippstage{stack} detection.\\
%yDeVPhiErr & degrees & REAL & -999  &Error in major axis position angle of \citet{deVaucouleurs1948} fit for y filter \ippstage{stack} detection.\\
%yDeVRa & degrees & FLOAT & -999  &Right ascension of \citet{deVaucouleurs1948} fit center for y filter \ippstage{stack} detection.\\
%yDeVDec & degrees & FLOAT & -999  &Declination of \citet{deVaucouleurs1948} fit center for y filter \ippstage{stack} detection.\\
%yDeVRaErr & arcsec & REAL & -999  &Error in right ascension of \citet{deVaucouleurs1948} fit center for y filter \ippstage{stack} detection.\\
%yDeVDecErr & arcsec & REAL & -999  &Error in declination of \citet{deVaucouleurs1948} fit center for y filter \ippstage{stack} detection.\\
%yDeVChisq & - & REAL & -999  &\citet{deVaucouleurs1948} fit reduced chi squared for y filter \ippstage{stack} detection.\\
yDeVChisq \\
\hline
\end{tabular}
\end{center}
\label{table:StackModelFitDeV}
\end{table}%

\begin{table}[b]
\caption{StackModelFitSer: Contains the \citet{Sersic1963} fit parameters to extended sources.  See \ippdbtable{StackObjectThin} table for discussion of primary, secondary, and best detections \citep{Sersic1963}.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsSTid & - & BIGINT & NA  &Unique internal PSPS \ippstage{stack} identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
randomStackObjID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
primaryDetection & - & TINYINT & 255  &Identifies if this row is the primary \ippstage{stack} detection.\\
bestDetection & - & TINYINT & 255  &Identifies if this row is the best detection.\\
gippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
gstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
gstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for g filter detection.\\
gSerRadius & arcsec & REAL & -999  &\citet{Sersic1963} fit radius for g filter \ippstage{stack} detection.\\
gSerRadiusErr & arcsec & REAL & -999  &Error in \citet{Sersic1963} fit radius for g filter \ippstage{stack} detection.\\
gSerMag & AB & REAL & -999  &\citet{Sersic1963} fit magnitude for g filter \ippstage{stack} detection.\\
gSerMagErr & AB & REAL & -999  &Error in \citet{Sersic1963} fit magnitude for g filter \ippstage{stack} detection.\\
gSerAb & - & REAL & -999  &\citet{Sersic1963} fit axis ratio for g filter \ippstage{stack} detection.\\
gSerAbErr & - & REAL & -999  &Error in \citet{Sersic1963} fit axis ratio for g filter \ippstage{stack} detection.\\
gSerNu & - & REAL & -999  &\citet{Sersic1963} fit index for g filter \ippstage{stack} detection.\\
gSerNuErr & - & REAL & -999  &Error in \citet{Sersic1963} fit index for g filter \ippstage{stack} detection.\\
gSerPhi & degrees & REAL & -999  &Major axis position angle, phi, of \citet{Sersic1963} fit for g filter \ippstage{stack} detection.\\
gSerPhiErr & degrees & REAL & -999  &Error in major axis position angle of \citet{Sersic1963} fit for g filter \ippstage{stack} detection.\\
gSerRa & degrees & FLOAT & -999  &Right ascension of \citet{Sersic1963} fit center for g filter \ippstage{stack} detection.\\
gSerDec & degrees & FLOAT & -999  &Declination of \citet{Sersic1963} fit center for g filter \ippstage{stack} detection.\\
gSerRaErr & arcsec & REAL & -999  &Error in right ascension of \citet{Sersic1963} fit center for g filter \ippstage{stack} detection.\\
gSerDecErr & arcsec & REAL & -999  &Error in declination of \citet{Sersic1963} fit center for g filter \ippstage{stack} detection.\\
gSerChisq & - & REAL & -999  &\citet{Sersic1963} fit reduced chi squared for g filter \ippstage{stack} detection.\\
rippDetectID \\
... & & & & same entries repeated for r, i, z, and y filters \\
%rippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%rstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
%rstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for r filter detection.\\
%rSerRadius & arcsec & REAL & -999  &\citet{Sersic1963} fit radius for r filter \ippstage{stack} detection.\\
%rSerRadiusErr & arcsec & REAL & -999  &Error in \citet{Sersic1963} fit radius for r filter \ippstage{stack} detection.\\
%rSerMag & AB & REAL & -999  &\citet{Sersic1963} fit magnitude for r filter \ippstage{stack} detection.\\
%rSerMagErr & AB & REAL & -999  &Error in \citet{Sersic1963} fit magnitude for r filter \ippstage{stack} detection.\\
%rSerAb & - & REAL & -999  &\citet{Sersic1963} fit axis ratio for r filter \ippstage{stack} detection.\\
%rSerAbErr & - & REAL & -999  &Error in \citet{Sersic1963} fit axis ratio for r filter \ippstage{stack} detection.\\
%rSerNu & - & REAL & -999  &\citet{Sersic1963} fit index for r filter \ippstage{stack} detection.\\
%rSerNuErr & - & REAL & -999  &Error in \citet{Sersic1963} fit index for r filter \ippstage{stack} detection.\\
%rSerPhi & degrees & REAL & -999  &Major axis position angle, phi, of \citet{Sersic1963} fit for r filter \ippstage{stack} detection.\\
%rSerPhiErr & degrees & REAL & -999  &Error in major axis position angle of \citet{Sersic1963} fit for r filter \ippstage{stack} detection.\\
%rSerRa & degrees & FLOAT & -999  &Right ascension of \citet{Sersic1963} fit center for r filter \ippstage{stack} detection.\\
%rSerDec & degrees & FLOAT & -999  &Declination of \citet{Sersic1963} fit center for r filter \ippstage{stack} detection.\\
%rSerRaErr & arcsec & REAL & -999  &Error in right ascension of \citet{Sersic1963} fit center for r filter \ippstage{stack} detection.\\
%rSerDecErr & arcsec & REAL & -999  &Error in declination of \citet{Sersic1963} fit center for r filter \ippstage{stack} detection.\\
%rSerChisq & - & REAL & -999  &\citet{Sersic1963} fit reduced chi squared for r filter \ippstage{stack} detection.\\
%iippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%istackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
%istackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for i filter detection.\\
%iSerRadius & arcsec & REAL & -999  &\citet{Sersic1963} fit radius for i filter \ippstage{stack} detection.\\
%iSerRadiusErr & arcsec & REAL & -999  &Error in \citet{Sersic1963} fit radius for i filter \ippstage{stack} detection.\\
%iSerMag & AB & REAL & -999  &\citet{Sersic1963} fit magnitude for i filter \ippstage{stack} detection.\\
%iSerMagErr & AB & REAL & -999  &Error in \citet{Sersic1963} fit magnitude for i filter \ippstage{stack} detection.\\
%iSerAb & - & REAL & -999  &\citet{Sersic1963} fit axis ratio for i filter \ippstage{stack} detection.\\
%iSerAbErr & - & REAL & -999  &Error in \citet{Sersic1963} fit axis ratio for i filter \ippstage{stack} detection.\\
%iSerNu & - & REAL & -999  &\citet{Sersic1963} fit index for i filter \ippstage{stack} detection.\\
%iSerNuErr & - & REAL & -999  &Error in \citet{Sersic1963} fit index for i filter \ippstage{stack} detection.\\
%iSerPhi & degrees & REAL & -999  &Major axis position angle, phi, of \citet{Sersic1963} fit for i filter \ippstage{stack} detection.\\
%iSerPhiErr & degrees & REAL & -999  &Error in major axis position angle of \citet{Sersic1963} fit for i filter \ippstage{stack} detection.\\
%iSerRa & degrees & FLOAT & -999  &Right ascension of \citet{Sersic1963} fit center for i filter \ippstage{stack} detection.\\
%iSerDec & degrees & FLOAT & -999  &Declination of \citet{Sersic1963} fit center for i filter \ippstage{stack} detection.\\
%iSerRaErr & arcsec & REAL & -999  &Error in right ascension of \citet{Sersic1963} fit center for i filter \ippstage{stack} detection.\\
%iSerDecErr & arcsec & REAL & -999  &Error in declination of \citet{Sersic1963} fit center for i filter \ippstage{stack} detection.\\
%iSerChisq & - & REAL & -999  &\citet{Sersic1963} fit reduced chi squared for i filter \ippstage{stack} detection.\\
%zippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%zstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
%zstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for z filter detection.\\
%zSerRadius & arcsec & REAL & -999  &\citet{Sersic1963} fit radius for z filter \ippstage{stack} detection.\\
%zSerRadiusErr & arcsec & REAL & -999  &Error in \citet{Sersic1963} fit radius for z filter \ippstage{stack} detection.\\
%zSerMag & AB & REAL & -999  &\citet{Sersic1963} fit magnitude for z filter \ippstage{stack} detection.\\
%zSerMagErr & AB & REAL & -999  &Error in \citet{Sersic1963} fit magnitude for z filter \ippstage{stack} detection.\\
%zSerAb & - & REAL & -999  &\citet{Sersic1963} fit axis ratio for z filter \ippstage{stack} detection.\\
%zSerAbErr & - & REAL & -999  &Error in \citet{Sersic1963} fit axis ratio for z filter \ippstage{stack} detection.\\
%zSerNu & - & REAL & -999  &\citet{Sersic1963} fit index for z filter \ippstage{stack} detection.\\
%zSerNuErr & - & REAL & -999  &Error in \citet{Sersic1963} fit index for z filter \ippstage{stack} detection.\\
%zSerPhi & degrees & REAL & -999  &Major axis position angle, phi, of \citet{Sersic1963} fit for z filter \ippstage{stack} detection.\\
%zSerPhiErr & degrees & REAL & -999  &Error in major axis position angle of \citet{Sersic1963} fit for z filter \ippstage{stack} detection.\\
%zSerRa & degrees & FLOAT & -999  &Right ascension of \citet{Sersic1963} fit center for z filter \ippstage{stack} detection.\\
%zSerDec & degrees & FLOAT & -999  &Declination of \citet{Sersic1963} fit center for z filter \ippstage{stack} detection.\\
%zSerRaErr & arcsec & REAL & -999  &Error in right ascension of \citet{Sersic1963} fit center for z filter \ippstage{stack} detection.\\
%zSerDecErr & arcsec & REAL & -999  &Error in declination of \citet{Sersic1963} fit center for z filter \ippstage{stack} detection.\\
%zSerChisq & - & REAL & -999  &\citet{Sersic1963} fit reduced chi squared for z filter \ippstage{stack} detection.\\
%yippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%ystackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
%ystackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for y filter detection.\\
%ySerRadius & arcsec & REAL & -999  &\citet{Sersic1963} fit radius for y filter \ippstage{stack} detection.\\
%ySerRadiusErr & arcsec & REAL & -999  &Error in \citet{Sersic1963} fit radius for y filter \ippstage{stack} detection.\\
%ySerMag & AB & REAL & -999  &\citet{Sersic1963} fit magnitude for y filter \ippstage{stack} detection.\\
%ySerMagErr & AB & REAL & -999  &Error in \citet{Sersic1963} fit magnitude for y filter \ippstage{stack} detection.\\
%ySerAb & - & REAL & -999  &\citet{Sersic1963} fit axis ratio for y filter \ippstage{stack} detection.\\
%ySerAbErr & - & REAL & -999  &Error in \citet{Sersic1963} fit axis ratio for y filter \ippstage{stack} detection.\\
%ySerNu & - & REAL & -999  &\citet{Sersic1963} fit index for y filter \ippstage{stack} detection.\\
%ySerNuErr & - & REAL & -999  &Error in \citet{Sersic1963} fit index for y filter \ippstage{stack} detection.\\
%ySerPhi & degrees & REAL & -999  &Major axis position angle, phi, of \citet{Sersic1963} fit for y filter \ippstage{stack} detection.\\
%ySerPhiErr & degrees & REAL & -999  &Error in major axis position angle of \citet{Sersic1963} fit for y filter \ippstage{stack} detection.\\
%ySerRa & degrees & FLOAT & -999  &Right ascension of \citet{Sersic1963} fit center for y filter \ippstage{stack} detection.\\
%ySerDec & degrees & FLOAT & -999  &Declination of \citet{Sersic1963} fit center for y filter \ippstage{stack} detection.\\
%ySerRaErr & arcsec & REAL & -999  &Error in right ascension of \citet{Sersic1963} fit center for y filter \ippstage{stack} detection.\\
%ySerDecErr & arcsec & REAL & -999  &Error in declination of \citet{Sersic1963} fit center for y filter \ippstage{stack} detection.\\
%ySerChisq & - & REAL & -999  &\citet{Sersic1963} fit reduced chi squared for y filter \ippstage{stack} detection.\\
ySerChisq \\
\hline
\end{tabular}
\end{center}
\label{table:StackModelFitSer}
\end{table}%

\begin{table}[b]
\caption{StackApFlxExGalUnc: Contains the unconvolved fluxes within the SDSS R3 (r = 1.03 arcsec), R4 (r = 1.76 arcsec), R5 (r = 3.00 arcsec), R6 (r = 4.63 arcsec), R7 (r = 7.43 arcsec), R8 (r = 11.42 arcsec), R9 (r = 18.20 arcsec), R10 (r = 28.20 arcsec), and R11 (r = 44.21 arcsec) apertures \citep{Stoughton2002} for extended sources.  These measurements are only provided for objects in the extragalactic sky, i.e., they are not provided for objects in the Galactic plane because they are not useful in crowded areas.  See \ippdbtable{StackObjectThin} table for discussion of primary, secondary, and best detections.  }
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsSTid & - & BIGINT & NA  &Unique internal PSPS \ippstage{stack} identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
randomStackObjID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
primaryDetection & - & TINYINT & 255  &Identifies if this row is the primary \ippstage{stack} detection.\\
bestDetection & - & TINYINT & 255  &Identifies if this row is the best detection.\\
gippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
gstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
gstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for g filter detection.\\
gflxR3 & Jy & REAL & -999  &Flux from g filter detection within an aperture of radius r = 1.03 arcsec.\\
gflxR3Err & Jy & REAL & -999  &Error in flux from g filter detection within an aperture of radius r = 1.03 arcsec.\\
gflxR3Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection within an aperture of radius \\
& & & & r = 1.03 arcsec.\\
gflxR3Fill & - & REAL & -999  &Aperture fill factor for g filter detection within an aperture of radius r = 1.03 arcsec.\\
gflxR4 & Jy & REAL & -999  &Flux from g filter detection within an aperture of radius r = 1.76 arcsec.\\
gflxR4Err & Jy & REAL & -999  &Error in flux from g filter detection within an aperture of radius r = 1.76 arcsec.\\
gflxR4Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection within an aperture of radius \\
& & & & r = 1.76 arcsec.\\
gflxR4Fill & - & REAL & -999  &Aperture fill factor for g filter detection within an aperture of radius r = 1.76 arcsec.\\
gflxR5 & Jy & REAL & -999  &Flux from g filter detection within an aperture of radius r = 3.00 arcsec.\\
gflxR5Err & Jy & REAL & -999  &Error in flux from g filter detection within an aperture of radius r = 3.00 arcsec.\\
gflxR5Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection within an aperture of radius \\
& & & & r = 3.00 arcsec.\\
gflxR5Fill & - & REAL & -999  &Aperture fill factor for g filter detection within an aperture of radius r = 3.00 arcsec.\\
gflxR6 & Jy & REAL & -999  &Flux from g filter detection within an aperture of radius r = 4.63 arcsec.\\
gflxR6Err & Jy & REAL & -999  &Error in flux from g filter detection within an aperture of radius r = 4.63 arcsec.\\
gflxR6Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection within an aperture of radius \\
& & & & r = 4.63 arcsec.\\
gflxR6Fill & - & REAL & -999  &Aperture fill factor for g filter detection within an aperture of radius r = 4.63 arcsec.\\
gflxR7 & Jy & REAL & -999  &Flux from g filter detection within an aperture of radius r = 7.43 arcsec.\\
gflxR7Err & Jy & REAL & -999  &Error in flux from g filter detection within an aperture of radius r = 7.43 arcsec.\\
gflxR7Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection within an aperture of radius \\
& & & & r = 7.43 arcsec.\\
gflxR7Fill & - & REAL & -999  &Aperture fill factor for g filter detection within an aperture of radius r = 7.43 arcsec.\\
gflxR8 & Jy & REAL & -999  &Flux from g filter detection within an aperture of radius r = 11.42 arcsec.\\
gflxR8Err & Jy & REAL & -999  &Error in flux from g filter detection within an aperture of radius r = 11.42 arcsec.\\
gflxR8Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection within an aperture of radius \\
& & & & r = 11.42 arcsec.\\
gflxR8Fill & - & REAL & -999  &Aperture fill factor for g filter detection within an aperture of radius r = 11.42 arcsec.\\
gflxR9 & Jy & REAL & -999  &Flux from g filter detection within an aperture of radius r = 18.20 arcsec.\\
gflxR9Err & Jy & REAL & -999  &Error in flux from g filter detection within an aperture of radius r = 18.20 arcsec.\\
gflxR9Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection within an aperture of radius \\
& & & & r = 18.20 arcsec.\\
gflxR9Fill & - & REAL & -999  &Aperture fill factor for g filter detection within an aperture of radius r = 18.20 arcsec.\\
gflxR10 & Jy & REAL & -999  &Flux from g filter detection within an aperture of radius r = 28.20 arcsec.\\
gflxR10Err & Jy & REAL & -999  &Error in flux from g filter detection within an aperture of radius r = 28.20 arcsec.\\
gflxR10Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection within an aperture of radius \\
& & & & r = 28.20 arcsec.\\
gflxR10Fill & - & REAL & -999  &Aperture fill factor for g filter detection within an aperture of radius r = 28.20 arcsec.\\
gflxR11 & Jy & REAL & -999  &Flux from g filter detection within an aperture of radius r = 44.21 arcsec.\\
gflxR11Err & Jy & REAL & -999  &Error in flux from g filter detection within an aperture of radius r = 44.21 arcsec.\\
gflxR11Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection within an aperture of radius \\
& & & & r = 44.21 arcsec.\\
gflxR11Fill & - & REAL & -999  &Aperture fill factor for g filter detection within an aperture of radius r = 44.21 arcsec.\\
rippDetectID\\
... & & & & same entries repeated for r, i, z, and y filters \\
yflxR11Fill\\
\hline
\end{tabular}
\end{center}
\label{table:StackApFlxExGalUnc}
\end{table}%

\begin{table}[b]
\caption{StackApFlxExGalCon6: Contains the fluxes within the SDSS R3 (r = 1.03 arcsec), R4 (r = 1.76 arcsec), R5 (r = 3.00 arcsec), R6 (r = 4.63 arcsec), R7 (r = 7.43 arcsec), R8 (r = 11.42 arcsec), R9 (r = 18.20 arcsec), R10 (r = 28.20 arcsec), and R11 (r = 44.21 arcsec) apertures (\citep{Stoughton2002} for extended sources after the images have been convolved to a target of 6 sky pixels (1.5 arcsec).  These measurements are only provided for objects in the extragalactic sky, i.e., they are not provided for objects in the Galactic plane because they are not useful in crowded areas.  See \ippdbtable{StackObjectThin} table for discussion of primary, secondary, and best detections.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsSTid & - & BIGINT & NA  &Unique internal PSPS \ippstage{stack} identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
randomStackObjID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
primaryDetection & - & TINYINT & 255  &Identifies if this row is the primary \ippstage{stack} detection.\\
bestDetection & - & TINYINT & 255  &Identifies if this row is the best detection.\\
gippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
gstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
gstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for g filter detection.\\
gc6flxR3 & Jy & REAL & -999  &Flux from g filter detection convolved to a target of 6 sky pixels (1.5 arcsec) \\
& & & & within an aperture of radius r = 1.03 arcsec.\\
gc6flxR3Err & Jy & REAL & -999  &Error in flux from g filter detection convolved to a target of 6 sky pixels \\
& & & & (1.5 arcsec) within an aperture of radius r = 1.03 arcsec.\\
gc6flxR3Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection convolved to a target of 6 \\
& & & & sky pixels (1.5 arcsec) within an aperture of radius r = 1.03 arcsec.\\
gc6flxR3Fill & - & REAL & -999  &Aperture fill factor for g filter detection convolved to a target of 6 sky pixels \\
& & & & (1.5 arcsec) within an aperture of radius r = 1.03 arcsec.\\
%gc6flxR4 & Jy & REAL & -999  &Flux from g filter detection convolved to a target of 6 sky pixels (1.5 arcsec) \\
%& & & & within an aperture of radius r = 1.76 arcsec.\\
%gc6flxR4Err & Jy & REAL & -999  &Error in flux from g filter detection convolved to a target of 6 sky pixels \\
%& & & & (1.5 arcsec) within an aperture of radius r = 1.76 arcsec.\\
%gc6flxR4Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection convolved to a target of 6 \\
%& & & & sky pixels (1.5 arcsec) within an aperture of radius r = 1.76 arcsec.\\
%gc6flxR4Fill & - & REAL & -999  &Aperture fill factor for g filter detection convolved to a target of 6 sky pixels \\
%& & & & (1.5 arcsec) within an aperture of radius r = 1.76 arcsec.\\
%gc6flxR5 & Jy & REAL & -999  &Flux from g filter detection convolved to a target of 6 sky pixels (1.5 arcsec) \\
%& & & & within an aperture of radius r = 3.00 arcsec.\\
%gc6flxR5Err & Jy & REAL & -999  &Error in flux from g filter detection convolved to a target of 6 sky pixels \\
%& & & & (1.5 arcsec) within an aperture of radius r = 3.00 arcsec.\\
%gc6flxR5Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection convolved to a target of 6 \\
%& & & & sky pixels (1.5 arcsec) within an aperture of radius r = 3.00 arcsec.\\
%gc6flxR5Fill & - & REAL & -999  &Aperture fill factor for g filter detection convolved to a target of 6 sky pixels \\
%& & & & (1.5 arcsec) within an aperture of radius r = 3.00 arcsec.\\
%gc6flxR6 & Jy & REAL & -999  &Flux from g filter detection convolved to a target of 6 sky pixels (1.5 arcsec) \\
%& & & & within an aperture of radius r = 4.63 arcsec.\\
%gc6flxR6Err & Jy & REAL & -999  &Error in flux from g filter detection convolved to a target of 6 sky pixels \\
%& & & & (1.5 arcsec) within an aperture of radius r = 4.63 arcsec.\\
%gc6flxR6Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection convolved to a target of 6 \\
%& & & & sky pixels (1.5 arcsec) within an aperture of radius r = 4.63 arcsec.\\
%gc6flxR6Fill & - & REAL & -999  &Aperture fill factor for g filter detection convolved to a target of 6 sky pixels \\
%& & & & (1.5 arcsec) within an aperture of radius r = 4.63 arcsec.\\
%gc6flxR7 & Jy & REAL & -999  &Flux from g filter detection convolved to a target of 6 sky pixels (1.5 arcsec) \\
%& & & & within an aperture of radius r = 7.43 arcsec.\\
%gc6flxR7Err & Jy & REAL & -999  &Error in flux from g filter detection convolved to a target of 6 sky pixels \\
%& & & & (1.5 arcsec) within an aperture of radius r = 7.43 arcsec.\\
%gc6flxR7Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection convolved to a target of 6 \\
%& & & & sky pixels (1.5 arcsec) within an aperture of radius r = 7.43 arcsec.\\
%gc6flxR7Fill & - & REAL & -999  &Aperture fill factor for g filter detection convolved to a target of 6 sky pixels \\
%& & & & (1.5 arcsec) within an aperture of radius r = 7.43 arcsec.\\
%gc6flxR8 & Jy & REAL & -999  &Flux from g filter detection convolved to a target of 6 sky pixels (1.5 arcsec) \\
%& & & & within an aperture of radius r = 11.42 arcsec.\\
%gc6flxR8Err & Jy & REAL & -999  &Error in flux from g filter detection convolved to a target of 6 sky pixels \\
%& & & & (1.5 arcsec) within an aperture of radius r = 11.42 arcsec.\\
%gc6flxR8Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection convolved to a target of 6 \\
%& & & & sky pixels (1.5 arcsec) within an aperture of radius r = 11.42 arcsec.\\
%gc6flxR8Fill & - & REAL & -999  &Aperture fill factor for g filter detection convolved to a target of 6 sky pixels \\
%& & & & (1.5 arcsec) within an aperture of radius r = 11.42 arcsec.\\
%gc6flxR9 & Jy & REAL & -999  &Flux from g filter detection convolved to a target of 6 sky pixels (1.5 arcsec) \\
%& & & & within an aperture of radius r = 18.20 arcsec.\\
%gc6flxR9Err & Jy & REAL & -999  &Error in flux from g filter detection convolved to a target of 6 sky pixels \\
%& & & & (1.5 arcsec) within an aperture of radius r = 18.20 arcsec.\\
%gc6flxR9Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection convolved to a target of 6 \\
%& & & & sky pixels (1.5 arcsec) within an aperture of radius r = 18.20 arcsec.\\
%gc6flxR9Fill & - & REAL & -999  &Aperture fill factor for g filter detection convolved to a target of 6 sky pixels \\
%& & & & (1.5 arcsec) within an aperture of radius r = 18.20 arcsec.\\
%gc6flxR10 & Jy & REAL & -999  &Flux from g filter detection convolved to a target of 6 sky pixels (1.5 arcsec) \\
%& & & & within an aperture of radius r = 28.20 arcsec.\\
%gc6flxR10Err & Jy & REAL & -999  &Error in flux from g filter detection convolved to a target of 6 sky pixels \\
%& & & & (1.5 arcsec) within an aperture of radius r = 28.20 arcsec.\\
%gc6flxR10Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection convolved to a target of 6 \\
%& & & & sky pixels (1.5 arcsec) within an aperture of radius r = 28.20 arcsec.\\
%gc6flxR10Fill & - & REAL & -999  &Aperture fill factor for g filter detection convolved to a target of 6 sky pixels \\
%& & & & (1.5 arcsec) within an aperture of radius r = 28.20 arcsec.\\
... &  & & & gc6flxR3 ... gc6flxR3Fill columns repeated for R4 (r = 1.76 arcsec).\\
... &  & & & repeated for R5 (r = 3.00 arcsec).\\
... &  & & & repeated for R6 (r = 4.63 arcsec).\\
... &  & & & repeated for R7 (r = 7.43 arcsec).\\
... &  & & & repeated for R8 (r = 11.42 arcsec).\\
... &  & & & repeated for R9 (r = 18.20 arcsec).\\
... &  & & & repeated for R10 (r = 28.20 arcsec).\\
gc6flxR11 & Jy & REAL & -999  &Flux from g filter detection convolved to a target of 6 sky pixels (1.5 arcsec) \\
& & & & within an aperture of radius r = 44.21 arcsec.\\
gc6flxR11Err & Jy & REAL & -999  &Error in flux from g filter detection convolved to a target of 6 sky pixels \\
& & & & (1.5 arcsec) within an aperture of radius r = 44.21 arcsec.\\
gc6flxR11Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection convolved to a target of 6 \\
& & & & sky pixels (1.5 arcsec) within an aperture of radius r = 44.21 arcsec.\\
gc6flxR11Fill & - & REAL & -999  &Aperture fill factor for g filter detection convolved to a target of 6 sky pixels \\
& & & & (1.5 arcsec) within an aperture of radius r = 44.21 arcsec.\\
rippDetectID\\
... & & & & same entries repeated for r, i, z, and y filters \\
yc6flxR11Fill \\
\hline
\end{tabular}
\end{center}
\label{table:StackApFlxExGalCon6}
\end{table}%

\begin{table}[b]
\caption{StackApFlxExGalCon8: Contains the fluxes within the SDSS R3 (r = 1.03 arcsec), R4 (r = 1.76 arcsec), R5 (r = 3.00 arcsec), R6 (r = 4.63 arcsec), R7 (r = 7.43 arcsec), R8 (r = 11.42 arcsec), R9 (r = 18.20 arcsec), R10 (r = 28.20 arcsec), and R11 (r = 44.21 arcsec) apertures \citep{Stoughton2002} for extended sources after the images have been convolved to a target of 8 sky pixels (2.0 arcsec).  These measurements are only provided for objects in the extragalactic sky, i.e., they are not provided for objects in the Galactic plane because they are not useful in crowded areas.  See \ippdbtable{StackObjectThin} table for discussion of primary, secondary, and best detections.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsSTid & - & BIGINT & NA  &Unique internal PSPS \ippstage{stack} identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
randomStackObjID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
primaryDetection & - & TINYINT & 255  &Identifies if this row is the primary \ippstage{stack} detection.\\
bestDetection & - & TINYINT & 255  &Identifies if this row is the best detection.\\
gippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
gstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
gstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for g filter detection.\\
gc8flxR3 & Jy & REAL & -999  &Flux from g filter detection convolved to a target of 8 sky pixels (2.0 arcsec) \\
& & & & within an aperture of radius r = 1.03 arcsec.\\
gc8flxR3Err & Jy & REAL & -999  &Error in flux from g filter detection convolved to a target of 8 sky pixels \\
& & & & (2.0 arcsec) within an aperture of radius r = 1.03 arcsec.\\
gc8flxR3Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection convolved to a target of 8 \\
& & & & sky pixels (2.0 arcsec) within an aperture of radius r = 1.03 arcsec.\\
gc8flxR3Fill & - & REAL & -999  &Aperture fill factor for g filter detection convolved to a target of 8 sky pixels \\
& & & & (2.0 arcsec) within an aperture of radius r = 1.03 arcsec.\\
... &  & & & gc8flxR3 ... gc8flxR3Fill columns repeated for R4 (r = 1.76 arcsec).\\
... &  & & & repeated for R5 (r = 3.00 arcsec).\\
... &  & & & repeated for R6 (r = 4.63 arcsec).\\
... &  & & & repeated for R7 (r = 7.43 arcsec).\\
... &  & & & repeated for R8 (r = 11.42 arcsec).\\
... &  & & & repeated for R9 (r = 18.20 arcsec).\\
... &  & & & repeated for R10 (r = 28.20 arcsec).\\
gc8flxR11 & Jy & REAL & -999  &Flux from g filter detection convolved to a target of 8 sky pixels (2.0 arcsec) \\
& & & & within an aperture of radius r = 44.21 arcsec.\\
gc8flxR11Err & Jy & REAL & -999  &Error in flux from g filter detection convolved to a target of 8 sky pixels \\
& & & & (2.0 arcsec) within an aperture of radius r = 44.21 arcsec.\\
gc8flxR11Std & Jy & REAL & -999  &Standard deviation of flux from g filter detection convolved to a target of 8 \\
& & & & sky pixels (2.0 arcsec) within an aperture of radius r = 44.21 arcsec.\\
gc8flxR11Fill & - & REAL & -999  &Aperture fill factor for g filter detection convolved to a target of 8 sky pixels \\
& & & & (2.0 arcsec) within an aperture of radius r = 44.21 arcsec.\\
rippDetectID \\
... & & & & same entries repeated for r, i, z, and y filters \\
yc8flxR11Fill \\
\hline
\end{tabular}
\end{center}
\label{table:StackApFlxExGalCon8}
\end{table}%

\begin{table}[b]
\caption{StackPetrosian: Contains the \citet{Petrosian1976} magnitudes and radii for extended sources.  See \ippdbtable{StackObjectThin} table for discussion of primary, secondary, and best detections.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsSTid & - & BIGINT & NA  &Unique internal PSPS \ippstage{stack} identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
randomStackObjID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
primaryDetection & - & TINYINT & 255  &Identifies if this row is the primary \ippstage{stack} detection.\\
bestDetection & - & TINYINT & 255  &Identifies if this row is the best detection.\\
gippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
gstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
gstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for g filter detection.\\
gpetRadius & arcsec & REAL & -999  &Petrosian (1976) fit radius for g filter \ippstage{stack} detection.\\
gpetRadiusErr & arcsec & REAL & -999  &Error in Petrosian (1976) fit radius for g filter \ippstage{stack} detection.\\
gpetMag & AB & REAL & -999  &Petrosian (1976) magnitude from g filter \ippstage{stack} detection.\\
gpetMagErr & AB & REAL & -999  &Error in Petrosian (1976) magnitude from g filter \ippstage{stack} detection.\\
gpetR50 & arcsec & REAL & -999  &Petrosian (1976) fit radius for g filter \ippstage{stack} detection. at 50\% light\\
gpetR50Err & arcsec & REAL & -999  &Error in Petrosian (1976) fit radius for g filter \ippstage{stack} detection. at 50\% light\\
gpetR90 & arcsec & REAL & -999  &Petrosian (1976) fit radius for g filter \ippstage{stack} detection. at 90\% light\\
gpetR90Err & arcsec & REAL & -999  &Error in Petrosian (1976) fit radius for g filter \ippstage{stack} detection. at 90\% light\\
gpetCf & - & REAL & -999  &Petrosian (1976) fit coverage factor for g filter \ippstage{stack} detection.\\
rippDetectID \\
... & & & & same entries repeated for r, i, z, and y filters \\
%rippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%rstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
%rstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for r filter detection.\\
%rpetRadius & arcsec & REAL & -999  &Petrosian (1976) fit radius for r filter \ippstage{stack} detection.\\
%rpetRadiusErr & arcsec & REAL & -999  &Error in Petrosian (1976) fit radius for r filter \ippstage{stack} detection.\\
%rpetMag & AB & REAL & -999  &Petrosian (1976) magnitude from r filter \ippstage{stack} detection.\\
%rpetMagErr & AB & REAL & -999  &Error in Petrosian (1976) magnitude from r filter \ippstage{stack} detection.\\
%rpetR50 & arcsec & REAL & -999  &Petrosian (1976) fit radius for r filter \ippstage{stack} detection. at 50\% light\\
%rpetR50Err & arcsec & REAL & -999  &Error in Petrosian (1976) fit radius for r filter \ippstage{stack} detection. at 50\% light\\
%rpetR90 & arcsec & REAL & -999  &Petrosian (1976) fit radius for r filter \ippstage{stack} detection. at 90\% light\\
%rpetR90Err & arcsec & REAL & -999  &Error in Petrosian (1976) fit radius for r filter \ippstage{stack} detection. at 90\% light\\
%rpetCf & - & REAL & -999  &Petrosian (1976) fit coverage factor for r filter \ippstage{stack} detection.\\
%iippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%istackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
%istackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for i filter detection.\\
%ipetRadius & arcsec & REAL & -999  &Petrosian (1976) fit radius for i filter \ippstage{stack} detection.\\
%ipetRadiusErr & arcsec & REAL & -999  &Error in Petrosian (1976) fit radius for i filter \ippstage{stack} detection.\\
%ipetMag & AB & REAL & -999  &Petrosian (1976) magnitude from i filter \ippstage{stack} detection.\\
%ipetMagErr & AB & REAL & -999  &Error in Petrosian (1976) magnitude from i filter \ippstage{stack} detection.\\
%ipetR50 & arcsec & REAL & -999  &Petrosian (1976) fit radius for i filter \ippstage{stack} detection. at 50\% light\\
%ipetR50Err & arcsec & REAL & -999  &Error in Petrosian (1976) fit radius for i filter \ippstage{stack} detection. at 50\% light\\
%ipetR90 & arcsec & REAL & -999  &Petrosian (1976) fit radius for i filter \ippstage{stack} detection. at 90\% light\\
%ipetR90Err & arcsec & REAL & -999  &Error in Petrosian (1976) fit radius for i filter \ippstage{stack} detection. at 90\% light\\
%ipetCf & - & REAL & -999  &Petrosian (1976) fit coverage factor for i filter \ippstage{stack} detection.\\
%zippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%zstackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
%zstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for z filter detection.\\
%zpetRadius & arcsec & REAL & -999  &Petrosian (1976) fit radius for z filter \ippstage{stack} detection.\\
%zpetRadiusErr & arcsec & REAL & -999  &Error in Petrosian (1976) fit radius for z filter \ippstage{stack} detection.\\
%zpetMag & AB & REAL & -999  &Petrosian (1976) magnitude from z filter \ippstage{stack} detection.\\
%zpetMagErr & AB & REAL & -999  &Error in Petrosian (1976) magnitude from z filter \ippstage{stack} detection.\\
%zpetR50 & arcsec & REAL & -999  &Petrosian (1976) fit radius for z filter \ippstage{stack} detection. at 50\% light\\
%zpetR50Err & arcsec & REAL & -999  &Error in Petrosian (1976) fit radius for z filter \ippstage{stack} detection. at 50\% light\\
%zpetR90 & arcsec & REAL & -999  &Petrosian (1976) fit radius for z filter \ippstage{stack} detection. at 90\% light\\
%zpetR90Err & arcsec & REAL & -999  &Error in Petrosian (1976) fit radius for z filter \ippstage{stack} detection. at 90\% light\\
%zpetCf & - & REAL & -999  &Petrosian (1976) fit coverage factor for z filter \ippstage{stack} detection.\\
%yippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%ystackDetectID & - & BIGINT & NA  &Unique \ippstage{stack} detection identifier.\\
%ystackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for y filter detection.\\
%ypetRadius & arcsec & REAL & -999  &Petrosian (1976) fit radius for y filter \ippstage{stack} detection.\\
%ypetRadiusErr & arcsec & REAL & -999  &Error in Petrosian (1976) fit radius for y filter \ippstage{stack} detection.\\
%ypetMag & AB & REAL & -999  &Petrosian (1976) magnitude from y filter \ippstage{stack} detection.\\
%ypetMagErr & AB & REAL & -999  &Error in Petrosian (1976) magnitude from y filter \ippstage{stack} detection.\\
%ypetR50 & arcsec & REAL & -999  &Petrosian (1976) fit radius for y filter \ippstage{stack} detection. at 50\% light\\
%ypetR50Err & arcsec & REAL & -999  &Error in Petrosian (1976) fit radius for y filter \ippstage{stack} detection. at 50\% light\\
%ypetR90 & arcsec & REAL & -999  &Petrosian (1976) fit radius for y filter \ippstage{stack} detection. at 90\% light\\
%ypetR90Err & arcsec & REAL & -999  &Error in Petrosian (1976) fit radius for y filter \ippstage{stack} detection. at 90\% light\\
%ypetCf & - & REAL & -999  &Petrosian (1976) fit coverage factor for y filter \ippstage{stack} detection.\\
ypetCf \\
\hline
\end{tabular}
\end{center}
\label{table:StackPetrosian}
\end{table}%

\begin{table}[b]
\caption{StackToImage: Contains the mapping of which input images were used to construct a particular stack.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
stackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier.\\
imageID & - & BIGINT & NA  &Unique image identifier.  Constructed as (100 * frameID + ccdID).\\
\hline
\end{tabular}
\end{center}
\label{table:StackToImage}
\end{table}%

%\end{document} happy

\begin{table}[b]
\caption{StackToFrame: Contains the mapping of input frames used to construct a particular \ippstage{stack} along with processing statistics.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
stackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier.\\
frameID & - & INT & NA  &Unique frame/exposure identifier.\\
scaleFactor & - & REAL & 0  &normalization factor applied to input image before stacking.\\
zp & magnitudes & REAL & 0  &Photometric zeropoint.  Necessary for converting listed fluxes and \\ 
& & & & magnitudes back to measured ADU counts.\\
expTime & seconds & REAL & -999  &Exposure time of the frame/exposure.  Necessary for converting \\
& & & & listed fluxes and magnitudes back to measured ADU counts.\\
airMass & - & REAL & 0  &Airmass at midpoint of the exposure.  Necessary for converting \\ 
& & & & listed fluxes and magnitudes back to measured ADU counts.\\
\hline
\end{tabular}
\end{center}
\label{table:StackToFrame}
\end{table}%
%{\color{red} StackDetEffMeta won't compile, I end here. GH: now it is happy}

%\end{document}

%this table is broken FIXXXXX AFFTER LUNCH
\begin{table}[b]
\caption{StackDetEffMeta: Contains the detection efficiency information for a given stacked image.  Provides the number of recovered sources out of 500 injected sources for each magnitude bin and statistics about the magnitudes of the recovered sources for a range of magnitude offsets.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name  & units    & data type & default & description\\
\hline
stackImageID & -         & BIGINT& NA  &Unique  stack identifier.\\
magref      & magnitudes & REAL & NA  &Detection efficiency reference magnitude.\\
nInjected   & -          & INT  & NA  &Number of fake sources injected in each magnitude bin.\\
offset01    & magnitudes & REAL & NA  &Detection efficiency magnitude offset for bin 1.\\
counts01    & -          & REAL & NA  &Detection efficiency count of recovered sources in bin 1.\\
diffMean01  & magnitudes & REAL & NA  &Detection efficiency mean magnitude difference in bin 1.\\
diffStdev01 & magnitudes & REAL & NA  &Detection efficiency standard deviation of magnitude differences in bin 1.\\
errMean01   & magnitudes & REAL & NA  &Detection efficiency mean magnitude error in bin 1.\\
offset02    & magnitudes & REAL & NA  &Detection efficiency magnitude offset for bin 2.\\
counts02    & -          & REAL & NA  &Detection efficiency count of recovered sources in bin 2.\\
diffMean02  & magnitudes & REAL & NA  &Detection efficiency mean magnitude difference in bin 2.\\
diffStdev02 & magnitudes & REAL & NA  &Detection efficiency standard deviation of magnitude differences in bin 2.\\
errMean02   & magnitudes & REAL & NA  &Detection efficiency mean magnitude error in bin 2.\\
offset03    & magnitudes & REAL & NA  &Detection efficiency magnitude offset for bin 3.\\
counts03    & -          & REAL & NA  &Detection efficiency count of recovered sources in bin 3.\\
diffMean03  & magnitudes & REAL & NA  &Detection efficiency mean magnitude difference in bin 3.\\
diffStdev03 & magnitudes & REAL & NA  &Detection efficiency standard deviation of magnitude differences in bin 3.\\
errMean03   & magnitudes & REAL & NA  &Detection efficiency mean magnitude error in bin 3.\\
...\\
offset13    & magnitudes & REAL & NA  &Detection efficiency magnitude offset for bin 13.\\
counts13    & -          & REAL & NA  &Detection efficiency count of recovered sources in bin 13.\\
diffMean13  & magnitudes & REAL & NA  &Detection efficiency mean magnitude difference in bin 13.\\
diffStdev13 & magnitudes & REAL & NA  &Detection efficiency standard deviation of magnitude differences in bin 13.\\
errMean13   & magnitudes & REAL & NA  &Detection efficiency mean magnitude error in bin 13.\\
\hline
\end{tabular}
\end{center}
\label{table:StackDetEffMeta}
\end{table}%

\clearpage 
\subsection{Forced Warp Tables}

\begin{table}[b]
\caption{ForcedMeanObject: Contains the mean of single-epoch photometric information for sources detected in the stacked data, calculated as described in \citet{Magnier2013}.  The mean is calculated for detections associated into objects within a one arcsecond correlation radius.  PSF, \citet{Kron1980}, and SDSS aperture R5 (r = 3.00\arcsec), R6 (r = 4.63\arcsec), and R7 (r = 7.43\arcsec) apertures \citep{Stoughton2002} magnitudes and statistics are listed for all filters. See also \citet{Kaiser1995}.}
\begin{center}
\resizebox{\textwidth}{!}{
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsFOid & - & BIGINT & NA  &Unique internal PSPS forced object identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
randomForcedObjID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
nDetections & - & SMALLINT & -999  &Number of single epoch detections in all filters.\\
batchID & - & BIGINT & NA  &Internal database batch identifier.\\
processingVersion & - & TINYINT & NA  &Data release version.\\
gnTotal & - & SMALLINT & -999  &Number of forced single epoch detections in g filter.\\
gnIncPSFFlux & - & SMALLINT & -999  &Number of forced single epoch detections in PSF flux mean in g filter.\\
gnIncKronFlux & - & SMALLINT & -999  &Number of forced single epoch detections in Kron (1980) flux mean in g filter.\\
gnIncApFlux & - & SMALLINT & -999  &Number of forced single epoch detections in aperture flux mean in g filter.\\
gnIncR5 & - & SMALLINT & -999  &Number of forced single epoch detections in R5 (r = 3.00 arcsec) aperture flux mean in g filter.\\
gnIncR6 & - & SMALLINT & -999  &Number of forced single epoch detections in R6 (r = 4.63 arcsec) aperture flux mean in g filter.\\
gnIncR7 & - & SMALLINT & -999  &Number of forced single epoch detections in R7 (r = 7.43 arcsec) aperture flux mean in g filter.\\
gFPSFFlux & Jy & REAL & -999  &Mean PSF flux from forced single epoch g filter detections.\\
gFPSFFluxErr & Jy & REAL & -999  &Error in mean PSF flux from forced single epoch g filter detections.\\
gFPSFFluxStd & Jy & REAL & -999  &Standard deviation of PSF fluxes from forced single epoch g filter detections.\\
gFPSFMag & AB & REAL & -999  &Magnitude from mean PSF flux from forced single epoch g filter detections.\\
gFPSFMagErr & AB & REAL & -999  &Error in magnitude from mean PSF flux from forced single epoch g filter detections.\\
gFKronFlux & Jy & REAL & -999  &Mean Kron (1980) flux from forced single epoch g filter detections.\\
gFKronFluxErr & Jy & REAL & -999  &Error in mean Kron (1980) flux from forced single epoch g filter detections.\\
gFKronFluxStd & Jy & REAL & -999  &Standard deviation of Kron (198) fluxes from forced single epoch g filter detections.\\
gFKronMag & AB & REAL & -999  &Magnitude from mean Kron (1980) flux from forced single epoch g filter detections.\\
gFKronMagErr & AB & REAL & -999  &Error in magnitude from mean Kron (1980) flux from forced single epoch g filter detections.\\
gFApFlux & Jy & REAL & -999  &Mean aperture flux from forced single epoch g filter detections.\\
gFApFluxErr & Jy & REAL & -999  &Error in mean aperture flux from forced single epoch g filter detections.\\
gFApFluxStd & Jy & REAL & -999  &Standard deviation of aperture fluxes from forced single epoch g filter detections.\\
gFApMag & AB & REAL & -999  &Magnitude from mean aperture flux from forced single epoch g filter detections.\\
gFApMagErr & AB & REAL & -999  &Error in magnitude from mean aperture flux from forced single epoch g filter detections.\\
gFmeanflxR5 & Jy & REAL & -999  &Mean flux from forced single epoch g filter \\
& & & & detections within an aperture of radius r = 3.00 arcsec.\\
gFmeanflxR5Err & Jy & REAL & -999  &Error in mean flux from forced single epoch g filter \\
& & & & detections within an aperture of radius r = 3.00 arcsec.\\
gFmeanflxR5Std & Jy & REAL & -999  &Standard deviation of forced single epoch g filter \\
& & & & detection fluxes within an aperture of radius r = 3.00 arcsec.\\
gFmeanflxR5Fill & - & REAL & -999  &Aperture fill factor for forced single epoch g filter \\
& & & & detections within an aperture of radius r = 3.00 arcsec.\\
gFmeanMagR5 & AB & REAL & -999  &Magnitude from mean flux from forced single epoch g filter \\
& & & & detections within an aperture of radius r = 3.00 arcsec.\\
gFmeanMagR5Err & AB & REAL & -999  &Error in magnitude from  mean flux from forced single epoch \\
& & & & g filter detections within an aperture of radius r = 3.00 arcsec.\\
gFmeanflxR6 & Jy & REAL & -999  &Mean flux from forced single epoch g filter \\
& & & & detections within an aperture of radius r = 4.63 arcsec.\\
gFmeanflxR6Err & Jy & REAL & -999  &Error in mean flux from forced single epoch g filter \\
& & & & detections within an aperture of radius r = 4.63 arcsec.\\
gFmeanflxR6Std & Jy & REAL & -999  &Standard deviation of forced single epoch g filter \\
& & & & detection fluxes within an aperture of radius r = 4.63 arcsec.\\
gFmeanflxR6Fill & - & REAL & -999  &Aperture fill factor for forced single epoch g filter \\
& & & & detections within an aperture of radius r = 4.63 arcsec.\\
gFmeanMagR6 & AB & REAL & -999  &Magnitude from mean flux from forced single epoch g filter \\
& & & & detections within an aperture of radius r = 4.63 arcsec.\\
gFmeanMagR6Err & AB & REAL & -999  &Error in magnitude from  mean flux from forced single epoch \\
& & & & g filter detections within an aperture of radius r = 4.63 arcsec.\\
gFmeanflxR7 & Jy & REAL & -999  &Mean flux from forced single epoch g filter \\
& & & & detections within an aperture of radius r = 7.43 arcsec.\\
gFmeanflxR7Err & Jy & REAL & -999  &Error in mean flux from forced single epoch g filter\\
& & & & detections within an aperture of radius r = 7.43 arcsec.\\
gFmeanflxR7Std & Jy & REAL & -999  &Standard deviation of forced single epoch g filter \\
& & & & detection fluxes within an aperture of radius r = 7.43 arcsec.\\
gFmeanflxR7Fill & - & REAL & -999  &Aperture fill factor for forced single epoch g filter \\
& & & & detections within an aperture of radius r = 7.43 arcsec.\\
gFmeanMagR7 & AB & REAL & -999  &Magnitude from mean flux from forced single epoch g filter\\
& & & & detections within an aperture of radius r = 7.43 arcsec.\\
gFmeanMagR7Err & AB & REAL & -999  &Error in magnitude from  mean flux from forced single epoch\\
& & & & g filter detections within an aperture of radius r = 7.43 arcsec.\\
gFlags & - & INT & 0  &Information flag bitmask indicating details of the photometry from forced \\
& & & & single epoch g filter detections.  Values listed in ObjectInfoFlags.\\
gE1 & - & REAL & -999  &\citet{Kaiser1995} polarization parameter $e1 = (M_{xx} - M_{yy}) / (M_{xx} + M_{yy})$ \\
& & & & from forced single epoch g filter detections.\\
gE2 & - & REAL & -999  &\citet{Kaiser1995} polarization parameter $e2 =  (2 M_{xy}) / (M_{xx} + M_{yy}) $ \\
& & & & from forced single epoch g filter detections.\\
rnTotal\\
... & & & & same entries repeated for r, i, z, and y filters \\
%rnTotal & - & SMALLINT & -999  &Number of forced single epoch detections in r filter.\\
%rnIncPSFFlux & - & SMALLINT & -999  &Number of forced single epoch detections in PSF flux mean in r filter.\\
%rnIncKronFlux & - & SMALLINT & -999  &Number of forced single epoch detections in Kron (1980) flux mean in r filter.\\
%rnIncApFlux & - & SMALLINT & -999  &Number of forced single epoch detections in aperture flux mean in r filter.\\
%rnIncR5 & - & SMALLINT & -999  &Number of forced single epoch detections in R5 (r = 3.00 arcsec) aperture flux mean in r filter.\\
%rnIncR6 & - & SMALLINT & -999  &Number of forced single epoch detections in R6 (r = 4.63 arcsec) aperture flux mean in r filter.\\
%rnIncR7 & - & SMALLINT & -999  &Number of forced single epoch detections in R7 (r = 7.43 arcsec) aperture flux mean in r filter.\\
%rFPSFFlux & Jy & REAL & -999  &Mean PSF flux from forced single epoch r filter detections.\\
%rFPSFFluxErr & Jy & REAL & -999  &Error in mean PSF flux from forced single epoch r filter detections.\\
%rFPSFFluxStd & Jy & REAL & -999  &Standard deviation of PSF fluxes from forced single epoch r filter detections.\\
%rFPSFMag & AB & REAL & -999  &Magnitude from mean PSF flux from forced single epoch r filter detections.\\
%rFPSFMagErr & AB & REAL & -999  &Error in magnitude from mean PSF flux from forced single epoch r filter detections.\\
%rFKronFlux & Jy & REAL & -999  &Mean Kron (1980) flux from forced single epoch r filter detections.\\
%rFKronFluxErr & Jy & REAL & -999  &Error in mean Kron (1980) flux from forced single epoch r filter detections.\\
%rFKronFluxStd & Jy & REAL & -999  &Standard deviation of Kron (198) fluxes from forced single epoch r filter detections.\\
%rFKronMag & AB & REAL & -999  &Magnitude from mean Kron (1980) flux from forced single epoch r filter detections.\\
%rFKronMagErr & AB & REAL & -999  &Error in magnitude from mean Kron (1980) flux from forced single epoch r filter detections.\\
%rFApFlux & Jy & REAL & -999  &Mean aperture flux from forced single epoch r filter detections.\\
%rFApFluxErr & Jy & REAL & -999  &Error in mean aperture flux from forced single epoch r filter detections.\\
%rFApFluxStd & Jy & REAL & -999  &Standard deviation of aperture fluxes from forced single epoch g filter detections.\\
%rFApMag & AB & REAL & -999  &Magnitude from mean aperture flux from forced single epoch r filter detections.\\
%rFApMagErr & AB & REAL & -999  &Error in magnitude from mean aperture flux from forced single epoch r filter detections.\\
%rFmeanflxR5 & Jy & REAL & -999  &Mean flux from forced single epoch r filter detections within an aperture of radius r = 3.00 arcsec.\\
%rFmeanflxR5Err & Jy & REAL & -999  &Error in mean flux from forced single epoch r filter detections within an aperture of radius r = 3.00 arcsec.\\
%rFmeanflxR5Std & Jy & REAL & -999  &Standard deviation of forced single epoch r filter detection fluxes within an aperture of radius r = 3.00 arcsec.\\
%rFmeanflxR5Fill & - & REAL & -999  &Aperture fill factor for forced single epoch r filter detections within an aperture of radius r = 3.00 arcsec.\\
%rFmeanMagR5 & AB & REAL & -999  &Magnitude from mean flux from forced single epoch r filter detections within an aperture of radius r = 3.00 arcsec.\\
%rFmeanMagR5Err & AB & REAL & -999  &Error in magnitude from  mean flux from forced single epoch r filter detections within an aperture of radius r = 3.00 arcsec.\\
%rFmeanflxR6 & Jy & REAL & -999  &Mean flux from forced single epoch r filter detections within an aperture of radius r = 4.63 arcsec.\\
%rFmeanflxR6Err & Jy & REAL & -999  &Error in mean flux from forced single epoch r filter detections within an aperture of radius r = 4.63 arcsec.\\
%rFmeanflxR6Std & Jy & REAL & -999  &Standard deviation of forced single epoch r filter detection fluxes within an aperture of radius r = 4.63 arcsec.\\
%rFmeanflxR6Fill & - & REAL & -999  &Aperture fill factor for forced single epoch r filter detections within an aperture of radius r = 4.63 arcsec.\\
%rFmeanMagR6 & AB & REAL & -999  &Magnitude from mean flux from forced single epoch r filter detections within an aperture of radius r = 4.63 arcsec.\\
%rFmeanMagR6Err & AB & REAL & -999  &Error in magnitude from  mean flux from forced single epoch r filter detections within an aperture of radius r = 4.63 arcsec.\\
%rFmeanflxR7 & Jy & REAL & -999  &Mean flux from forced single epoch r filter detections within an aperture of radius r = 7.43 arcsec.\\
%rFmeanflxR7Err & Jy & REAL & -999  &Error in mean flux from forced single epoch r filter detections within an aperture of radius r = 7.43 arcsec.\\
%rFmeanflxR7Std & Jy & REAL & -999  &Standard deviation of forced single epoch r filter detection fluxes within an aperture of radius r = 7.43 arcsec.\\
%rFmeanflxR7Fill & - & REAL & -999  &Aperture fill factor for forced single epoch r filter detections within an aperture of radius r = 7.43 arcsec.\\
%rFmeanMagR7 & AB & REAL & -999  &Magnitude from mean flux from forced single epoch r filter detections within an aperture of radius r = 7.43 arcsec.\\
%rFmeanMagR7Err & AB & REAL & -999  &Error in magnitude from  mean flux from forced single epoch r filter detections within an aperture of radius r = 7.43 arcsec.\\
%rFlags & - & INT & 0  &Information flag bitmask indicating details of the photometry from forced single epoch r filter detections.  Values listed in ObjectInfoFlags.\\
%rE1 & - & REAL & -999  &\citet{Kaiser1995} polarization parameter e1 = (Mxx - Myy) / (Mxx + Myy) from forced single epoch r filter detections.\\
%rE2 & - & REAL & -999  &\citet{Kaiser1995} polarization parameter e2 =  (2 Mxy) / (Mxx + Myy) from forced single epoch r filter detections.\\
%inTotal & - & SMALLINT & -999  &Number of forced single epoch detections in i filter.\\
%inIncPSFFlux & - & SMALLINT & -999  &Number of forced single epoch detections in PSF flux mean in i filter.\\
%inIncKronFlux & - & SMALLINT & -999  &Number of forced single epoch detections in Kron (1980) flux mean in i filter.\\
%inIncApFlux & - & SMALLINT & -999  &Number of forced single epoch detections in aperture flux mean in i filter.\\
%inIncR5 & - & SMALLINT & -999  &Number of forced single epoch detections in R5 (r = 3.00 arcsec) aperture flux mean in i filter.\\
%inIncR6 & - & SMALLINT & -999  &Number of forced single epoch detections in R6 (r = 4.63 arcsec) aperture flux mean in i filter.\\
%inIncR7 & - & SMALLINT & -999  &Number of forced single epoch detections in R7 (r = 7.43 arcsec) aperture flux mean in i filter.\\
%iFPSFFlux & Jy & REAL & -999  &Mean PSF flux from forced single epoch i filter detections.\\
%iFPSFFluxErr & Jy & REAL & -999  &Error in mean PSF flux from forced single epoch i filter detections.\\
%iFPSFFluxStd & Jy & REAL & -999  &Standard deviation of PSF fluxes from forced single epoch i filter detections.\\
%iFPSFMag & AB & REAL & -999  &Magnitude from mean PSF flux from forced single epoch i filter detections.\\
%iFPSFMagErr & AB & REAL & -999  &Error in magnitude from mean PSF flux from forced single epoch i filter detections.\\
%iFKronFlux & Jy & REAL & -999  &Mean Kron (1980) flux from forced single epoch i filter detections.\\
%iFKronFluxErr & Jy & REAL & -999  &Error in mean Kron (1980) flux from forced single epoch i filter detections.\\
%iFKronFluxStd & Jy & REAL & -999  &Standard deviation of Kron (198) fluxes from forced single epoch i filter detections.\\
%iFKronMag & AB & REAL & -999  &Magnitude from mean Kron (1980) flux from forced single epoch i filter detections.\\
%iFKronMagErr & AB & REAL & -999  &Error in magnitude from mean Kron (1980) flux from forced single epoch i filter detections.\\
%iFApFlux & Jy & REAL & -999  &Mean aperture flux from forced single epoch i filter detections.\\
%iFApFluxErr & Jy & REAL & -999  &Error in mean aperture flux from forced single epoch i filter detections.\\
%iFApFluxStd & Jy & REAL & -999  &Standard deviation of aperture fluxes from forced single epoch i filter detections.\\
%iFApMag & AB & REAL & -999  &Magnitude from mean aperture flux from forced single epoch i filter detections.\\
%iFApMagErr & AB & REAL & -999  &Error in magnitude from mean aperture flux from forced single epoch i filter detections.\\
%iFmeanflxR5 & Jy & REAL & -999  &Mean flux from forced single epoch i filter detections within an aperture of radius r = 3.00 arcsec.\\
%iFmeanflxR5Err & Jy & REAL & -999  &Error in mean flux from forced single epoch i filter detections within an aperture of radius r = 3.00 arcsec.\\
%iFmeanflxR5Std & Jy & REAL & -999  &Standard deviation of forced single epoch i filter detection fluxes within an aperture of radius r = 3.00 arcsec.\\
%iFmeanflxR5Fill & - & REAL & -999  &Aperture fill factor for forced single epoch i filter detections within an aperture of radius r = 3.00 arcsec.\\
%iFmeanMagR5 & AB & REAL & -999  &Magnitude from mean flux from forced single epoch i filter detections within an aperture of radius r = 3.00 arcsec.\\
%iFmeanMagR5Err & AB & REAL & -999  &Error in magnitude from  mean flux from forced single epoch i filter detections within an aperture of radius r = 3.00 arcsec.\\
%iFmeanflxR6 & Jy & REAL & -999  &Mean flux from forced single epoch i filter detections within an aperture of radius r = 4.63 arcsec.\\
%iFmeanflxR6Err & Jy & REAL & -999  &Error in mean flux from forced single epoch i filter detections within an aperture of radius r = 4.63 arcsec.\\
%iFmeanflxR6Std & Jy & REAL & -999  &Standard deviation of forced single epoch i filter detection fluxes within an aperture of radius r = 4.63 arcsec.\\
%iFmeanflxR6Fill & - & REAL & -999  &Aperture fill factor for forced single epoch i filter detections within an aperture of radius r = 4.63 arcsec.\\
%iFmeanMagR6 & AB & REAL & -999  &Magnitude from mean flux from forced single epoch i filter detections within an aperture of radius r = 4.63 arcsec.\\
%iFmeanMagR6Err & AB & REAL & -999  &Error in magnitude from  mean flux from forced single epoch i filter detections within an aperture of radius r = 4.63 arcsec.\\
%iFmeanflxR7 & Jy & REAL & -999  &Mean flux from forced single epoch i filter detections within an aperture of radius r = 7.43 arcsec.\\
%iFmeanflxR7Err & Jy & REAL & -999  &Error in mean flux from forced single epoch i filter detections within an aperture of radius r = 7.43 arcsec.\\
%iFmeanflxR7Std & Jy & REAL & -999  &Standard deviation of forced single epoch i filter detection fluxes within an aperture of radius r = 7.43 arcsec.\\
%iFmeanflxR7Fill & - & REAL & -999  &Aperture fill factor for forced single epoch i filter detections within an aperture of radius r = 7.43 arcsec.\\
%iFmeanMagR7 & AB & REAL & -999  &Magnitude from mean flux from forced single epoch i filter detections within an aperture of radius r = 7.43 arcsec.\\
%iFmeanMagR7Err & AB & REAL & -999  &Error in magnitude from  mean flux from forced single epoch i filter detections within an aperture of radius r = 7.43 arcsec.\\
%iFlags & - & INT & 0  &Information flag bitmask indicating details of the photometry from forced single epoch i filter detections.  Values listed in ObjectInfoFlags.\\
%iE1 & - & REAL & -999  &\citet{Kaiser1995} polarization parameter e1 = (Mxx - Myy) / (Mxx + Myy) from forced single epoch i filter detections.\\
%iE2 & - & REAL & -999  &\citet{Kaiser1995} polarization parameter e2 =  (2 Mxy) / (Mxx + Myy) from forced single epoch i filter detections.\\
%znTotal & - & SMALLINT & -999  &Number of forced single epoch detections in z filter.\\
%znIncPSFFlux & - & SMALLINT & -999  &Number of forced single epoch detections in PSF flux mean in z filter.\\
%znIncKronFlux & - & SMALLINT & -999  &Number of forced single epoch detections in Kron (1980) flux mean in z filter.\\
%znIncApFlux & - & SMALLINT & -999  &Number of forced single epoch detections in aperture flux mean in z filter.\\
%znIncR5 & - & SMALLINT & -999  &Number of forced single epoch detections in R5 (r = 3.00 arcsec) aperture flux mean in z filter.\\
%znIncR6 & - & SMALLINT & -999  &Number of forced single epoch detections in R6 (r = 4.63 arcsec) aperture flux mean in z filter.\\
%znIncR7 & - & SMALLINT & -999  &Number of forced single epoch detections in R7 (r = 7.43 arcsec) aperture flux mean in z filter.\\
%zFPSFFlux & Jy & REAL & -999  &Mean PSF flux from forced single epoch z filter detections.\\
%zFPSFFluxErr & Jy & REAL & -999  &Error in mean PSF flux from forced single epoch z filter detections.\\
%zFPSFFluxStd & Jy & REAL & -999  &Standard deviation of PSF fluxes from forced single epoch z filter detections.\\
%zFPSFMag & AB & REAL & -999  &Magnitude from mean PSF flux from forced single epoch z filter detections.\\
%zFPSFMagErr & AB & REAL & -999  &Error in magnitude from mean PSF flux from forced single epoch z filter detections.\\
%zFKronFlux & Jy & REAL & -999  &Mean Kron (1980) flux from forced single epoch z filter detections.\\
%zFKronFluxErr & Jy & REAL & -999  &Error in mean Kron (1980) flux from forced single epoch z filter detections.\\
%zFKronFluxStd & Jy & REAL & -999  &Standard deviation of Kron (198) fluxes from forced single epoch z filter detections.\\
%zFKronMag & AB & REAL & -999  &Magnitude from mean Kron (1980) flux from forced single epoch z filter detections.\\
%zFKronMagErr & AB & REAL & -999  &Error in magnitude from mean Kron (1980) flux from forced single epoch z filter detections.\\
%zFApFlux & Jy & REAL & -999  &Mean aperture flux from forced single epoch z filter detections.\\
%zFApFluxErr & Jy & REAL & -999  &Error in mean aperture flux from forced single epoch z filter detections.\\
%zFApFluxStd & Jy & REAL & -999  &Standard deviation of aperture fluxes from forced single epoch z filter detections.\\
%zFApMag & AB & REAL & -999  &Magnitude from mean aperture flux from forced single epoch z filter detections.\\
%zFApMagErr & AB & REAL & -999  &Error in magnitude from mean aperture flux from forced single epoch z filter detections.\\
%zFmeanflxR5 & Jy & REAL & -999  &Mean flux from forced single epoch z filter detections within an aperture of radius r = 3.00 arcsec.\\
%zFmeanflxR5Err & Jy & REAL & -999  &Error in mean flux from forced single epoch z filter detections within an aperture of radius r = 3.00 arcsec.\\
%zFmeanflxR5Std & Jy & REAL & -999  &Standard deviation of forced single epoch z filter detection fluxes within an aperture of radius r = 3.00 arcsec.\\
%zFmeanflxR5Fill & - & REAL & -999  &Aperture fill factor for forced single epoch z filter detections within an aperture of radius r = 3.00 arcsec.\\
%zFmeanMagR5 & AB & REAL & -999  &Magnitude from mean flux from forced single epoch z filter detections within an aperture of radius r = 3.00 arcsec.\\
%zFmeanMagR5Err & AB & REAL & -999  &Error in magnitude from  mean flux from forced single epoch z filter detections within an aperture of radius r = 3.00 arcsec.\\
%zFmeanflxR6 & Jy & REAL & -999  &Mean flux from forced single epoch z filter detections within an aperture of radius r = 4.63 arcsec.\\
%zFmeanflxR6Err & Jy & REAL & -999  &Error in mean flux from forced single epoch z filter detections within an aperture of radius r = 4.63 arcsec.\\
%zFmeanflxR6Std & Jy & REAL & -999  &Standard deviation of forced single epoch z filter detection fluxes within an aperture of radius r = 4.63 arcsec.\\
%zFmeanflxR6Fill & - & REAL & -999  &Aperture fill factor for forced single epoch z filter detections within an aperture of radius r = 4.63 arcsec.\\
%zFmeanMagR6 & AB & REAL & -999  &Magnitude from mean flux from forced single epoch z filter detections within an aperture of radius r = 4.63 arcsec.\\
%zFmeanMagR6Err & AB & REAL & -999  &Error in magnitude from  mean flux from forced single epoch z filter detections within an aperture of radius r = 4.63 arcsec.\\
%zFmeanflxR7 & Jy & REAL & -999  &Mean flux from forced single epoch z filter detections within an aperture of radius r = 7.43 arcsec.\\
%zFmeanflxR7Err & Jy & REAL & -999  &Error in mean flux from forced single epoch z filter detections within an aperture of radius r = 7.43 arcsec.\\
%zFmeanflxR7Std & Jy & REAL & -999  &Standard deviation of forced single epoch z filter detection fluxes within an aperture of radius r = 7.43 arcsec.\\
%zFmeanflxR7Fill & - & REAL & -999  &Aperture fill factor for forced single epoch z filter detections within an aperture of radius r = 7.43 arcsec.\\
%zFmeanMagR7 & AB & REAL & -999  &Magnitude from mean flux from forced single epoch z filter detections within an aperture of radius r = 7.43 arcsec.\\
%zFmeanMagR7Err & AB & REAL & -999  &Error in magnitude from  mean flux from forced single epoch z filter detections within an aperture of radius r = 7.43 arcsec.\\
%zFlags & - & INT & 0  &Information flag bitmask indicating details of the photometry from forced single epoch z filter detections.  Values listed in ObjectInfoFlags.\\
%zE1 & - & REAL & -999  &\citet{Kaiser1995} polarization parameter e1 = (Mxx - Myy) / (Mxx + Myy) from forced single epoch z filter detections.\\
%zE2 & - & REAL & -999  &\citet{Kaiser1995} polarization parameter e2 =  (2 Mxy) / (Mxx + Myy) from forced single epoch z filter detections.\\
%ynTotal & - & SMALLINT & -999  &Number of forced single epoch detections in y filter.\\
%ynIncPSFFlux & - & SMALLINT & -999  &Number of forced single epoch detections in PSF flux mean in y filter.\\
%ynIncKronFlux & - & SMALLINT & -999  &Number of forced single epoch detections in Kron (1980) flux mean in y filter.\\
%ynIncApFlux & - & SMALLINT & -999  &Number of forced single epoch detections in aperture flux mean in y filter.\\
%ynIncR5 & - & SMALLINT & -999  &Number of forced single epoch detections in R5 (r = 3.00 arcsec) aperture flux mean in y filter.\\
%ynIncR6 & - & SMALLINT & -999  &Number of forced single epoch detections in R6 (r = 4.63 arcsec) aperture flux mean in y filter.\\
%ynIncR7 & - & SMALLINT & -999  &Number of forced single epoch detections in R7 (r = 7.43 arcsec) aperture flux mean in y filter.\\
%yFPSFFlux & Jy & REAL & -999  &Mean PSF flux from forced single epoch y filter detections.\\
%yFPSFFluxErr & Jy & REAL & -999  &Error in mean PSF flux from forced single epoch y filter detections.\\
%yFPSFFluxStd & Jy & REAL & -999  &Standard deviation of PSF fluxes from forced single epoch y filter detections.\\
%yFPSFMag & AB & REAL & -999  &Magnitude from mean PSF flux from forced single epoch y filter detections.\\
%yFPSFMagErr & AB & REAL & -999  &Error in magnitude from mean PSF flux from forced single epoch y filter detections.\\
%yFKronFlux & Jy & REAL & -999  &Mean Kron (1980) flux from forced single epoch y filter detections.\\
%yFKronFluxErr & Jy & REAL & -999  &Error in mean Kron (1980) flux from forced single epoch y filter detections.\\
%yFKronFluxStd & Jy & REAL & -999  &Standard deviation of Kron (198) fluxes from forced single epoch y filter detections.\\
%yFKronMag & AB & REAL & -999  &Magnitude from mean Kron (1980) flux from forced single epoch y filter detections.\\
%yFKronMagErr & AB & REAL & -999  &Error in magnitude from mean Kron (1980) flux from forced single epoch y filter detections.\\
%yFApFlux & Jy & REAL & -999  &Mean aperture flux from forced single epoch y filter detections.\\
%yFApFluxErr & Jy & REAL & -999  &Error in mean aperture flux from forced single epoch y filter detections.\\
%yFApFluxStd & Jy & REAL & -999  &Standard deviation of aperture fluxes from forced single epoch y filter detections.\\
%yFApMag & AB & REAL & -999  &Magnitude from mean aperture flux from forced single epoch y filter detections.\\
%yFApMagErr & AB & REAL & -999  &Error in magnitude from mean aperture flux from forced single epoch y filter detections.\\
%yFmeanflxR5 & Jy & REAL & -999  &Mean flux from forced single epoch y filter detections within an aperture of radius r = 3.00 arcsec.\\
%yFmeanflxR5Err & Jy & REAL & -999  &Error in mean flux from forced single epoch y filter detections within an aperture of radius r = 3.00 arcsec.\\
%yFmeanflxR5Std & Jy & REAL & -999  &Standard deviation of forced single epoch y filter detection fluxes within an aperture of radius r = 3.00 arcsec.\\
%yFmeanflxR5Fill & - & REAL & -999  &Aperture fill factor for forced single epoch y filter detections within an aperture of radius r = 3.00 arcsec.\\
%yFmeanMagR5 & AB & REAL & -999  &Magnitude from mean flux from forced single epoch y filter detections within an aperture of radius r = 3.00 arcsec.\\
%yFmeanMagR5Err & AB & REAL & -999  &Error in magnitude from  mean flux from forced single epoch y filter detections within an aperture of radius r = 3.00 arcsec.\\
%yFmeanflxR6 & Jy & REAL & -999  &Mean flux from forced single epoch y filter detections within an aperture of radius r = 4.63 arcsec.\\
%yFmeanflxR6Err & Jy & REAL & -999  &Error in mean flux from forced single epoch y filter detections within an aperture of radius r = 4.63 arcsec.\\
%yFmeanflxR6Std & Jy & REAL & -999  &Standard deviation of forced single epoch y filter detection fluxes within an aperture of radius r = 4.63 arcsec.\\
%yFmeanflxR6Fill & - & REAL & -999  &Aperture fill factor for forced single epoch y filter detections within an aperture of radius r = 4.63 arcsec.\\
%yFmeanMagR6 & AB & REAL & -999  &Magnitude from mean flux from forced single epoch y filter detections within an aperture of radius r = 4.63 arcsec.\\
%yFmeanMagR6Err & AB & REAL & -999  &Error in magnitude from  mean flux from forced single epoch y filter detections within an aperture of radius r = 4.63 arcsec.\\
%yFmeanflxR7 & Jy & REAL & -999  &Mean flux from forced single epoch y filter detections within an aperture of radius r = 7.43 arcsec.\\
%yFmeanflxR7Err & Jy & REAL & -999  &Error in mean flux from forced single epoch y filter detections within an aperture of radius r = 7.43 arcsec.\\
%yFmeanflxR7Std & Jy & REAL & -999  &Standard deviation of forced single epoch y filter detection fluxes within an aperture of radius r = 7.43 arcsec.\\
%yFmeanflxR7Fill & - & REAL & -999  &Aperture fill factor for forced single epoch y filter detections within an aperture of radius r = 7.43 arcsec.\\
%yFmeanMagR7 & AB & REAL & -999  &Magnitude from mean flux from forced single epoch y filter detections within an aperture of radius r = 7.43 arcsec.\\
%yFmeanMagR7Err & AB & REAL & -999  &Error in magnitude from  mean flux from forced single epoch y filter detections within an aperture of radius r = 7.43 arcsec.\\
%yFlags & - & INT & 0  &Information flag bitmask indicating details of the photometry from forced single epoch y filter detections.  Values listed in ObjectInfoFlags.\\
%yE1 & - & REAL & -999  &\citet{Kaiser1995} polarization parameter e1 = (Mxx - Myy) / (Mxx + Myy) from forced single epoch y filter detections.\\
%yE2 & - & REAL & -999  &\citet{Kaiser1995} polarization parameter e2 =  (2 Mxy) / (Mxx + Myy) from forced single epoch y filter detections.\\
yE2 \\
\hline
\end{tabular}}
\end{center}
\label{table:ForcedMeanObject}
\end{table}%



\begin{table}[b]
\caption{ForcedMeanLensing: Contains the mean \citet[K95]{Kaiser1995} lensing parameters measured from the forced photometry of objects detected in stacked images on the individual single epoch data.}
\begin{center}
\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsFOid & - & BIGINT & NA  &Unique internal PSPS forced object identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
randomForcedObjID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
nDetections & - & SMALLINT & -999  &Number of single epoch detections in all filters.\\
batchID & - & BIGINT & NA  &Internal database batch identifier.\\
processingVersion & - & TINYINT & NA  &Data release version.\\
gLensObjSmearX11 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X11 term from forced g filter detections.\\
gLensObjSmearX12 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X12 term from forced g filter detections.\\
gLensObjSmearX22 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X22 term from forced g filter detections.\\
gLensObjSmearE1 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e1 term from forced g filter detections.\\
gLensObjSmearE2 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e2 term from forced g filter detections.\\
gLensObjShearX11 & - & REAL & -999  &K95 eq. (B11) shear polarizability X11 term from forced g filter detections.\\
gLensObjShearX12 & - & REAL & -999  &K95 eq. (B11) shear polarizability X12 term from forced g filter detections.\\
gLensObjShearX22 & - & REAL & -999  &K95 eq. (B11) shear polarizability X22 term from forced g filter detections.\\
gLensObjShearE1 & - & REAL & -999  &K95 eq. (B12) shear polarizability e1 term from forced g filter detections.\\
gLensObjShearE2 & - & REAL & -999  &K95 eq. (B12) shear polarizability e2 term from forced g filter detections.\\
gLensPSFSmearX11 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X11 term from PSF model for forced g filter detections.\\
gLensPSFSmearX12 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X12 term from PSF model for forced g filter detections.\\
gLensPSFSmearX22 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X22 term from PSF model for forced g filter detections.\\
gLensPSFSmearE1 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e1 term from PSF model for forced g filter detections.\\
gLensPSFSmearE2 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e2 term from PSF model for forced g filter detections.\\
gLensPSFShearX11 & - & REAL & -999  &K95 eq. (B11) shear polarizability X11 term from PSF model for forced g filter detections.\\
gLensPSFShearX12 & - & REAL & -999  &K95 eq. (B11) shear polarizability X12 term from PSF model for forced g filter detections.\\
gLensPSFShearX22 & - & REAL & -999  &K95 eq. (B11) shear polarizability X22 term from PSF model for forced g filter detections.\\
gLensPSFShearE1 & - & REAL & -999  &K95 eq. (B12) shear polarizability e1 term from PSF model for forced g filter detections.\\
gLensPSFShearE2 & - & REAL & -999  &K95 eq. (B12) shear polarizability e2 term from PSF model forced g filter detections.\\
rlensObjSmearX11 \\
... & & & & same entries repeated for r, i, z, and y filters \\
%rlensObjSmearX11 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X11 term from forced r filter detections.\\
%rlensObjSmearX12 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X12 term from forced r filter detections.\\
%rlensObjSmearX22 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X22 term from forced r filter detections.\\
%rlensObjSmearE1 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e1 term from forced r filter detections.\\
%rlensObjSmearE2 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e2 term from forced r filter detections.\\
%rlensObjShearX11 & - & REAL & -999  &K95 eq. (B11) shear polarizability X11 term from forced r filter detections.\\
%rlensObjShearX12 & - & REAL & -999  &K95 eq. (B11) shear polarizability X12 term from forced r filter detections.\\
%rlensObjShearX22 & - & REAL & -999  &K95 eq. (B11) shear polarizability X22 term from forced r filter detections.\\
%rlensObjShearE1 & - & REAL & -999  &K95 eq. (B12) shear polarizability e1 term from forced r filter detections.\\
%rlensObjShearE2 & - & REAL & -999  &K95 eq. (B12) shear polarizability e2 term from forced r filter detections.\\
%rlensPSFSmearX11 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X11 term from PSF model for forced r filter detections.\\
%rlensPSFSmearX12 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X12 term from PSF model for forced r filter detections.\\
%rlensPSFSmearX22 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X22 term from PSF model for forced r filter detections.\\
%rlensPSFSmearE1 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e1 term from PSF model for forced r filter detections.\\
%rlensPSFSmearE2 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e2 term from PSF model for forced r filter detections.\\
%rlensPSFShearX11 & - & REAL & -999  &K95 eq. (B11) shear polarizability X11 term from PSF model for forced r filter detections.\\
%rlensPSFShearX12 & - & REAL & -999  &K95 eq. (B11) shear polarizability X12 term from PSF model for forced r filter detections.\\
%rlensPSFShearX22 & - & REAL & -999  &K95 eq. (B11) shear polarizability X22 term from PSF model for forced r filter detections.\\
%rlensPSFShearE1 & - & REAL & -999  &K95 eq. (B12) shear polarizability e1 term from PSF model for forced r filter detections.\\
%rlensPSFShearE2 & - & REAL & -999  &K95 eq. (B12) shear polarizability e2 term from PSF model forced r filter detections.\\
%ilensObjSmearX11 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X11 term from forced i filter detections.\\
%ilensObjSmearX12 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X12 term from forced i filter detections.\\
%ilensObjSmearX22 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X22 term from forced i filter detections.\\
%ilensObjSmearE1 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e1 term from forced i filter detections.\\
%ilensObjSmearE2 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e2 term from forced i filter detections.\\
%ilensObjShearX11 & - & REAL & -999  &K95 eq. (B11) shear polarizability X11 term from forced i filter detections.\\
%ilensObjShearX12 & - & REAL & -999  &K95 eq. (B11) shear polarizability X12 term from forced i filter detections.\\
%ilensObjShearX22 & - & REAL & -999  &K95 eq. (B11) shear polarizability X22 term from forced i filter detections.\\
%ilensObjShearE1 & - & REAL & -999  &K95 eq. (B12) shear polarizability e1 term from forced i filter detections.\\
%ilensObjShearE2 & - & REAL & -999  &K95 eq. (B12) shear polarizability e2 term from forced i filter detections.\\
%ilensPSFSmearX11 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X11 term from PSF model for forced i filter detections.\\
%ilensPSFSmearX12 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X12 term from PSF model for forced i filter detections.\\
%ilensPSFSmearX22 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X22 term from PSF model for forced i filter detections.\\
%ilensPSFSmearE1 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e1 term from PSF model for forced i filter detections.\\
%ilensPSFSmearE2 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e2 term from PSF model for forced i filter detections.\\
%ilensPSFShearX11 & - & REAL & -999  &K95 eq. (B11) shear polarizability X11 term from PSF model for forced i filter detections.\\
%ilensPSFShearX12 & - & REAL & -999  &K95 eq. (B11) shear polarizability X12 term from PSF model for forced i filter detections.\\
%ilensPSFShearX22 & - & REAL & -999  &K95 eq. (B11) shear polarizability X22 term from PSF model for forced i filter detections.\\
%ilensPSFShearE1 & - & REAL & -999  &K95 eq. (B12) shear polarizability e1 term from PSF model for forced i filter detections.\\
%ilensPSFShearE2 & - & REAL & -999  &K95 eq. (B12) shear polarizability e2 term from PSF model forced i filter detections.\\
%zlensObjSmearX11 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X11 term from forced z filter detections.\\
%zlensObjSmearX12 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X12 term from forced z filter detections.\\
%zlensObjSmearX22 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X22 term from forced z filter detections.\\
%zlensObjSmearE1 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e1 term from forced z filter detections.\\
%zlensObjSmearE2 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e2 term from forced z filter detections.\\
%zlensObjShearX11 & - & REAL & -999  &K95 eq. (B11) shear polarizability X11 term from forced z filter detections.\\
%zlensObjShearX12 & - & REAL & -999  &K95 eq. (B11) shear polarizability X12 term from forced z filter detections.\\
%zlensObjShearX22 & - & REAL & -999  &K95 eq. (B11) shear polarizability X22 term from forced z filter detections.\\
%zlensObjShearE1 & - & REAL & -999  &K95 eq. (B12) shear polarizability e1 term from forced z filter detections.\\
%zlensObjShearE2 & - & REAL & -999  &K95 eq. (B12) shear polarizability e2 term from forced z filter detections.\\
%zlensPSFSmearX11 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X11 term from PSF model for forced z filter detections.\\
%zlensPSFSmearX12 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X12 term from PSF model for forced z filter detections.\\
%zlensPSFSmearX22 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X22 term from PSF model for forced z filter detections.\\
%zlensPSFSmearE1 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e1 term from PSF model for forced z filter detections.\\
%zlensPSFSmearE2 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e2 term from PSF model for forced z filter detections.\\
%zlensPSFShearX11 & - & REAL & -999  &K95 eq. (B11) shear polarizability X11 term from PSF model for forced z filter detections.\\
%zlensPSFShearX12 & - & REAL & -999  &K95 eq. (B11) shear polarizability X12 term from PSF model for forced z filter detections.\\
%zlensPSFShearX22 & - & REAL & -999  &K95 eq. (B11) shear polarizability X22 term from PSF model for forced z filter detections.\\
%zlensPSFShearE1 & - & REAL & -999  &K95 eq. (B12) shear polarizability e1 term from PSF model for forced z filter detections.\\
%zlensPSFShearE2 & - & REAL & -999  &K95 eq. (B12) shear polarizability e2 term from PSF model forced z filter detections.\\
%ylensObjSmearX11 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X11 term from forced y filter detections.\\
%ylensObjSmearX12 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X12 term from forced y filter detections.\\
%ylensObjSmearX22 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X22 term from forced y filter detections.\\
%ylensObjSmearE1 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e1 term from forced y filter detections.\\
%ylensObjSmearE2 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e2 term from forced y filter detections.\\
%ylensObjShearX11 & - & REAL & -999  &K95 eq. (B11) shear polarizability X11 term from forced y filter detections.\\
%ylensObjShearX12 & - & REAL & -999  &K95 eq. (B11) shear polarizability X12 term from forced y filter detections.\\
%ylensObjShearX22 & - & REAL & -999  &K95 eq. (B11) shear polarizability X22 term from forced y filter detections.\\
%ylensObjShearE1 & - & REAL & -999  &K95 eq. (B12) shear polarizability e1 term from forced y filter detections.\\
%ylensObjShearE2 & - & REAL & -999  &K95 eq. (B12) shear polarizability e2 term from forced y filter detections.\\
%ylensPSFSmearX11 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X11 term from PSF model for forced y filter detections.\\
%ylensPSFSmearX12 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X12 term from PSF model for forced y filter detections.\\
%ylensPSFSmearX22 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X22 term from PSF model for forced y filter detections.\\
%ylensPSFSmearE1 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e1 term from PSF model for forced y filter detections.\\
%ylensPSFSmearE2 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e2 term from PSF model for forced y filter detections.\\
%ylensPSFShearX11 & - & REAL & -999  &K95 eq. (B11) shear polarizability X11 term from PSF model for forced y filter detections.\\
%ylensPSFShearX12 & - & REAL & -999  &K95 eq. (B11) shear polarizability X12 term from PSF model for forced y filter detections.\\
%ylensPSFShearX22 & - & REAL & -999  &K95 eq. (B11) shear polarizability X22 term from PSF model for forced y filter detections.\\
%ylensPSFShearE1 & - & REAL & -999  &K95 eq. (B12) shear polarizability e1 term from PSF model for forced y filter detections.\\
%ylensPSFShearE2 & - & REAL & -999  &K95 eq. (B12) shear polarizability e2 term from PSF model forced y filter detections.\\
ylensPSFShearE2 \\
\hline
\end{tabular}}
\end{center}
\label{table:ForcedMeanLensing}
\end{table}%

% \subsection{Forced \ippstage{warp} Exposure Tables}

\begin{table}[b]
\caption{ForcedWarpMeta: Contains the metadata related to a sky-aligned distortion corrected \ippstage{warp} image, upon which forced photometry is performed.  The astrometric and photometric calibration of the \ippstage{warp} image are listed.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
forcedWarpID & - & BIGINT & NA  &Unique forced \ippstage{warp} identifier.\\
batchID & - & BIGINT & NA  &Internal database batch identifier.\\
surveyID & - & TINYINT & NA  &Survey identifier.  Details in the Survey table.\\
filterID & - & TINYINT & NA  &Filter identifier.  Details in the Filter table.\\
frameID & - & INT & NA  &Frame/exposure identifier of the Frame associated with this warp.\\
ippSkycalID & - & INT & NA  &IPP skycal identifier for the run that generated the positions for forced\\
& & & & photometry.\\
stackMetaID & - & INT & NA  &Identifier for the \ippstage{stack} which yielded the positions for forced photometry.\\
tessID & - & TINYINT & 0  &Tessellation identifier.  Details in the TessellationType table.\\
projectionID & - & SMALLINT & -1  &Projection cell identifier.\\
skyCellID & - & TINYINT & 255  &Skycell region identifier.\\
photoCalID & - & INT & NA  &Photometric calibration identifier.  Details in the PhotoCal table.\\
analysisVer & - & VARCHAR(100) &   &IPP software analysis release version.\\
md5sum & - & VARCHAR(100) &   &IPP MD5 Checksum.\\
expTime & seconds & REAL & -999  &Exposure time of the source frame/exposure for this \ippstage{warp} image.  Necessary \\
& & & & for converting listed fluxes and magnitudes back to measured ADU counts.\\
recalAstroScatX & arcsec & REAL & -999  &Measurement of the re-calibration (not astrometric error) in the X direction.\\
recalAstroScatY & arcsec & REAL & -999  &Measurement of the re-calibration (not astrometric error) in the Y direction.\\
recalNAstroStars & - & INT & -999  &Number of astrometric reference sources used in recalibration.\\
recalphotoScat & magnitudes & REAL & -999  &Photometric scatter relative to reference catalog.\\
recalNPhotoStars & - & INT & -999  &Number of astrometric reference sources used in recalibration.\\
psfModelID & - & INT & -999  &PSF model identifier.\\
psfFWHM & arcsec & REAL & -999  &Mean PSF full width at half maximum at image center.\\
psfWidMajor & arcsec & REAL & -999  &PSF major axis FWHM at image center.\\
psfWidMinor & arcsec & REAL & -999  &PSF minor axis FWHM at image center.\\
psfTheta & degrees & REAL & -999  &PSF major axis orientation at image center.\\
photoZero & magnitudes & REAL & -999  &Locally derived photometric zero point for this \ippstage{warp} image.\\
ctype1 & - & VARCHAR(100) &   &Name of astrometric projection in RA.\\
ctype2 & - & VARCHAR(100) &   &Name of astrometric projection in Dec.\\
crval1 & degrees & FLOAT & -999  &Right ascension corresponding to reference pixel.\\
crval2 & degrees & FLOAT & -999  &Declination corresponding to reference pixel.\\
crpix1 & sky pixels & FLOAT & -999  &Reference pixel for RA.\\
crpix2 & sky pixels & FLOAT & -999  &Reference pixel for Dec.\\
cdelt1 & degrees/pixel & FLOAT & -999  &Pixel scale in RA.\\
cdelt2 & degrees/pixel & FLOAT & -999  &Pixel scale in Dec.\\
pc001001 & - & FLOAT & -999  &Linear transformation matrix element between image pixel x and RA.\\
pc001002 & - & FLOAT & -999  &Linear transformation matrix element between image pixel y and RA.\\
pc002001 & - & FLOAT & -999  &Linear transformation matrix element between image pixel x and Dec.\\
pc002002 & - & FLOAT & -999  &Linear transformation matrix element between image pixel y and Dec.\\
processingVersion & - & TINYINT & NA  &Data release version.\\
\hline
\end{tabular}
\end{center}
\label{table:ForcedWarpMeta}
\end{table}%




\begin{table}[b]
\caption{ForcedWarpMeasurement: Contains single epoch forced photometry of individual measurements of objects detected in the stacked images.  The identifiers connecting the measurement back to the original image and to the object association are provided.  PSF, aperture, and \citet{Kron1980} photometry are included, along with sky and detector coordinate positions.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsFWid & - & BIGINT & NA  &Unique internal PSPS forced \ippstage{warp} identifier.\\
detectID & - & BIGINT & NA  &Unique detection identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
ippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
filterID & - & TINYINT & NA  &Filter identifier.  Details in the Filter table.\\
surveyID & - & TINYINT & NA  &Survey identifier.  Details in the Survey table.\\
forcedSummaryID & - & BIGINT & NA  &Unique forced \ippstage{warp} summary identifier.\\
forcedWarpID & - & BIGINT & NA  &Unique forced \ippstage{warp} identifier.\\
randomWarpID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
tessID & - & TINYINT & 0  &Tessellation identifier.  Details in the TessellationType table.\\
projectionID & - & SMALLINT & -1  &Projection cell identifier.\\
skyCellID & - & TINYINT & 255  &Skycell region identifier.\\
dvoRegionID & - & INT & -1  &Internal DVO region identifier.\\
obsTime & days & FLOAT & -999  &Modified Julian Date at the midpoint of the observation.\\
zp & magnitudes & REAL & 0  &Photometric zeropoint.  Necessary for converting listed fluxes and magnitudes \\
& & & & back to measured ADU counts.\\
telluricExt & magnitudes & REAL & NA  &Estimated Telluric extinction due to non-photometric observing conditions. \\
& & & & Necessary for converting listed fluxes and magnitudes back to measured ADU counts.\\
expTime & seconds & REAL & -999  &Exposure time of the frame/exposure.  Necessary for converting listed fluxes \\
& & & & and magnitudes back to measured ADU counts.\\
airMass & - & REAL & 0  &Airmass at midpoint of the exposure.  Necessary for converting listed fluxes \\
& & & & and magnitudes back to measured ADU counts.\\
FpsfFlux & Jy & REAL & -999  &PSF flux.\\
FpsfFluxErr & Jy & REAL & -999  &Error in PSF flux.\\
xPosChip & raw pixels & REAL & -999  &PSF x position in original chip pixels.\\
yPosChip & raw pixels & REAL & -999  &PSF y position in original chip pixels.\\
FccdID & - & SMALLINT & -999  &OTA identifier of original chip (see ImageMeta).\\
FpsfMajorFWHM & arcsec & REAL & -999  &PSF major axis FWHM.\\
FpsfMinorFWHM & arcsec & REAL & -999  &PSF minor axis FWHM.\\
FpsfTheta & degrees & REAL & -999  &PSF major axis orientation.\\
FpsfCore & - & REAL & -999  &PSF core parameter k, where $F = F0 / (1 + k r^2 + r^{3.33})$.\\
FpsfQf & - & REAL & -999  &PSF coverage factor.\\
FpsfQfPerfect & - & REAL & -999  &PSF weighted fraction of pixels totally unmasked.\\
FpsfChiSq & - & REAL & -999  &Reduced chi squared value of the PSF model fit.\\
FmomentXX & $arcsec^2$ & REAL & -999  &Second moment $M_{xx}$.\\
FmomentXY & $arcsec^2$ & REAL & -999  &Second moment $M_{xy}$.\\
FmomentYY & $arcsec^2$ & REAL & -999  &Second moment $M_{yy}$.\\
FmomentR1 & arcsec & REAL & -999  &First radial moment.\\
FmomentRH & $arcsec^{0.5}$ & REAL & -999  &Half radial moment ($r^{0.5}$ weighting).\\
FmomentM3C & $arcsec^2$ & REAL & -999  &Cosine of trefoil second moment term: $r^2 cos(3 theta) = M_{xxx} - 3 * M_{xyy}$.\\
FmomentM3S & $arcsec^2$ & REAL & -999  &Sine of trefoil second moment: $r^2 sin (3 theta) = 3 * M_{xxy} - M_{yyy}$.\\
FmomentM4C & $arcsec^2$ & REAL & -999  &Cosine of quadrupole second moment: $r^2 cos (4 theta) = M_{xxxx} - 6 * M_{xxyy} + M_{yyyy}$.\\
FmomentM4S & $arcsec^2$ & REAL & -999  &Sine of quadrupole second moment: $r^2 sin (4 theta) = 4 * M_{xxxy} - 4 * M_{xyyy}$.\\
FapFlux & Jy & REAL & -999  &Aperture flux.\\
FapFluxErr & Jy & REAL & -999  &Error in aperture flux.\\
FapFillF & - & REAL & -999  &Aperture fill factor.\\
FapRadius & arcsec & REAL & -999  &Aperture radius for forced \ippstage{warp} detection.\\
FkronFlux & Jy & REAL & -999  &Kron (1980) flux.\\
FkronFluxErr & Jy & REAL & -999  &Error in Kron (1980) flux.\\
FkronRad & arcsec & REAL & -999  &Kron (1980) radius.\\
Fsky & $Jy/arcsec^2$ & REAL & -999  &Background sky level.\\
FskyErr & $Jy/arcsec^2$ & REAL & -999  &Error in background sky level.\\
FinfoFlag & - & BIGINT & 0  &Information flag bitmask indicating details of the photometry.  \\
& & & & Values listed in DetectionFlags.\\
FinfoFlag2 & - & INT & 0  &Information flag bitmask indicating details of the photometry.  \\
& & & & Values listed in DetectionFlags2.\\
FinfoFlag3 & - & INT & 0  &Information flag bitmask indicating details of the photometry.  \\
& & & & Values listed in DetectionFlags3.\\
processingVersion & - & TINYINT & NA  &Data release version.\\
\hline
\end{tabular}
\end{center}
\label{table:ForcedWarpMeasurement}
\end{table}%



\begin{table}[b]
\caption{ForcedWarpMasked: Contains an entry for objects detected in the stacked images which were in the footprint of a single epoch exposure, but for which there are no unmasked pixels at that epoch.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsFWid & - & BIGINT & NA  &Unique internal PSPS forced \ippstage{warp} identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
ippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
filterID & - & TINYINT & NA  &Filter identifier.  Details in the Filter table.\\
surveyID & - & TINYINT & NA  &Survey identifier.  Details in the Survey table.\\
forcedSummaryID & - & BIGINT & NA  &Forced \ippstage{warp} summary meta identifier\\
forcedWarpID & - & BIGINT & NA  &Unique forced \ippstage{warp} identifier.\\
randomWarpID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
tessID & - & TINYINT & 0  &Tessellation identifier.  Details in the TessellationType table.\\
projectionID & - & SMALLINT & -1  &Projection cell identifier.\\
skyCellID & - & REAL & -999  &Skycell region identifier.\\
dvoRegionID & - & REAL & -999  &Internal DVO region identifier.\\
obsTime & days & FLOAT & -999  &Modified Julian Date at the midpoint of the observation.\\
\hline
\end{tabular}
\end{center}
\label{table:ForcedWarpMasked}
\end{table}%

\begin{table}[b]
\caption{ForcedWarpExtended: Contains the single epoch forced photometry fluxes within the SDSS R5 (r = 3.00 arcsec), R6 (r = 4.63 arcsec), and R7 (r = 7.43 arcsec) apertures \citep{Stoughton2002} for objects detected in the stacked images.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsFWid & - & BIGINT & NA  &Unique internal PSPS forced \ippstage{warp} identifier.\\
detectID & - & BIGINT & NA  &Unique detection identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
ippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
filterID & - & TINYINT & NA  &Filter identifier.  Details in the Filter table.\\
surveyID & - & TINYINT & NA  &Survey identifier.  Details in the Survey table.\\
forcedWarpID & - & BIGINT & NA  &Unique forced \ippstage{warp} identifier.\\
randomWarpID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
tessID & - & TINYINT & 0  &Tessellation identifier.  Details in the TessellationType table.\\
projectionID & - & SMALLINT & -1  &Projection cell identifier.\\
skyCellID & - & TINYINT & 255  &Skycell region identifier.\\
dvoRegionID & - & INT & -1  &Internal DVO region identifier.\\
obsTime & days & FLOAT & -999  &Modified Julian Date at the midpoint of the observation.\\
flxR5 & Jy & REAL & -999  &Flux from forced photometry measurement within an aperture of radius \\
& & & & r = 3.00 arcsec.\\
flxR5Err & Jy & REAL & -999  &Error in flux from forced photometry measurement within an aperture of\\
& & & & radius r = 3.00 arcsec.\\
flxR5Std & Jy & REAL & -999  &Standard deviation of flux from forced photometry measurement within \\
& & & & an aperture of radius r = 3.00 arcsec.\\
flxR5Fill & - & REAL & -999  &Aperture fill factor for forced photometry measurement within an \\
& & & & aperture of radius r = 3.00 arcsec.\\
flxR6 & Jy & REAL & -999  &Flux from forced photometry measurement within an aperture of radius \\
& & & & r = 4.63 arcsec.\\
flxR6Err & Jy & REAL & -999  &Error in flux from forced photometry measurement within an aperture of\\
& & & & radius r = 4.63 arcsec.\\
flxR6Std & Jy & REAL & -999  &Standard deviation of flux from forced photometry measurement within \\
& & & & an aperture of radius r = 4.63 arcsec.\\
flxR6Fill & - & REAL & -999  &Aperture fill factor for forced photometry measurement within an \\
& & & & aperture of radius r = 4.63 arcsec.\\
flxR7 & Jy & REAL & -999  &Flux from forced photometry measurement within an aperture of radius \\
& & & & r = 7.43 arcsec.\\
flxR7Err & Jy & REAL & -999  &Error in flux from forced photometry measurement within an aperture of\\
& & & & radius r = 7.43 arcsec.\\
flxR7Std & Jy & REAL & -999  &Standard deviation of flux from forced photometry measurement within \\
& & & & an aperture of radius r = 7.43 arcsec.\\
flxR7Fill & - & REAL & -999  &Aperture fill factor for forced photometry measurement within an \\
& & & & aperture of radius r = 7.43 arcsec.\\
\hline
\end{tabular}
\end{center}
\label{table:ForcedWarpExtended}
\end{table}%



\begin{table}[b]
\caption{ForcedWarpLensing: Contains the \citet[K95]{Kaiser1995} lensing parameters measured from the forced photometry of objects detected in stacked images on the individual single epoch data.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsFWid & - & BIGINT & NA  &Unique internal PSPS forced \ippstage{warp} identifier.\\
detectID & - & BIGINT & NA  &Unique detection identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
ippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
filterID & - & TINYINT & NA  &Filter identifier.  Details in the Filter table.\\
surveyID & - & TINYINT & NA  &Survey identifier.  Details in the Survey table.\\
forcedWarpID & - & BIGINT & NA  &Unique forced \ippstage{warp} identifier.\\
randomWarpID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
tessID & - & TINYINT & 0  &Tessellation identifier.  Details in the TessellationType table.\\
projectionID & - & SMALLINT & -1  &Projection cell identifier.\\
skyCellID & - & TINYINT & 255  &Skycell region identifier.\\
dvoRegionID & - & INT & -1  &Internal DVO region identifier.\\
obsTime & days & FLOAT & -999  &Modified Julian Date at the midpoint of the observation.\\
lensObjSmearX11 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X11 term from forced photometry.\\
lensObjSmearX12 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X12 term from forced photometry.\\
lensObjSmearX22 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X22 term from forced photometry.\\
lensObjSmearE1 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e1 term from forced photometry.\\
lensObjSmearE2 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e2 term from forced photometry.\\
lensObjShearX11 & - & REAL & -999  &K95 eq. (B11) shear polarizability X11 term from forced photometry.\\
lensObjShearX12 & - & REAL & -999  &K95 eq. (B11) shear polarizability X12 term from forced photometry.\\
lensObjShearX22 & - & REAL & -999  &K95 eq. (B11) shear polarizability X22 term from forced photometry.\\
lensObjShearE1 & - & REAL & -999  &K95 eq. (B12) shear polarizability e1 term from forced photometry.\\
lensObjShearE2 & - & REAL & -999  &K95 eq. (B12) shear polarizability e2 term from forced photometry.\\
lensPSFSmearX11 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X11 term from PSF model for forced photometry.\\
lensPSFSmearX12 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X12 term from PSF model for forced photometry.\\
lensPSFSmearX22 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A11) smear polarizability X22 term from PSF model for forced photometry.\\
lensPSFSmearE1 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e1 term from PSF model for forced photometry.\\
lensPSFSmearE2 & $arcsec^{-2}$ & REAL & -999  &K95 eq. (A12) smear polarizability e2 term from PSF model for forced photometry.\\
lensPSFShearX11 & - & REAL & -999  &K95 eq. (B11) shear polarizability X11 term from PSF model for forced photometry.\\
lensPSFShearX12 & - & REAL & -999  &K95 eq. (B11) shear polarizability X12 term from PSF model for forced photometry.\\
lensPSFShearX22 & - & REAL & -999  &K95 eq. (B11) shear polarizability X22 term from PSF model for forced photometry.\\
lensPSFShearE1 & - & REAL & -999  &K95 eq. (B12) shear polarizability e1 term from PSF model for forced photometry.\\
lensPSFShearE2 & - & REAL & -999  &K95 eq. (B12) shear polarizability e2 term from PSF model for forced photometry.\\
psfE1 & - & REAL & -999  &K95 polarization parameter $e1 = (M_{xx} - M_{yy}) / (M_{xx} + M_{yy})$ from forced photometry.\\
psfE2 & - & REAL & -999  &K95 polarization parameter $e2 =  (2 M_{xy}) / (M_{xx} + M_{yy})$ from forced photometry.\\

\hline
\end{tabular}
\end{center}
\label{table:ForcedWarpLensing}
\end{table}%




\begin{table}[b]
\caption{ForcedWarpToImage: Contains the mapping of which input image comprises a particular \ippstage{warp} image used for forced photometry.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
forcedWarpID & - & BIGINT & NA  &Unique forced \ippstage{warp} identifier.\\
imageID & - & BIGINT & NA  &Unique image identifier.  Constructed as (100 * frameID + ccdID).\\
\hline
\end{tabular}
\end{center}
\label{table:ForcedWarpToImage}
\end{table}%

% \subsection{Forced Galaxy Tables}

\begin{table}[b]
\caption{ForcedGalaxyShape: Contains the extended source galaxy shape parameters.  All filters are matched into a single row.  The positions, magnitudes, fluxes, and Sersic indices are inherited from their parent measurement in the StackModelFit tables, and are reproduced here for convenience.  The major and minor axes and orientation are recalculated on a warp-by-warp basis from the best fit given these inherited properties (\citep{Sersic1963}).}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
objID & - & BIGINT & NA  &Unique object identifier.\\
uniquePspsFGid & - & BIGINT & NA  &Unique internal PSPS forced galaxy identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
surveyID & - & TINYINT & NA  &Survey identifier.  Details in the Survey table.\\
randomForcedGalID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
galModelType & - & TINYINT & -999  &Galaxy model identifier.\\
nFilter & - & TINYINT & -999  &Number of filters with valid model measurements.\\
gippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
gstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for the g filter \ippstage{stack} that was the original detection source.\\
gGalMajor & arcsec & REAL & -999  &Galaxy major axis for g filter measurement.\\
gGalMajorErr & arcsec & REAL & -999  &Error in galaxy major axis for g filter measurement.\\
gGalMinor & arcsec & REAL & -999  &Galaxy minor axis for g filter measurement.\\
gGalMinorErr & arcsec & REAL & -999  &Error in galaxy minor axis for g filter measurement.\\
gGalMag & AB & REAL & -999  &Galaxy fit magnitude for g filter measurement.\\
gGalMagErr & AB & REAL & -999  &Error in galaxy fit magnitude for g filter measurement.\\
gGalPhi & degrees & REAL & -999  &Major axis position angle of the model fit for the g filter measurement.\\
gGalIndex & - & REAL & -999  &Sersic index of the model fit for the g filter measurement.\\
gGalFlags & - & SMALLINT & -999  &Analysis flags for the galaxy model chi-square fit (g filter measurement, values \\
& & & & defined in ForcedGalaxyShapeFlags).\\
gGalChisq & - & REAL & -999  &Reduced chi squared value for g filter measurement.\\
rippDetectID \\
... & & & & same entries repeated for r, i, z, and y filters \\
%rippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%rstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for the r filter \ippstage{stack} that was the original detection source.\\
%rGalMajor & arcsec & REAL & -999  &Galaxy major axis for r filter measurement.\\
%rGalMajorErr & arcsec & REAL & -999  &Error in galaxy major axis for r filter measurement.\\
%rGalMinor & arcsec & REAL & -999  &Galaxy minor axis for r filter measurement.\\
%rGalMinorErr & arcsec & REAL & -999  &Error in galaxy minor axis for r filter measurement.\\
%rGalMag & AB & REAL & -999  &Galaxy fit magnitude for r filter measurement.\\
%rGalMagErr & AB & REAL & -999  &Error in galaxy fit magnitude for r filter measurement.\\
%rGalPhi & degrees & REAL & -999  &Major axis position angle of the model fit for the r filter measurement.\\
%rGalIndex & - & REAL & -999  &Sersic index of the model fit for the r filter measurement.\\
%rGalFlags & - & SMALLINT & -999  &Analysis flags for the galaxy model chi-square fit (r filter measurement, values defined in ForcedGalaxyShapeFlags).\\
%rGalChisq & - & REAL & -999  &Reduced chi squared value for r filter measurement.\\
%iippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%istackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for the i filter \ippstage{stack} that was the original detection source.\\
%iGalMajor & arcsec & REAL & -999  &Galaxy major axis for i filter measurement.\\
%iGalMajorErr & arcsec & REAL & -999  &Error in galaxy major axis for i filter measurement.\\
%iGalMinor & arcsec & REAL & -999  &Galaxy minor axis for i filter measurement.\\
%iGalMinorErr & arcsec & REAL & -999  &Error in galaxy minor axis for i filter measurement.\\
%iGalMag & AB & REAL & -999  &Galaxy fit magnitude for i filter measurement.\\
%iGalMagErr & AB & REAL & -999  &Error in galaxy fit magnitude for i filter measurement.\\
%iGalPhi & degrees & REAL & -999  &Major axis position angle of the model fit for the i filter measurement.\\
%iGalIndex & - & REAL & -999  &Sersic index of the model fit for the i filter measurement.\\
%iGalFlags & - & SMALLINT & -999  &Analysis flags for the galaxy model chi-square fit (i filter measurement, values defined in ForcedGalaxyShapeFlags).\\
%iGalChisq & - & REAL & -999  &Reduced chi squared value for i filter measurement.\\
%zippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%zstackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for the z filter \ippstage{stack} that was the original detection source.\\
%zGalMajor & arcsec & REAL & -999  &Galaxy major axis for z filter measurement.\\
%zGalMajorErr & arcsec & REAL & -999  &Error in galaxy major axis for z filter measurement.\\
%zGalMinor & arcsec & REAL & -999  &Galaxy minor axis for z filter measurement.\\
%zGalMinorErr & arcsec & REAL & -999  &Error in galaxy minor axis for z filter measurement.\\
%zGalMag & AB & REAL & -999  &Galaxy fit magnitude for z filter measurement.\\
%zGalMagErr & AB & REAL & -999  &Error in galaxy fit magnitude for z filter measurement.\\
%zGalPhi & degrees & REAL & -999  &Major axis position angle of the model fit for the z filter measurement.\\
%zGalIndex & - & REAL & -999  &Sersic index of the model fit for the z filter measurement.\\
%zGalFlags & - & SMALLINT & -999  &Analysis flags for the galaxy model chi-square fit (z filter measurement, values defined in ForcedGalaxyShapeFlags).\\
%zGalChisq & - & REAL & -999  &Reduced chi squared value for z filter measurement.\\
%yippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
%ystackImageID & - & BIGINT & NA  &Unique \ippstage{stack} identifier for the z filter \ippstage{stack} that was the original detection source.\\
%yGalMajor & arcsec & REAL & -999  &Galaxy major axis for y filter measurement.\\
%yGalMajorErr & arcsec & REAL & -999  &Error in galaxy major axis for y filter measurement.\\
%yGalMinor & arcsec & REAL & -999  &Galaxy minor axis for y filter measurement.\\
%yGalMinorErr & arcsec & REAL & -999  &Error in galaxy minor axis for y filter measurement.\\
%yGalMag & AB & REAL & -999  &Galaxy fit magnitude for y filter measurement.\\
%yGalMagErr & AB & REAL & -999  &Error in galaxy fit magnitude for y filter measurement.\\
%yGalPhi & degrees & REAL & -999  &Major axis position angle of the model fit for the y filter measurement.\\
%yGalIndex & - & REAL & -999  &Sersic index of the model fit for the y filter measurement.\\
%yGalFlags & - & SMALLINT & -999  &Analysis flags for the galaxy model chi-square fit (y filter measurement, values defined in ForcedGalaxyShapeFlags).\\
%yGalChisq & - & REAL & -999  &Reduced chi squared value for y filter measurement.\\
yGalChisq\\
\hline
\end{tabular}
\end{center}
\label{table:ForcedGalaxyShape}
\end{table}%

\clearpage

\subsection{Tables Related to Difference Image Analysis}

\begin{table}[b]
\caption{DiffDetObject: Contains the positional information for difference detection objects in a number of coordinate systems.  The objects associate difference detections within a one arcsecond radius.  The number of detections in each filter from is listed, along with maximum coverage fractions \citep[see][]{Szalay2007}.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
diffObjName & - & VARCHAR(32) & NA  &IAU name for this object.\\
diffObjPSOName & - & VARCHAR(32) & NA  &Alternate Pan-STARRS name for this object.\\
diffObjAltName1 & - & VARCHAR(32) &   &Altername name for this object.\\
diffObjAltName2 & - & VARCHAR(32) &   &Altername name for this object.\\
diffObjAltName3 & - & VARCHAR(32) &   &Altername name for this object.\\
diffObjPopularName & - & VARCHAR(140) &   &Well known name for this object.\\
diffObjID & - & BIGINT & NA  &Unique difference object identifier.\\
uniquePspsDOid & - & BIGINT & NA  &Unique internal PSPS difference object identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
surveyID & - & TINYINT & NA  &Survey identifier.  Details in the Survey table.\\
htmID & - & BIGINT & NA  &Hierarchical triangular mesh (Szalay 2007) index.\\
zoneID & - & INT & NA  &Local zone index, found by dividing the sky into bands of declination \\
& & & & 1/2 arcminute in height: zoneID = floor((90 + declination)/0.0083333).\\
randomDiffObjID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
batchID & - & BIGINT & NA  &Internal database batch identifier.\\
dvoRegionID & - & INT & -1  &Internal DVO region identifier.\\
objInfoFlag & - & INT & 0  &Information flag bitmask indicating details of the photometry.  Values\\
& & & & listed in ObjectInfoFlags.\\
qualityFlag & - & TINYINT & 0  &Subset of objInfoFlag denoting whether this object is real or a\\
& & & & likely false positive.  Values listed in ObjectQualityFlags.\\
ra & degrees & FLOAT & -999  &Right ascension mean.\\
dec & degrees & FLOAT & -999  &Declination mean.\\
cx & - & FLOAT & NA  &Cartesian x on a unit sphere. \\
cy & - & FLOAT & NA  &Cartesian y on a unit sphere. \\
cz & - & FLOAT & NA  &Cartesian z on a unit sphere. \\
lambda & degrees & FLOAT & -999  &Ecliptic longitude.\\
beta & degrees & FLOAT & -999  &Ecliptic latitude.\\
l & degrees & FLOAT & -999  &Galactic longitude.\\
b & degrees & FLOAT & -999  &Galactic latitude.\\
gQfPerfect & - & REAL & -999  &Maximum PSF weighted fraction of pixels totally unmasked from g\\
& & & & filter detections.\\
rQfPerfect & - & REAL & -999  &Maximum PSF weighted fraction of pixels totally unmasked from r\\
& & & & filter detections.\\
iQfPerfect & - & REAL & -999  &Maximum PSF weighted fraction of pixels totally unmasked from i\\
& & & & filter detections.\\
zQfPerfect & - & REAL & -999  &Maximum PSF weighted fraction of pixels totally unmasked from z\\
& & & & filter detections.\\
yQfPerfect & - & REAL & -999  &Maximum PSF weighted fraction of pixels totally unmasked from y\\
& & & & filter detections.\\
processingVersion & - & TINYINT & NA  &Data release version.\\
nDetections & - & SMALLINT & -999  &Number of difference detections in all filters.\\
ng & - & SMALLINT & -999  &Number of difference detections in g filter.\\
nr & - & SMALLINT & -999  &Number of difference detections in r filter.\\
ni & - & SMALLINT & -999  &Number of difference detections in i filter.\\
nz & - & SMALLINT & -999  &Number of difference detections in z filter.\\
ny & - & SMALLINT & -999  &Number of difference detections in y filter.\\
\hline
\end{tabular}
\end{center}
\label{table:DiffDetObject}
\end{table}%

% \subsection{Diff Detection Tables}

\begin{table}[b]
\caption{DiffMeta: Contains metadata related to a difference image constructed by subtracting a stacked image from a single epoch image, or in the case of the MD Survey from a nightly \ippstage{stack} (stack made from all exposures in a single filter in a single night).  The astrometric calibration of the reference \ippstage{stack} is listed.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
diffImageID & - & BIGINT & NA  &Unique difference identifier.\\
batchID & - & BIGINT & NA  &Internal database batch identifier.\\
surveyID & - & TINYINT & NA  &Survey identifier.  Details in the Survey table.\\
filterID & - & TINYINT & NA  &Filter identifier.  Details in the Filter table.\\
diffTypeID & - & TINYINT & 0  &Difference type identifier.  Details in the DiffType table.\\
frameID & - & INT & NA  &Frame/exposure identifier for the positive image in warp-stack \\
& & & & difference images; \\ %not populated for stack-stack differences.\\
posImageID & - & BIGINT & NA  &Image identifier for the positive image.  \\ %For warp-stack difference images, this corresponds to the ForcedWarpToImage.forcedWarpID entry.  For stack-stack difference images, this corresponds to StackMeta.stackImageID.\\
negImageID & - & BIGINT & NA  &Image identifier for the negative image.  \\%For warp-stack difference images, this corresponds to the StackMeta.stackImageID entry.\\
ippDiffID & - & BIGINT & NA  &IPP diffRun identifier.\\
tessID & - & TINYINT & 0  &Tessellation identifier.  Details in the TessellationType table.\\
projectionID & - & SMALLINT & -1  &Projection cell identifier.\\
skyCellID & - & TINYINT & 255  &Skycell region identifier.\\
photoCalID & - & INT & NA  &Photometric calibration identifier.  Details in the PhotoCal table.\\
analysisVer & - & VARCHAR(100) &   &IPP software analysis release version.\\
md5sum & - & VARCHAR(100) &   &IPP MD5 Checksum.\\
detectionThreshold & magnitudes & REAL & -999  &Reference magnitude for detection efficiency calculation.\\
expTime & seconds & REAL & -999  &Exposure time of positive image.  Necessary for converting listed \\
& & & & fluxes and magnitudes back to measured ADU counts.\\
psfModelID & - & INT & -999  &PSF model identifier.\\
psfFWHM & arcsec & REAL & -999  &Mean PSF full width at half maximum at image center.\\
psfWidMajor & arcsec & REAL & -999  &PSF major axis FWHM at image center.\\
psfWidMinor & arcsec & REAL & -999  &PSF minor axis FWHM at image center.\\
psfTheta & degrees & REAL & -999  &PSF major axis orientation at image center.\\
kernel & - & VARCHAR(100) &   &Subtraction kernel.\\
mode & - & TINYINT & 0  &Subtraction mode for which input to convolve.\\
numStamps & - & INT & -999  &Number of stamps.\\
stampDevMean & - & REAL & -999  &Mean stamp deviation.\\
stampDevRMS & - & REAL & -999  &RMS stamp deviation.\\
normalization & - & REAL & -999  &Normalization.\\
convolveMax & - & REAL & -999  &Maxiumum convolution fraction.\\
deconvolveMax & - & REAL & -999  &Maximum deconvolution fraction.\\
ctype1 & - & VARCHAR(100) &   &Name of astrometric projection in right ascension.\\
ctype2 & - & VARCHAR(100) &   &Name of astrometric projection in declination.\\
crval1 & degrees & FLOAT & -999  &Right ascension corresponding to reference pixel.\\
crval2 & degrees & FLOAT & -999  &Declination corresponding to reference pixel.\\
crpix1 & sky pixels & FLOAT & -999  &Reference pixel for right ascension.\\
crpix2 & sky pixels & FLOAT & -999  &Reference pixel for declination.\\
cdelt1 & degrees/pixel & FLOAT & -999  &Pixel scale in right ascension.\\
cdelt2 & degrees/pixel & FLOAT & -999  &Pixel scale in declination.\\
pc001001 & - & FLOAT & -999  &Linear transformation matrix element between image pixel x and \\
& & & & right ascension.\\
pc001002 & - & FLOAT & -999  &Linear transformation matrix element between image pixel y and \\
& & & & right ascension.\\
pc002001 & - & FLOAT & -999  &Linear transformation matrix element between image pixel x and \\
& & & & declination.\\
pc002002 & - & FLOAT & -999  &Linear transformation matrix element between image pixel y and \\
& & & & declination.\\
processingVersion & - & TINYINT & NA  &Data release version.\\
\hline
\end{tabular}
\end{center}
\label{table:DiffMeta}
\end{table}%

\begin{table}[b]
\caption{DiffDetection: Contains the photometry of individual detections from a difference image.  The identifiers connecting the detection back to the difference image and to the object association are provided.  PSF, aperture, and \citet{Kron1980} photometry are included, along with sky and detector coordinate positions.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
diffObjID & - & BIGINT & NA  &Unique difference object identifier.\\
uniquePspsDFid & - & BIGINT & NA  &Unique internal PSPS difference detection identifier.\\
diffDetID & - & BIGINT & NA  &Unique difference detection identifier.\\
diffImageID & - & BIGINT & NA  &Difference detection meta identifier.\\
ippObjID & - & BIGINT & NA  &IPP internal object identifier.\\
ippDetectID & - & BIGINT & NA  &IPP internal detection identifier.\\
fromPosImage & - & TINYINT & NA  &Detection is from positive image (if 1) or negative image (if 0).\\
filterID & - & TINYINT & NA  &Filter identifier.  Details in the Filter table.\\
surveyID & - & TINYINT & NA  &Survey identifier.  Details in the Survey table.\\
randomDiffID & - & FLOAT & NA  &Random value drawn from the interval between zero and one.\\
tessID & - & TINYINT & 0  &Tessellation identifier.  Details in the TessellationType table.\\
projectionID & - & SMALLINT & -1  &Projection cell identifier.\\
skyCellID & - & TINYINT & 255  &Skycell region identifier.\\
dvoRegionID & - & INT & -1  &Internal DVO region identifier.\\
obsTime & days & FLOAT & -999  &Modified Julian Date at the midpoint of the observation.\\
xPos & sky pixels & REAL & -999  &PSF x center location.\\
yPos & sky pixels & REAL & -999  &PSF y center location.\\
xPosErr & sky pixels & REAL & -999  &Error in PSF x center location.\\
yPosErr & sky pixels & REAL & -999  &Error in PSF y center location.\\
pltScale & arcsec/pixel & REAL & -999  &Local plate scale at this location.\\
posAngle & degrees & REAL & -999  &Position angle (sky-to-chip) at this location.\\
ra & degrees & FLOAT & -999  &Right ascension.\\
dec & degrees & FLOAT & -999  &Declination.\\
raErr & arcsec & REAL & -999  &Right ascension error.\\
decErr & arcsec & REAL & -999  &Declination error.\\
zp & magnitudes & REAL & 0  &Photometric zeropoint for converting fluxes and magnitudes to measured ADU.\\
telluricExt & magnitudes & REAL & NA  &Estimated Telluric extinction due to non-photometric observing conditions.\\ % Necessary for converting listed fluxes and magnitudes back to measured ADU counts.\\
expTime & seconds & REAL & -999  &Exposure time of the positive single-epoch image. \\
% Necessary for converting listed fluxes and magnitudes back to measured ADU counts.\\
airMass & - & REAL & 0  &Airmass at midpoint of exposure to convert fluxes and magnitudes to measured ADU.\\
DpsfFlux & Jy & REAL & -999  &Flux from PSF fit.\\
DpsfFluxErr & Jy & REAL & -999  &Error in PSF flux.\\
xPosChip & raw pixels & REAL & -999  &PSF x position in original chip pixels.\\
yPosChip & raw pixels & REAL & -999  &PSF y position in original chip pixels.\\
ccdID & - & SMALLINT & -999  &OTA identifier of original chip (see ImageMeta).\\
DpsfMajorFWHM & arcsec & REAL & -999  &PSF major axis FWHM.\\
DpsfMinorFWHM & arcsec & REAL & -999  &PSF minor axis FWHM.\\
DpsfTheta & degrees & REAL & -999  &PSF major axis orientation.\\
DpsfCore & - & REAL & -999  &PSF core parameter k, where $F = F0 / (1 + k r^2 + r^{3.33}).$\\
DpsfQf & - & REAL & -999  &PSF coverage factor.\\
DpsfQfPerfect & - & REAL & -999  &PSF-weighted fraction of pixels totally unmasked.\\
DpsfChiSq & - & REAL & -999  &Reduced chi squared value of the PSF model fit.\\
DpsfLikelihood & - & REAL & -999  &Likelihood that this detection is best fit by a PSF.\\
DmomentXX & $arcsec^2$ & REAL & -999  &Second moment $M_{xx}$.\\
DmomentXY & $arcsec^2$ & REAL & -999  &Second moment $M_{xy}$.\\
DmomentYY & $arcsec^2$ & REAL & -999  &Second moment $M_{yy}$.\\
DmomentR1 & arcsec & REAL & -999  &First radial moment.\\
DmomentRH & $arcsec^{0.5}$ & REAL & -999  &Half radial moment ($r^{0.5}$ weighting).\\
DapFlux & Jy & REAL & -999  &Aperture flux.\\
DapFluxErr & Jy & REAL & -999  &Error in aperture flux.\\
DapFillF & - & REAL & -999  &Aperture fill factor.\\
DkronFlux & Jy & REAL & -999  &Kron (1980) flux.\\
DkronFluxErr & Jy & REAL & -999  &Error in Kron (1980) flux.\\
DkronRad & arcsec & REAL & -999  &Kron (1980) radius.\\
diffNPos & sky pixels & INT & -999  &Number of difference pixels within the aperture that are positive.\\
diffFPosRatio & - & REAL & -999  &Ratio of the sum of positive flux pixel values to the sum of the absolute value\\
& & & & of all unmasked pixels within the aperture.\\
diffNPosRatio & - & REAL & -999  &Ratio of the number of positive flux pixels to the number of unmasked pixels\\
& & & & within the aperture.\\
diffNPosMask & - & REAL & -999  &Ratio of the number of positive flux pixels to the number of positive or masked\\
& & & & pixels within the aperture.\\
diffNPosAll & - & REAL & -999  &Ratio of the number of positive flux pixels to the total number of all pixels within\\
& & & & the aperture.\\
diffPosDist & sky pixels & REAL & -999  &Distance to matching source in positive image.\\
diffNegDist & sky pixels & REAL & -999  &Distance to matching source in negative image.\\
diffPosSN & - & REAL & -999  &Signal to noise of matching source in positive image.\\
diffNegSN & - & REAL & -999  &Signal to noise of matching source in negative image.\\
Dsky & $Jy/arcsec^2$ & REAL & -999  &Background sky level.\\
DskyErr & $Jy/arcsec^2$ & REAL & -999  &Error in background sky level.\\
DinfoFlag & - & BIGINT & 0  &Information flag bitmask indicating details of the photometry. see DetectionFlags.\\
DinfoFlag2 & - & INT & 0  &Information flag bitmask indicating details of the photometry.  see DetectionFlags2.\\
DinfoFlag3 & - & INT & 0  &Information flag bitmask indicating details of the photometry.  see DetectionFlags3.\\
processingVersion & - & TINYINT & NA  &Data release version.\\
\hline
\end{tabular}
\end{center}
\label{table:DiffDetection}
\end{table}%

 
\begin{table}[b]
\caption{DiffToImage: Contains the mapping of which input images were used to construct a particular difference image.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
diffImageID & - & BIGINT & NA  &Unique difference identifier.\\
imageID & - & BIGINT & NA  &Unique image identifier.  Constructed as (100 * frameID + ccdID).\\
\hline
\end{tabular}
\end{center}
\label{table:DiffToImage}
\end{table}%

\begin{table}[b]
\caption{DiffDetEffMeta: Contains the detection efficiency information for a given individual difference image.  Provides the number of recovered sources out of 500 injected sources and statistics about the magnitudes of the recovered sources for a range of magnitude offsets.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lllll}
\hline
\hline
column name & units & data type & default & description\\
\hline
diffImageID & - & BIGINT & NA  &Unique difference image identifier.\\
magref & magnitudes & REAL & NA  &Detection efficiency reference magnitude.\\
nInjected & - & INT & NA  &Number of fake sources injected in each magnitude bin.\\
offset01 & magnitudes & REAL & NA  &Detection efficiency magnitude offset for bin 1.\\
counts01 & - & REAL & NA  &Detection efficiency count of recovered sources in bin 1.\\
diffMean01 & magnitudes & REAL & NA  &Detection efficiency mean magnitude difference in bin 1.\\
diffStdev01 & magnitudes & REAL & NA  &Detection efficiency standard deviation of magnitude differences in bin 1.\\
errMean01 & magnitudes & REAL & NA  &Detection efficiency mean magnitude error in bin 1.\\
offset02 & magnitudes & REAL & NA  &Detection efficiency magnitude offset for bin 2.\\
counts02 & - & REAL & NA  &Detection efficiency count of recovered sources in bin 2.\\
diffMean02 & magnitudes & REAL & NA  &Detection efficiency mean magnitude difference in bin 2.\\
diffStdev02 & magnitudes & REAL & NA  &Detection efficiency standard deviation of magnitude differences in bin 2.\\
errMean02 & magnitudes & REAL & NA  &Detection efficiency mean magnitude error in bin 2.\\
offset03 & magnitudes & REAL & NA  &Detection efficiency magnitude offset for bin 3.\\
counts03 & - & REAL & NA  &Detection efficiency count of recovered sources in bin 3.\\
diffMean03 & magnitudes & REAL & NA  &Detection efficiency mean magnitude difference in bin 3.\\
diffStdev03 & magnitudes & REAL & NA  &Detection efficiency standard deviation of magnitude differences in bin 3.\\
errMean03 & magnitudes & REAL & NA  &Detection efficiency mean magnitude error in bin 3.\\
...\\
offset13 & magnitudes & REAL & NA  &Detection efficiency magnitude offset for bin 13.\\
counts13 & - & REAL & NA  &Detection efficiency count of recovered sources in bin 13.\\
diffMean13 & magnitudes & REAL & NA  &Detection efficiency mean magnitude difference in bin 13.\\
diffStdev13 & magnitudes & REAL & NA  &Detection efficiency standard deviation of magnitude differences in bin 13.\\
errMean13 & magnitudes & REAL & NA  &Detection efficiency mean magnitude error in bin 13.\\
\hline
\end{tabular}
\end{center}
\label{table:DiffDetEffMeta}
\end{table}%

\clearpage
\section{IppToPsps translation tables}

The tables in this section describe the relationship between fields in
the PSPS database and their immediate source.  In some cases, the the
values are calculated by the IPP processing and extracted by the
\ippstage{IppToPsps} system from the output catalog files (e.g., the
cmf or smf files).  In other cases, the values a calculated within the
DVO system during the construction of that database or during the
calibration.  Some values are calculated directly by the PSPS ingest
software from other information (e.g., the $cx, cy, cz$ coordinate
system for objects).  

\begin{table}[b]
\caption{ObjectThin: This describes the sources for each of the columns within ippdbtable{ObjectThin} as well the formula to generate the data within the column, if it is not just copying directly. For this table, DVO cpt NAME shows that this comes from the cpt files in the DVO database, and has a column of NAME.  The sources for this table include: the DVO cpt files, \ippstage{IppToPsps}, PSPS, as well as a few columns that are not currently being used.}
\begin{center}
%\resizebox{\textwidth}{!}{%
\begin{tabular}{lll}
\hline
\hline
column name & source  & notes \\
\hline
objName & DVO cpt IAUNAME /\ippstage{IppToPsps} & \\
objPSOName & DVO cpt PSO\_NAME  & \\
objAltName1 & not set & \\ 
objAltName2 & not set & \\
objAltName3 & not set & \\
objPopularName & not set & \\
objID & DVO cpt EXT\_ID & \\
uniquePspsOBid &\ippstage{IppToPsps}& uniquePspsOBid = (batchID*1000000000) + row number) \\
ippObjID & DVO cpt OBJ\_ID and CAT\_ID & OBJ\_ID + (CAT\_ID $<<$ 32) \\
surveyID &\ippstage{IppToPsps}& set to 0 for 3$\pi$ \\
htmID & PSPS  & calculated and filled in PSPS \citep{Szalay2007} \\
%  Szalay, A.S., Gray,J., Fekete, G., Kunszt,P., Kukol, P., Thakar, A.: Indexing the Sphere with the Hierarchical Triangular Mesh, MSR-TR-2005-123 (2005).
%  https://www.microsoft.com/en-us/research/publication/indexing-the-sphere-with-the-hierarchical-triangular-mesh/
% it's a microsoft paper  
% all the calculated in PSPS (ref) are this reference
zoneID & PSPS & calculated and filled in PSPS\\
tessID & DVO cpt TESS\_ID & \\
projectionID & DVO cpt  PROJECTION\_ID & \\
skyCellID & DVO cpt SKYCELL\_ID & \\
randomID &\ippstage{IppToPsps}& random is seeded with RAND(batchID) \\
batchID &\ippstage{IppToPsps}& sequentially ncreases as batches are made \\
dvoRegionID & DVO cpt CAT\_ID & \\
processingVersion &\ippstage{IppToPsps}& set to 3 for this data release, for PV3 \\
objInfoFlag & DVO cpt FLAGS & \\
qualityFlag & DVO cpt FLAGS & FLAGS $>>$ 23 \& 0xFF \\
raStack & DVO cpt RA\_STK & \\
decStack & DVO cpt DEC\_STK & \\
raStackErr & DVO cpt RA\_STK\_ERR & \\
decStackErr & DVO cpt DEC\_STK\_ERR & \\
raMean & DVO cpt RA\_MEAN & \\
decMean & DVO cpt DEC\_MEAN & \\
raMeanErr & DVO cpt RA\_ERR & \\
decMeanErr & DVO cpt DEC\_ERR & \\
epochMean & DVO cpt EPOCH\_MEAN & \\
posMeanChisq & DVO cpt CHISQ\_POS & \\
cx & PSPS  & set to 0 initially; calculated and filled by PSPS \\
cy & PSPS   & set to 0 initially; calculated and filled by PSPS \\
cz & PSPS   & set to 0 initially; calculated and filled by PSPS \\
lambda & PSPS set to 0; calculated and filled by PSPS\\
beta & PSPS  set to 0; calculated and filled by PSPS\\
l & PSPS &set to 0; calculated and filled by PSPS\\
b & PSPS  &set to 0; calculated and filled by PSPS\\
nStackObjectRows &\ippstage{IppToPsps}& set to -999 for 3$\pi$ \\
nStackDetections & DVO cpt NSTACK\_DET & sum of NSTACK\_DET for all 5 filters \\    
nDetections &\ippstage{IppToPsps}& sum of non-null ng + nr + ni + nz + ny \\
ng & DVO cpt NCODE & \\
nr & DVO cpt NCODE & \\
ni & DVO cpt NCODE & \\
nz & DVO cpt NCODE & \\
ny & DVO cpt NCODE & \\
\hline
\end{tabular}
\end{center}
\label{table:ipptopspsObjectThin}
\end{table}%

\begin{table}[b]
\caption{MeanObject: This describes the sources for each of the columns within MeanObject as well the formula to generate the data within the column, if it is not just copying directly. For this table, DVO cps NAME shows that this comes from the cps files in the DVO database, and has a column of NAME.  The sources for this table include: the DVO cps files and \ippstage{IppToPsps}.}
\begin{center}
%%\resizebox{\textwidth}{!}{%
\begin{tabular}{lll}
\hline
\hline
column name & source  & notes \\
\hline
objID & \ippstage{IppToPsps}objectThin.objID & \\
uniquePspsOBid &\ippstage{IppToPsps}objectThin.uniquePspsOBid & \\
gQfPerfect & DVO cps PSF\_QF\_PERF\_MAX & \\
gMeanPSFMag & DVO cps MAG & \\
gMeanPSFMagErr & DVO cps MAG\_ERR & \\
gMeanPSFMagStd & DVO cps MAG\_STDEV & \\
gMeanPSFMagNpt & DVO cps NUSED & \\
gMeanPSFMagMin & DVO cps MAG\_MIN & \\
gMeanPSFMagMax & DVO cps MAG\_MAX & \\
gMeanKronMag & DVO cps MAG\_KRON & \\
gMeanKronMagErr & DVO cps MAG\_KRON\_ERR & \\
gMeanKronMagStd & DVO cps MAG\_KRON\_STDEV & \\
gMeanKronMagNpt & DVO cps NUSED\_KRON & \\
gMeanApMag & DVO cps MAG\_AP & \\
gMeanApMagErr & DVO cps MAG\_AP\_ERR & \\
gMeanApMagStd & DVO cps MAG\_AP\_STDEV & \\
gMeanApMagNpt & DVO cps NUSED\_AP & \\
gFlags & DVO cps FLAGS & \\
rQfPerfect \\
... & & same entries repeated for r, i, z, and y filters \\
yFlags \\
\hline
\end{tabular}
\end{center}
\label{table:ipptopspsMeanObject}
\end{table}%

\begin{table}[b]
\caption{StackObjectThin: This describes the sources for each of the columns within StackObjectThin as well the formula to generate the data within the column, if it is not just copying directly. For this table, DVO cps NAME shows that this comes from the cps files in the DVO database, and has a column of NAME.  The sources for this table include: the DVO cps files and \ippstage{IppToPsps}.}
\begin{center}
%%\resizebox{\textwidth}{!}{%
\begin{tabular}{lll}
\hline
\hline
column name & source  & notes \\
\hline
objID & DVO cpt & average.extID \\
uniquePspsSTid & \ippstage{IppToPsps} & (batchID*1000000000) + row number) \\
ippObjID & DVO cpt & OBJ\_ID + (CAT\_ID $<<$ 32)  \\
surveyID & \ippstage{IppToPsps}& set to 0 for 3$\pi$ \\ %%ok
tessID & cmf file & from header: TESS\_ID\\ %%ok
projectionID & cmf file  & from header, first 4 numbers in SKYCELL\\ %%ok
skyCellID & cmf file & from header, last 4 numbers in SKYCELL\\ %%ok
randomStackObjID & ipptopsps & random number generated in ipptopsps, seeded with batch\_id\\
primaryDetection & DVO cpm & (dvo.measure.flags \& 0x10000) $>>$ 16 \\ %%ok
bestDetection & DVO cpt & (dvo.average.objflags \& 0x8000) $>>$ 15) \\
dvoRegionID & DVO cpt & dvo.measure.catID\\
processingVersion & ipptopsps & set to 3 for this data release, for PV3\\
gippDetectID & DVO cpm & dvo.measure.detID\\
gstackDetectID & DVO cpm & dvo.measure.extID \\
gstackImageID & gpc1 database & internal stack ID for this stack\\
gra & DVO cpm  &  dvo.average.ra \\
gdec & DVO cpm &  dvo.average.dec\\
graErr & cmf file & $X\_PSF_SIG * PLTSCALE$\\
gdecErr & cmf file &  $Y\_PSF_SIG * PLTSCALE$\\
gEpoch & cmf file & from header, MJD-OBS\\
gPSFMag & DVO cpm & dvo.measure.FluxPSF (converted to mag using zero point) \\
gPSFMagErr &  DVO cpm & dvo.measure.dFluxPSF (converted to mag error) \\
gApMag & DVO cpm & dvo.measure.FluxAp (converted to mag using zero point) \\
gApMagErr & DVO cpm & dvo.measure.dFluxAp (converted to mag error) \\
gKronMag & DVO cpm & dvo.measure.FluxKron (converted to mag using zero point) \\
gKronMagErr & DVO cpm  & dvo.measure.dFluxKron (converted to mag error) \\
ginfoFlag & cmf file  & FLAGS\\
ginfoFlag2 & cmf file & FLAGS2 \\
ginfoFlag3 & DVO cpt & measure.dbFlags \\
gnFrames & cmf file, header & N\_FRAMES\\
rippDetectID & ... &\\
... & ... & same entries repeated for r, i, z, and y filters \\
ynFrames & ... & \\

\hline
\end{tabular}
\end{center}
\label{table:ipptopspsStackObjectThin}
\end{table}%

\end{document}  
