Index: /trunk/doc/release.2015/ps1.calibration/calibration.tex
===================================================================
--- /trunk/doc/release.2015/ps1.calibration/calibration.tex	(revision 39832)
+++ /trunk/doc/release.2015/ps1.calibration/calibration.tex	(revision 39833)
@@ -88,51 +88,253 @@
 \keywords{Surveys:\PSONE }
 
+\section{Introduction}\label{sec:intro}
+
+\section{Pan-STARRS\,1} 
+
+From May 2010 through March 2014, the Pan-STARRS Science Consortium
+used the 1.8m \PSONE\ telescope to perform a set of wide-field science
+surveys.  These surveys are designed to address a range of science
+goals included the search for hazardous asteroids, the study of the
+formation and architecture of the Milky Way galaxy, and the search for
+Type Ia supernovae to measure the history of the expansion of the
+universe.  
+
+The wide-field \PSONE\ telescope consists of a 1.8~meter diameter
+$f$/4.4 primary mirror with an 0.9~m secondary, producing a 3.3 degree
+field of view \citep{PS1.optics}.  The optical design yields low
+distortion and minimal vignetting even at the edges of the illuminated
+region.  The optics, in combination with the natural seeing, result in
+generally good image quality: 75\% of the images have full-width
+half-max values less than \note{(1.X, 1.X, 1.X, 1.X, 1.X), update}
+arcseconds for (\grizy), with a floor of $\sim 0.7$ \note{update}
+arcseconds.  The \PSONE\ camera \citep{PS1.GPCA} is a mosaic of 60
+edge-abutted $4800\times4800$ pixel back-illuminated \note{name} CCDs
+manufactured by Lincoln Laboratory.  The CCDs have 10~$\mu$m pixels
+subtending 0.258~arcsec and are \note{70um} thick.  The detectors are
+read out using a StarGrasp CCD controller, with a readout time of 7
+seconds for a full unbinned image \citep{PS1.GPCB}.  The active,
+usable pixels cover $\sim 80$\% of the FOV.
+
+Nightly observations are conducted remotely from the Advanced
+Technology Research Center in Kula, the main facility of the
+University of Hawaii's Institute for Astronomy operations on Maui.
+During the \PSONE\ Science Survey, images obtained by the
+\PSONE\ system were stored first on computers at the summit, then
+copied with low latency via internet to the dedicated data analysis
+cluster located at the Maui High Performance Computer Center in Kihei,
+Maui.
+
+Images obtained by \PSONE\ are automatically processed in real time by
+the \PSONE\ Image Processing Pipeline \citep[IPP,][]{PS1.IPP}.
+Real-time analysis goals are aimed at feeding the discovery pipelines
+of the asteroid search and supernova search teams.  The data obtained
+for the \PSONE\ Science Survey has also been used in three additional
+complete re-processing of the data: Processing Versions 1, 2, and 3
+(PV1, PV2, and PV3).  The real-time processing of the data is
+considered ``PV0''.  Except as otherwise noted, the PV3 analysis of
+the data is used for the purpose of this article.
+
+The data processing steps are described in detail by Waters REF and
+Magnier REF.  In summary, individual images are detrended:
+non-linearity and bias corrections are applied, a dark current model
+is subtracted and flat-field corrections are applied.  The \yps-band
+images are also corrected for fringing: a master fringe pattern is
+scaled to match the observed fringing and subtracted.  Mask and
+variance image arrays are generated with the \changed{detrend
+  analysis} and carried forward at each stage of the IPP processing.
+Source detection and photometry are performed for each chip
+independently.  As discussed below, preliminary astrometric and
+photometric calibrations are performed for all chips in a single
+exposure in a single analysis.  
+
+Chip images are geometrically transformed based on the astrometric
+solution into a set of pre-defined pixel grids covering the sky,
+called skycells.  These transformed images are called the warp images.
+Sets of warps for a given part of the sky and in the same filter may
+be added together to generate deeper `stack' images.  PSF-matched
+difference images are generated from combinations of warps and stacks;
+the details of the difference images and their calibration are outside
+of the scope of this article.
+
+% Individual warp images are differenced during the nightly processing
+% to detect the fast moving asteroids.  Stacks are subtracted from
+% individual warps, and deep stacks are subtracted from stack generated
+% from images for a single night (nightly stacks).  
+
+Astronomical objects are detected and characterized in the stacks
+images.  The details of the analysis of the sources in the stack
+images are discussed in Magnier et al REF, but in brief these include
+PSF photometry, along with a range of measurements driven by the goals
+of understanding the galaxies in the images.  Because of the
+significant mask fraction of the GPC1 focal plane, and the varying
+image quality both within and between exposures, the effective PSF of
+the PS1 stack images is highly variable.  The PSF varies significantly
+on scales as small as a few to tens of pixels, making accurate PSF
+modelling essentially infeasible.  The PSF photometry of sources in
+the stack images is thus degraded significantly compared to the
+quality of the photometry measured for the individual chip images.  
+
+To recover most of the photometric quality of the individual chip
+images, while also exploiting the depth afforded by the stacks, the
+PV3 analysis make use of forced photometry on the individual warp
+images.  PSF photometry is measured on the warp images for all sources
+which are detected in the stack images images.  The positions
+determined in the stack images are used in the warp images, but the
+PSF model is determined for each warp independently based on brighter
+stars in the warp image.  The only free parameter for each object is
+the flux, which may be insignificant or even negative for sources
+which are near the faint limit of the stack detections.  When the
+fluxes from the individual warp images are averaged, a reliable
+measurement of the faint source flux is determined.  The details of
+this analysis are described in detail in Magnier et al REF.  
+
+In this article, we discuss the photometric calibration of the
+individual exposures, the stacks, and the warp imags.  We also discuss
+the astrometric calibration of the individual exposures and the stack
+images.
+
+\section{Real-time Calibration}
+
+As images are processed by the data analysis system, every exposure is
+calibrated individually with respect to a photometric and astrometric
+database.  The goal of this calibration step is to generate a preliminary
+astrometric calibration, to be used by the warping analysis to determine
+the geometric transformation of the pixels, and preliminary
+photometric transformation, to be used by the stacking analysis to
+ensure the warps are combined using consistent flux units.
+
+The program used for the real-time calibration, \code{psastro}, loads
+the measurements of the chip detections from their individual
+\code{cmf}-format files.  It uses the header information populated at
+the telescope to determine an initial astrometric calibration guess
+based on the position of the telescope boresite right ascension,
+declination and position angle as reported by the telescope \& camera
+subsystems.  Using the initial guess, \code{psastro} loads astrometric
+and photometric data from the reference database.  
+
+During the course of the PS1SC Survey, several reference databases
+have been used.  For the first 20 months of the survey, \code{psastro}
+used a reference catalog with synthetic PS1 \grizy\ photometry
+generated by the Pan-STARRS IPP team based on based combined
+photometry from Tycho (B, V), USNO (red, blue, IR), and 2MASS $J, H,
+K$.  The astrometry in the database was from 2MASS.  After 2012 May, a
+reference catalog generated from internal re-calibration of the PV0
+analysis of PS1 photometry and astrometry was used for the reference
+catalog.  \note{discuss history of the different refcats?}  
+
+{\bf Astrometric Model in PSASTRO} \code{pasastro} loads the
+coordinates and calibrated magnitudes of stars from the reference
+database.  A model for the positions of the 60 chips in the focal
+plane is used to determine the expected astrometry for each chip based
+on the boresite coordinates and position angle reported by the header.
+Reference stars are selected from the full field of view of the GPC1
+camera, padded by an additional \note{25\%} to ensure a match can be
+determined even in the presence of substantial errors in the boresite
+coordinates.  It is important to choose an appropriate set of
+reference stars: if too few are selected, the chance of finding a
+match between the reference and observed stars is diminished.  In
+addition, since stars are loaded in brightness order, a selection
+which is too small is likely to contain only stars which are saturated
+in the GPC1 images.  On the other hand, if too many reference stars
+are chosen, there is a higher chance of a false-positive match,
+especially as many of the reference stars may not be detected in the
+GPC1 image.  The seletion of the reference stars includes a limit on
+the brightest and fainted magnitude of the stars selected.  
+
+Three somewhat distinct astrometric models are employed within the IPP
+at different stages.  The simplest model is defined independently for
+each chip: a simple TAN projection (Calabretta \& Griesen REF) is used
+to relate sky coordinates to a cartesian tangent-plane coordinate
+system.  \note{include projection math?}  A pair of low-order
+polynomials are used to relate the chip pixel coordinates to this
+tangent-plane coordinate system.  The transforming polynomials are of
+the form:
+\begin{eqnarray}
+P & = & \sum_{i,j} C^P_{i,j} X^i_{\rm chip} Y^j_{\rm chip} \\
+Q & = & \sum_{i,j} C^Q_{i,j} X^i_{\rm chip} Y^j_{\rm chip}
+\end{eqnarray}
+where $P,Q$ are the tangent plane coordinates, $X_{\rm chip}, Y_{\rm
+  chip}$ are the coordinates on the 60 GPC1 chips (\note{see
+  discussion somewhere on cell vs chip}), and $C^P_{i,j}, C^Q_{i,j}$
+are the polynomial coefficients for each order.  In the \code{psastro}
+analysis, $i + j <= N_{\rm order}$ where the order of the fit, $N_{\rm
+  order}$, may be 1 to 3, under the restriction that sufficient stars
+are needed to constraint the order \note{describe a bit better: this
+  is automatically selected based on the number of stars}.  
+
+
+{\bf WCS Keywords} When this polynomial representation is written to
+the output files, a set of WCS keywords are used to define the
+astrometric transformation elements.  It is necessary to 
+\begin{eqnarray}
+P & = & \sum_{i,j} C^P_{i,j} (X_{\rm chip} - X_0)^i (Y_{\rm chip} - Y_0)^j \\
+Q & = & \sum_{i,j} C^Q_{i,j} (X_{\rm chip} - X_0)^i (Y_{\rm chip} - Y_0)^j 
+\end{eqnarray}
+where $X_0, Y_0$ is the reference pixel, represented in the header as 
+
+
+ are functions then related the The astrometric model u
+
+The astrometric analysis is necessarily performed first; after the
+astrometry is determined, an automatic byproduct is a reliable match
+between reference and observed stars, allowing a comparison of the
+magnitudes to determine the photometric calibration.  The astrometric
+calibration is performed in two major stages: first, the chips are
+fitted independently with a low-order model consisting 
+
+
+
+
+\code{smf} 
+
+\section{DVO Description}
+
+
+
+\section{Photometry Calibration}
+
+\subsection{Ubercal Analysis}
 \begin{verbatim}
-Intro
- Pan-STARRS background
- Scope: Source Detection \& Characterization, Galaxy modeling
- Requirements / Goals
- Comparable programs
- PSPhot
-
-Figures which might be interesting:
-
-* kron vs psf star-galaxy separation
-* lensing parameters for star-galaxy separation?
-* color-color locus plots
-* density of stars on the sky vs mag?
-* density of galaxies on the sky
-* good objects vs garbage?
+* data loaded into LSD database (Juric REF) @ CFA (?).  
+* refer to Ubercal paper
+* modifications for PV3 : 2x2 grid, no new flats
+* result is a collection of zero points for photometric images
+  * discuss stats on the zero points and the airmass terms
+\end{verbatim}
+
+\subsection{Relphot Analysis}
+\begin{verbatim}
+* ingest the ubercal zero points (setphot)
+* first pass to determine initial zero points for the full set of exposurse
+* measure the camera-static average correction (high-resolution flat-field residual)
+  * report the pixel scale
+  * discuss the structures
+* second pass to determine final zero points and average photometry
+  * discuss in detail the averaging, clipping strategy, IRLS
+\end{verbatim}
+
+\section{Astrometry Analysis}
+\begin{verbatim}
+* initial astrometry based on real-time calibration
+* relative astrometry calibration of images
+  * bright objects, images
+* first pass to deter
+\end{verbatim}
+
+\section{Systematic Residuals}
+
+\subsection{Camera-Scale Trends}
+
+\section{Discussion}
+
+\section{Conclusion}
+
+\begin{verbatim}
+ Plots:
 * bright-end astrometry residuals
 * bright-end photometry residuals
 * photometry residuals vs camera
 
-in patches, measure dlogN/dmag slope and roll-off (scale?)
-
-chip vs warp vs stack photometry across the sky
-
-color-color plots: g-r,r-i r-i,i-z (the stats from photladder paper)
-
-number of stars @ 20.5
-
-** do these plots in parallel : 
-
 \end{verbatim}
 
-\section{INTRODUCTION}\label{sec:intro}
-
-\section{Pan-STARRS1}
-
-\section{Photometry Analysis}
-
-\section{Astrometry Analysis}
-
-\section{Systematic Residuals}
-
-\subsection{Camera-Scale Trends}
-
-\section{Discussion}
-
-\section{Conclusion}
-
 \end{document}
Index: /trunk/doc/release.2015/systematics.20140411/systematics.tex
===================================================================
--- /trunk/doc/release.2015/systematics.20140411/systematics.tex	(revision 39832)
+++ /trunk/doc/release.2015/systematics.20140411/systematics.tex	(revision 39833)
@@ -17,6 +17,6 @@
 \def\plotext{ps}
 
-\def\picdir{/home/eugene/chipresid.20140404}
-%\def\picdir{/data/pikake.2/eugene/chipresid.20140404}
+%\def\picdir{/home/eugene/chipresid.20140404}
+\def\picdir{/data/kukui.2/eugene/chipresid.20140404}
 
 % Pick a terse version of the title here;
