\documentclass[iop,floatfix]{emulateapj}
% \pdfoutput=1

% see latex.readme.txt for notes on using the PS1 template
%\documentclass[12pt,preprint]{aastex}
%\documentclass[manuscript]{aastex}
%\documentclass[preprint2]{aastex}
%\documentclass[preprint2,longabstract]{aastex}
\RequirePackage{color}
\input{astro.sty}

% online version may use color, but print version needs b/w
\def\plotmode{col}
%\def\plotmode{bw}

%\def\plotext{pdf}
\def\plotext{ps}

%\def\picdir{/home/eugene/chipresid.20140404}
\def\picdir{/data/kukui.2/eugene/chipresid.20140404}

% Pick a terse version of the title here;
\shorttitle{Systematics in PS1}
\shortauthors{E.A. Magnier et al}
\begin{document}
\title{Systematic Effects in Pan-STARRS1 Photometry and Astrometry}

% this is a crude trick to get the order of affiliations right.  These
% names are used in the affiliations below.  The user needs to (1) set
% the order and numbers to have the correct sequence in the author
% list and (2) re-order the list at the bottom (and comment-out as needed)
\def\IfA{1}
\def\CfA{2}
\def\MPIA{3}
\def\Princeton{3}
\def\USNO{4}
\def\JHU{1}

% This example has a first author from UH:
\author{
Eugene A. Magnier,\altaffilmark{\IfA}
J.~L. Tonry, \altaffilmark{\IfA}
D. Finkbeiner,\altaffilmark{\CfA}
E. Schlafly,\altaffilmark{\MPIA}
%PS Builder List
% W.~S. Burgett,\altaffilmark{\IfA}
% K.~C. Chambers,\altaffilmark{\IfA} 
% L. Denneau,\altaffilmark{\IfA}
% P. Draper,\altaffilmark{\DUR}
% H.~A. Flewelling,\altaffilmark{\IfA}
% T. Grav,\altaffilmark{\IfA}
% J. N. Heasley,\altaffilmark{\IfA}
% K. W. Hodapp,\altaffilmark{\IfA}
% M. E. Huber,\altaffilmark{\IfA}
% R. Jedicke,\altaffilmark{\IfA}
% N. Kaiser,\altaffilmark{\IfA}
% R.-P. Kudritzki,\altaffilmark{\IfA}
% G. A. Luppino,\altaffilmark{\IfA}
% R. H. Lupton,\altaffilmark{\Princeton}
% E. A. Magnier,\altaffilmark{\IfA}
% N. Metcalfe,\altaffilmark{\DUH}
% D. G. Monet,\altaffilmark{\USNO}
% J.~S. Morgan,\altaffilmark{\IfA}
% P. M. Onaka,\altaffilmark{\IfA}
% P.~A. Price,\altaffilmark{\Princeton}
% C.~W. Stubbs,\altaffilmark{\CfA}
% W.~E. Sweeney,\altaffilmark{\IfA}
% J.~L. Tonry, \altaffilmark{\IfA}
% R. J. Wainscoat,\altaffilmark{\IfA} and 
% C. Z. Waters,\altaffilmark{\IfA}
} % this bracket terminates author list

% The ordering here should be sequential, matching the sequence in the list of authors:
\altaffiltext{\IfA}{Institute for Astronomy, University of Hawaii, 2680 Woodlawn Drive, Honolulu HI 96822}
\altaffiltext{\CfA}{Harvard-Smithsonian Center for Astrophysics, 60 Garden Street, Cambridge, MA 02138}
% \altaffiltext{\Princeton}{Department of Astrophysical Sciences, Princeton University, Princeton, NJ 08544, USA}
% \altaffiltext{\USNO}{US Naval Observatory, Flagstaff Station, Flagstaff, AZ 86001, USA}
% \altaffiltext{\JHU}{Department of Physics and Astronomy, Johns Hopkins University, 3400 North Charles Street, Baltimore, MD 21218, USA}
\altaffiltext{\MPIA}{Max Planck Institute for Astronomy, K\"onigstuhl 17, D-69117 Heidelberg, Germany}
\begin{abstract}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum
bibendum nisi id tristique posuere. Duis eu mollis nulla. Maecenas est
turpis, mattis tempor urna vitae, placerat rhoncus sem. Lorem ipsum
dolor sit amet, consectetur adipiscing elit. Sed quis velit
nisl. Aliquam erat volutpat. Cras lacinia, nisl tristique auctor
molestie, dolor nulla rhoncus purus, ac accumsan nunc nunc ac
nibh. Maecenas vitae mollis mauris. Ut sollicitudin pulvinar purus,
eget luctus lorem tincidunt vitae. Vestibulum eu mattis neque. Nulla
in tortor id urna dapibus gravida a vel leo.

\end{abstract}

% insert additional keywords as appropriate:
\keywords{Surveys:\PSONE }

\section{INTRODUCTION}\label{sec:intro}

% discuss the science drivers
% summary concept of paper:
%% explore the systematic limitations of PS1
%% connections between astrometric and photometric systematics

\section{Pan-STARRS1}

The Pan-STARRS\,1 telescope (PS1) has recently completed observations
for its first survey mission (REF).  PS1 is 1.8m telescope located on
the summit of Haleakala on the Hawaiian island of Maui (REF).  This
wide-field telescope images a 3.3 degree field of view on a 1.4
gigapixel camera, with low distortion and generally good image quality
(median \approx \note{1.1 arcseconds} in all filters except for g,
with 1.3 arcseconds).  Available filters are \gps,\rps,\ips with
bandpasses similar to the equivalent SDSS filters; \zps is somewhat
bluer than the SDSS $z$, while \yps is somewhat redder (see, REF, for
a complete specification).

The first PS1 science survey mission began 2010 May and completed 31
March 2014.  The bulk of the observing time (56\%) goes to the
``3$\pi$ Survey'', in which the \approx 30,000 square degrees
observable from Hawaii (north of Dec = -30) were repeatedly observed
over the nearly 4 year survey period.  The typical coverage at the end
of the survey is \approx 10 observations per filter per point on the
sky in the 3$\pi$ region.  The repeated observations allows for good
characterization of systematic sources of uncertainty.

The PS1 data will be released to the public in the Spring of 2015 via
the Mikulsky Archive to Space Telescopes (MAST) at the Space Telescope
Science Institute (STScI).

\subsection{GigaPixel Camera\,1}

The PS1 GigaPixel Camera\,1 (GPC1) was the largest astronomical camera
until HypersuprimeCam was completed.  GPC1 is a mosaic camera
consisting of 60 detectors (``chips'') arranged in an 8x8 grid with
the 4 corners missing (FIGURE?).  The detectors in this camera are
othogonal transfer array devices (REF), in which the single silicon
chip is sub-divided into a checkerboard of 64 sub-arrays (``cells'').
Each cell may be independently addressed and read, and the charge
accumulated in the pixels may be moved in either the $x$ or $y$
directions (thus the term ``orthogonal transfer'').  The full GPC1
thus consists of a total of 3840 cells, each \note{608 x 610} pixels.  

\subsection{Data Processing}

Images obtained from PS1 are written to a set of computers located in
the observatory dome (``pixel servers''), and notification is then
sent via a web service to the Image Processing Pipeline (IPP)
computers in Kihei.  The IPP cluster retrieves images from the summit
pixel servers as they are available, though no summit hand-shaking
takes place.  The summit computers have a buffer for data from several
days' of observing so that data is not lost if the link to Kihei is
down or the IPP computer cluster is offline.

Raw images are saved on the IPP cluster and processed as needed.  In
general, every science exposure is processed as soon as possible in a
stream called the ``nightly science processing''.  As the survey has
proceeded and improvements have been made in the analysis software,
images have been reprocessed.  To date (2015 Jan), there have been 2
complete reprocesssing runs (identified PV1 and PV2), and a third
(PV3) is in progress.  As the software has been improved, the nightly
science processing software has been updated to reflect those
improvements.  The nightly science processing thus is heterogenous in
the analysis and algorithms used.  The software for the PVx
reprocessing is more homogenous.

Raw images are stored as multi-extension FITS images, with each cell
in a given chip stored as a separate image extension. The raw data are
generally stored with lossless compression applied to the pixel
arrays \note{CFITSIO REF}.  The data for the 60 chips in a given
exposure are stored as separate FITS files.

The data processing system performs a number of steps distributed
across a cluster of linux-based computers.  The first stage (``chip
processing'') is performed on individual chip image files
independently in parallel.  At this stage, the images are detrended,
including overscan, bias, dark, flat-field, and (for $y$-band)
fringing corrections.  Areas of bad data (e.g., regions of poor charge
transfer efficiency or non-linear dark glows) are masked.  Within the
IPP processing code, masked pixels are identified as non-zero values
in a separate 16-bit mask image, which is then carried as part of the
processed image data products.  The chip analysis also generates a
variance image which is used along with the signal image to specify
the noise properities as a function of pixel.  Details of the
chip-stage processing can be found in \note{Waters et al REF}.

The chip-stage analysis also includes source detection and basic
characterization.  After a sky background model is subtracted from the
image, individual sources are detected via cross-correlation with a
PSF model.  Sources detected in the image are used to define the PSF
model.  Simple aperture based measurements (total flux, 2nd and
higher-order moments, etc) are measured for all detections.  An
estimate of the extendedness (non-PSF-nature) of the sources is used
to distinguish ``stellar'' detections from ``non-stellar'' detections.
Non-stellar detections above a minimum signal-to-noise \note{of 20}
are fitted with a galaxy surface brightness model, while remaining
sources are fitted with a PSF model, or a cluster of PSF models.  The
end result of the chip-stage analysis is a collection of parameters
for each detection, including the positions ($X$, $Y$), PSF model
flux, aperture fluxes, 2nd moments.  Details of the source analysis
and characterization can be found in \note{Magnier et al REF}.

\section{Photometry Analysis}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum
bibendum nisi id tristique posuere. Duis eu mollis nulla. Maecenas est
turpis, mattis tempor urna vitae, placerat rhoncus sem. Lorem ipsum
dolor sit amet, consectetur adipiscing elit. Sed quis velit
nisl. Aliquam erat volutpat. Cras lacinia, nisl tristique auctor
molestie, dolor nulla rhoncus purus, ac accumsan nunc nunc ac
nibh. Maecenas vitae mollis mauris. Ut sollicitudin pulvinar purus,
eget luctus lorem tincidunt vitae. Vestibulum eu mattis neque. Nulla
in tortor id urna dapibus gravida a vel leo.

% refer back to refcat, ubercal, tonry
% discuss the PSF modeling 
% what are the limitations of the current photometric precision

\section{Astrometry Analysis}

Astrometric calibration defines a transformation from the raw
instrumental positions (X,Y on a chip) to RA,DEC coordinates on the
sky.  Astrometry calibration is performed at two separate stages in
the IPP analysis.  First, every exposure is calibrated independently
during the processing by comparison to a reference catalog.  This
astrometric analysis is performed as part of the second processing
stage, the ``camera'' analysis stage.  The output from the chip stage
for all chips in an exposure are processed as a group in this
analysis.  The initial guess for the astrometry comes from the
telescope coordinates provided in the image headers.  

The RA, DEC, and position angle of the telescope boresite are provided
as part of the image metadata.  The telescope and camera systems also
provide WCS header keywords for each chip separately.  However, in the
early stages of the telescope commissioning, these values were not
reliable.  Thus, within the IPP, and model for the camera layout is
used so that the single triplet (RA,DEC,PA) can be used to predict the
astrometric calibration of each chip.  This guess is generally good to
10s of pixels, and need only be accurate to \approx 1/2 of a chip for
the software to discover the true coordinates.

The guess astrometry is used to select a set of likely reference stars
from the reference database.  These stars are the cross-correlated
with the measured source positions to find the likely match between
stars in the reference catalog and detected sources in the image.

Once a reliable match has been determined, astrometric transformations
are determined to match the raw (X,Y) coordinates of the detections to
sky coordinates of the corresponding reference stars.

Within the IPP, two main classes of transformations may be used.  For
single chips from non-mosaic cameras (or for the warp \& stack
skycells), the astrometry calibration consists of a projection from the
celestial sphere to a linearized coordinate system followed by a
transformation from the projection coordiante frame to the pixel
coordinate frame.  The projection may be one of several possible
options (see Calabria et al REF), though in general the IPP uses the
SIN (or TAN) projection (define?).  The transformation from the
projection coordiates to the pixel coordinate may use an afine
transformation or higher order polynomials (up to 3rd order).

For chips from a mosaic camera, the astrometric transformation is
defined as a multi-level operation.  As in single-chip astrometry, a
projection (SIN or TAN) is used to convert the spherical celestial
coordiates to a local linear system (the 'tanget plane' coorinate
system).  There are then two level of cartesian transformations: a
first set of polynomials (up to 3rd order) are used to transform the
tangent plane coordinates to the ``focal plane'' coordinates.  This,
relatively low-order, correction accounts for rotation of the camera
and basic optical distortion coming from the optics and the
atmosphere.  A second transformation is used to convert the focal
plane coordinate to the pixel coordinates for each chip.  For the
on-the-fly calibration, these
transformations may consist of a set of polynomials up
to 3rd order in X and/or Y (i.e, $x^i y^j$ where $i + j <= 3$)

\note{add details on the transformation from focal-plane to tangent
  plane: fit is done on the gradient}.

The on-the-fly astrometric calibration determines the astrometric
transformation to an accuracy of at least 0.3 arcsec (chips with worse
astrometry are rejected).  Data from these images may now be ingested
into our internal database software for astronomical objects, the
Desktop Virtual Observatory \citep[DVO,][]{PS1.IPP}.  This database
software associates detections from images together based on their
positions in the sky to define astrnomical ``objects''.  The database
includes metadata to describe the links between objects and their
multiple detections as well as metadata defining the images and their
astrometric transformations.  

After images have been ingested into the DVO software, calibration
improvements may be made within the database.  A program called
``relastro'' is used to improve the astrometry iterative.  In one
mode, relastro loops between improving the mean positions of objects
and using the improved mean positions to improve the astrometric
calibrations of the images.  In normal usage, relastro is only allowed
to update the chip-to-focal plane transformations; it is not normally
used to improve the focal-plane to tangent plane transformations.
Also, within relastro, the transformation from chip-to-focal plane may
be represented using either the polynomials as above or with a linear
transformation plus bilinear interpolation of a grid of correction
cells.  In the latter case, the grid may be sampled as finely as 6x6
positions per chip.  

% precision demonstration
% koppenhoefer effect
% MISSING: DCR!

\section{Systematic Residuals}

\subsection{Camera-Scale Trends}

\subsection{Tree-Rings : An Example Chip}

\begin{table}
\caption{Systematic Trends : Stdev by filter\label{table:sigmas.by.filter}}
% \tiny
\begin{center}
\begin{tabular}{|l|rrrrr|}
\hline
{\bf Filter} & {\bf psf mags} & {\bf ap mags} & {\bf astrom} & {\bf smear} & {\bf flat} \\
             & mmags         & mmags          & mas          & pixels$^2$  & mmags \\
\hline
\gps & 11.8 & 13 & 8.0  & 0.169 &  3.0 \\ 
\rps & 10.9 & 12 & 6.7  & 0.133 &  2.2 \\
\ips &  8.5 & 10 & 6.0  & 0.069 &  1.7 \\
\zps &  8.7 & 12 & 5.5  & 0.052 &  3.2 \\
\yps & 16.5 & 26 & 6.8  & 0.059 & 15.3 \\
\hline
\end{tabular}
\end{center}
\end{table}

We observe a number of low-level effects in different types of
measurements which have a similar spatial structure on individual
chips.  These structures have a circular pattern centered one corner
of the affected chips.  \note{do all chips show all effects?  is the
  amplitude very different from chip to chip?}  We use measurements
from chip XY40 to illustrate the spatial patterns and relationships
between the different effects.  For all effects, we are measuring the
mean value of the effect in 10x10 pixel boxes.  The resulting images
are all constructed so that a given superpixel represents the same
range of true GPC1 XY40 pixels.  Measurements were extracted from the
``nightly science'' DVO database for observations covering the region
($\alpha$,$\delta$) = (90\degree\ -- 150\degree, -25\degree\ --
10\degree).  This region avoids the Galactic Plane where astrometric
outliers have been more common.  We limit the analysis to good
measurements (PSF\_QF $>$ 0.85) of likely stars ($|m_{psf} - m_{aper}|
< 0.2$).  Only measurements with instrumental magnitude $< -8.0$
($-2.5\log \mbox{cts sec}^{-1} < -8.0$) are include to ensure
reasonable signal-to-noise per measurement.  We require at least 2
measurements in a given filter and 5 measurements total for any star
included in the analysis.

The following four different measurements show tree-ring structures
(a) photometric residuals, (b) astrometric residuals, (c) a portion of
the flat-field structure, and (d) variations in the second-moment of
stars.  In the following section, we show the spatial patterns for
these features and measure their intensity as a function of the
different filters.  By comparing the spatial structures, we show that
these effects are directly related.  We defer for now discussion of
any causes of the observed effects.

\subsubsection{Photometric Residuals}

% PSF Magnitudes
\def\figwidth{2.75in}
\begin{figure*}[htbp]
\begin{center}
\parbox{\figwidth}{\includegraphics[width=\figwidth]{\picdir/dmag.g.\plotext}}
\parbox{\figwidth}{
\caption{PSF Magnitude residuals by Filter
 } \label{fig:psfmags.by.filter}}

\includegraphics[width=\figwidth]{\picdir/dmag.r.\plotext}
\includegraphics[width=\figwidth]{\picdir/dmag.i.\plotext}

\includegraphics[width=\figwidth]{\picdir/dmag.z.\plotext}
\includegraphics[width=\figwidth]{\picdir/dmag.y.\plotext}
\end{center}
\end{figure*}

% Aperture Magnitudes
\def\figwidth{2.75in}
\begin{figure*}[htbp]
\begin{center}
\parbox{\figwidth}{\includegraphics[width=\figwidth]{\picdir/dapmag.g.\plotext}}
\parbox{\figwidth}{
\caption{Aperture Magnitude residuals by Filter
 } \label{fig:apmags.by.filter}}

\includegraphics[width=\figwidth]{\picdir/dapmag.r.\plotext}
\includegraphics[width=\figwidth]{\picdir/dapmag.i.\plotext}

\includegraphics[width=\figwidth]{\picdir/dapmag.z.\plotext}
\includegraphics[width=\figwidth]{\picdir/dapmag.y.\plotext}
\end{center}
\end{figure*}

The tree-ring structure is clearly seen in the PSF magnitude
residuals.  In this case, we select PSF magnitude measurements for
detections which fall in the given superpixel.  We subtract each
measurement from the average magnitude for the object in the selected
filter ($\delta m_{psf} = \overline{m}_{psf} - m_{psf}$) to determine the
residual magnitude, excluding as bad any measurement with $|\delta
m_{psf}| > 0.5$.  For a given superpixel, we measure the median of the
$\delta m_{psf}$ distribution.  Figure~\ref{fig:psfmags.by.filter}
shows the 2D patterns of $\delta m_{psf}$ for each filter (\grizy).
The dynamic range of the color scale is from -20 to +20
millimagnitudes for all 5 plots.  

The tree-ring pattern is clearly visible for the four blue filters,
but finging dominates the pattern for \yps.  Small offsets of
individual cells are also apparent for \zps.  While the patterns are
clear across the image, the signal-to-noise of the structures per
pixel is not very strong in these images.  The per-pixel standard
deviations of these plots is listed in
Table~\ref{table:sigmas.by.filter}.  The per-pixel standard deviation
is comparable to the amplitude of the correlated structures, so we
need to integrate along the radial structures to make stronger
statements about these patterns.

We have also performed the same measurement for aperture magnitudes,
using the same selections.  The 2D patterns for the aperture
magnitudes is shown in Figure~\ref{fig:apmags.by.filter}.  The finging
pattern again dominates the plot for \yps, but the tree-rings are not
seen in any of the filters.  A diagonal pattern is visible in \gps
which is not observed in the PSF magnitudes.  While the per-pixel
scatter is somewhat (10\% to 20\%) higher for these aperture
magnitudes than for the PSF magnitudes
(Table~\ref{table:sigmas.by.filter}), a structure with the amplitude
of the PSF magnitude tree-rings would certainly have been obvious.

\subsubsection{Astrometric Residuals}

% astrometry radial term
\def\figwidth{2.75in}
\begin{figure*}[htbp]
\begin{center}
\parbox{\figwidth}{\includegraphics[width=\figwidth]{\picdir/drad.g.\plotext}}
\parbox{\figwidth}{
\caption{astrometric radial-direction residuals by Filter
 } \label{fig:astrom.by.filter}}

\includegraphics[width=\figwidth]{\picdir/drad.r.\plotext}
\includegraphics[width=\figwidth]{\picdir/drad.i.\plotext}

\includegraphics[width=\figwidth]{\picdir/drad.z.\plotext}
\includegraphics[width=\figwidth]{\picdir/drad.y.\plotext}
\end{center}
\end{figure*}

The tree-ring structure is also clearly seen in the astrometric
residuals.  We use the same selection of measurements for astrometry
as for photometry.  In this case, we extract the residual in both the
RA and DEC directions ($\delta RA = \overline{RA} - RA_i$, $\delta DEC
= \overline{DEC} - DEC_i$) and rotate these values to the chip
coordinate system ($\delta X,\delta Y$).  We again exclude as bad any
measurement with $|\delta X|$ or $|\delta Y| > 0.5$ arcsec before
measuring the median values for each superpixel.  We have determined
the approximate center of the circular tree-ring pattern as (-5,4960)
for this particular chip.  Using this coordinate as the center, we
have converted the $\delta X,\delta Y$ offsets into $\delta R,\delta
\theta$ measurements ($\delta R$ : radial component away from the
center, $\delta \theta$ : tangential component).

Figure~\ref{fig:astrom.by.filter} shows the 2D patterns of $\delta R$
for each filter (\grizy).  The dynamic range of the color scale is
from -20 to +20 milliarcseconds for all 5 plots.  The tree-ring
pattern is visible for all five filters; the finging pattern is not
apparent in the \yps\ astrometry.  \note{low-frequency structures? did
  that take off fringing?}  The per-pixel standard deviations of these
plots is listed in Table~\ref{table:sigmas.by.filter}.  The
signal-to-noise of these structures is again somewhat weak, but the
pattern is clearly visible in these figures.

\subsubsection{Flat-field Structures}

% flat-field residual
\def\figwidth{2.75in}
\begin{figure*}[htbp]
\begin{center}
\parbox{\figwidth}{\includegraphics[width=\figwidth]{\picdir/dflat.g.\plotext}}
\parbox{\figwidth}{
\caption{Flat-field high-frequency structues by Filter
 } \label{fig:flats.by.filter}}

\includegraphics[width=\figwidth]{\picdir/dflat.r.\plotext}
\includegraphics[width=\figwidth]{\picdir/dflat.i.\plotext}

\includegraphics[width=\figwidth]{\picdir/dflat.z.\plotext}
\includegraphics[width=\figwidth]{\picdir/dflat.y.\plotext}
\end{center}
\end{figure*}

The tree-ring structure is also clearly seen in the flat-field
pattern.  For this measurement, we have used a set of monochromatic
flat-field images obtained with a tunable laser.  The laser is used to
illuminate our flat-field screen which is then observed by the PS1
telescope.  These flat-field images were obtained 2011 Feb 09 as part
of a campaign to study the PS1 system response (Tonry et al REF).
Flats were obtain in a set of 4nm steps, with XXnm band-pass.  To
enhance the signal-to-noise, we have combined a set of 6 flats at the
center of the corresponding filter.  \note{high-pass filtering}.  

Figure~\ref{fig:flats.by.filter} shows the remaining high-frequency
structures in the flat-field images.  These flat-field images are
displayed as fractional deviations relative to the median flat-field
image and can thus be compared to the magnitude residuals.  When
flattening an image, these flat-fields would be divided into the flux
of the raw image.  The residuals are thus defined in the sense that a
positive feature in these flats which does {\em not} represent a real
quantum efficiency deviation would induce a {\em reduction} in the
measured flux in those pixels, and thus a {\em negative} deviation in
$\delta m_{psf}$ as defined above.  The dynamic range of the color
scale in these plots is -0.01 to +0.01.  The tree-ring pattern is
strong in the (\gps,\rps,\ips) images, but nearly swamped by fringing
in \zps, and completely lost to finging in \yps.  A diagonal banding
similar to the aperture residuals is seen in \gps.

\subsubsection{Second Moments}

% Smear Images
\def\figwidth{2.75in}
\begin{figure*}[htbp]
\begin{center}
\parbox{\figwidth}{\includegraphics[width=\figwidth]{\picdir/smear.g.\plotext}}
\parbox{\figwidth}{
\caption{Smear by filter
 } \label{fig:smear.by.filter}}
% note that the caption wants to be vertically centered.  I can push it up 
% by padding the end with a big \vspace{1in}

\includegraphics[width=\figwidth]{\picdir/smear.r.\plotext}
\includegraphics[width=\figwidth]{\picdir/smear.i.\plotext}

\includegraphics[width=\figwidth]{\picdir/smear.z.\plotext}
\includegraphics[width=\figwidth]{\picdir/smear.y.\plotext}
\end{center}
\end{figure*}

% Shear Images
\def\figwidth{2.75in}
\begin{figure*}[htbp]
\begin{center}
\parbox{\figwidth}{\includegraphics[width=\figwidth]{\picdir/shear.g.\plotext}}
\parbox{\figwidth}{
\caption{Shear by Filter
 } \label{fig:shear.by.filter}}

\includegraphics[width=\figwidth]{\picdir/shear.r.\plotext}
\includegraphics[width=\figwidth]{\picdir/shear.i.\plotext}

\includegraphics[width=\figwidth]{\picdir/shear.z.\plotext}
\includegraphics[width=\figwidth]{\picdir/shear.y.\plotext}
\end{center}
\end{figure*}

The tree-ring structure is also seen in the changes of the image size.
To measure this effect, we extract the second moments for all
detections, subject to the same selections as for the photometry and
astrometry residuals (good stars, multiple detections).  The second
moments are measured with a Gaussian weighting function, with the
$\sigma_{w}$ scaled by the PSF size so that the $\sigma$ measured for
PSF stars is \approx 60\% of $\sigma_{w}$.  (Note that, since the
measured $\sigma$ of stellar objects is biased down by the weighting
function, this is not quite the same as having $\sigma_{w} = 1.6$
times the true PSF $\sigma$).  For each detection, we measure
$M_{xx,xy,yy} = \sum F_i w_i (x^2, x y, y^2) / \sum F_i w_i$.  For
each exposure, we find the mean second moments for PSF objects and
subtract that mean value from the instantaneous measurements of
$M_{xx,xy,yy}$.  We then determine the median of the residual second
moments for each superpixel.

Figure~\ref{fig:smear.by.filter} shows the spatial trend of the {\em
  smear}, $\sigma^2_{major} + \sigma^2_{minor} = \delta M_{xx} +
\delta M_{yy}$.  This value corresponds to the increase or decrease in
the circularly-symmetric component of the image size.  The dynamic
range of these images is -0.3 to +0.3 pixel$^2$. The tree-ring pattern
is visible for all 5 filters, though \yps is dominated by the fringing
pattern.  Structures with relatively low spatial frequencies can also
be seen.

We can also construct a measurement of the change in ellipticity
$\sigma^2_{major} - \sigma^2_{minor} = (M_{xx} - M_{yy})^2 + 4
M_{xy}$.  This value is plotted in Figure~\ref{fig:shear.by.filter}.
This value is positive definite and is plotted with a color scale
ranging from -0.02 to 0.22 pixel$^2$.  We can also determine the
orientation of the corresponding ellipse.  Overlayed on
Figure~\ref{fig:shear.by.filter} is a set of vectors representing the
ellipse orientation as a function of postion.  The length of the
vectors corresponds to the value of $\sigma^2_{major} -
\sigma^2_{minor}$.  The tree-ring structure is not apparent in this
figure for any filter.  The spatial variations are low-frequency and
unrelated to the radial trend from the upper-left corner.

\subsubsection{Correlations Between Systematic Trends}

\begin{table}
\caption{Systematic Trends : Correlations by filter\label{table:correlation.by.filter}}
% \tiny
\begin{center}
\begin{tabular}{|l|rrrr|}
\hline
{\bf Filter} & {\bf psf mags} & {\bf smear} & {\bf astrom} & {\bf flat} \\
\hline
\gps & 1.00 & 1.00 &  1.00 & 1.00 \\ 
\rps & 0.84 & 0.78 &  0.84 & 0.76 \\
\ips & 0.50 & 0.40 &  0.66 & 0.64 \\
\zps & 0.26 & 0.16 &  0.37 & 0.33 \\
\yps & 0.10 & 0.10 &  0.25 & 0.30 \\
\hline
\end{tabular}
\end{center}
\end{table}

As discussed above, the signal-to-noise per pixel in the plots of the
systematic trends is relatively low (\approx 1.0).  While the tree
rings are apparent in many of these figures, there are also
some other systematic structures which may degrade the signal
further. To quantatatively compare the tree-ring trends between
filters and between systematic effects, we need to measure the
tree-ring structure explicitly and filter out the other effects if
possible.  To do this, we have applied a high-pass filter to all of
the relevant images (PSF Photometry residuals, Astrometric residuals
in the radial direction, flat-field residuals, and second moment smear
terms) to remove unrelated spatial structures.  We have then measured
the median of the signal in radial bins centered on (-5,4960) across
an arc from $\phi$ = -20\degrees\ to -50\degrees (as measured relative
to the top row of the images.  We have selected a small fraction of
the arc to minimize the error associated with the choice of the
pattern center and to avoid several bad cells near the bottom of the
chip.  \note{draw the arcs?}

For a given trend, the systematic effect is strongly correlated
between filters.  The strongest correlation is the smear term:
Figure~\ref{fig:smear.trends} shows the correlation of the smear
pattern between \gps\ and the other four filters. Even \yps\ is
strongly correlated with \gps\ despite the presence of the fringe
pattern.  PSF photometric residuals are also correlated between
filters, as shown in Figure~\ref{fig:psfmag.trends}.  Here, the
\yps\ correlation with \gps\ is quite weak: the fringing pattern
dominates the tree-rings for PSF photometry.  The radial component of
the astrometric residual is also well correlated between filters, with
no loss of correlation due to fringing in \yps. Finally, the
flat-field residuals are generally correlated between filters, but
both \zps\ and \yps\ are affected by fringing.  For \yps, the
correlation is completely washed out by the very strong fringing pattern.

For all four measurements, the slope of the fitted lines are listed in
Table~\ref{table:correlation.by.filter}.  There is a consistency in
the trend from \gps, with the strongest systematic tree-ring effects
to \yps, with the weakest effects.  Note that the second moment smear
and astrometry terms have different relative strength in
\yps\ compared with \gps.  

% smear trends by filter
\def\figwidth{6.5in}
\begin{figure*}[htbp]
\begin{center}
\includegraphics[width=\figwidth]{\picdir/smear.trends.\plotext}
\caption{Smear : correlation between filters
} \label{fig:smear.trends}
\end{center}
\end{figure*}

% psfmag trends by filter
\def\figwidth{6.5in}
\begin{figure*}[htbp]
\begin{center}
\includegraphics[width=\figwidth]{\picdir/psfmag.trends.\plotext}
\caption{PSF magnitude residuals : correlation between filters
} \label{fig:psfmag.trends}
\end{center}
\end{figure*}

% astrom trends by filter
\def\figwidth{6.5in}
\begin{figure*}[htbp]
\begin{center}
\includegraphics[width=\figwidth]{\picdir/astrom.trends.\plotext}
\caption{Astrometry residuals : correlation between filters
} \label{fig:astrom.trends}
\end{center}
\end{figure*}

% flat trends by filter
\def\figwidth{6.5in}
\begin{figure*}[htbp]
\begin{center}
\includegraphics[width=\figwidth]{\picdir/flat.trends.\plotext}
\caption{Flat-field rings : correlation between filters
} \label{fig:flat.trends}
\end{center}
\end{figure*}

An important question is the relationship between the different types
of systematic effects.  Different models for the tree-ring structures
will make different predictions about the correlations between
different effects.  We find the following relationships hold.  First,
the PSF magnitude residuals and the second-moment smear trends are
strongly anti-correlated: regions which have larger PSFs than the mean
tend to have smaller measured PSF fluxes than the mean (note that
$\delta m_{psf}$ is defined so that positive values correspond to
larger fluxes).  These trends are shown in
Figure~\ref{fig:smear.vs.psfmag}.  Second, the radial derivative of
the smear is anti-correlated with the radial component of the
astrometric residuals: $\frac{\partial (\sigma^2_{major} +
  \sigma^2_{minor})}{\partial radius} \sim \delta R$ (see
Figure~\ref{fig:dsmear.vs.astrom}.  Finally, the radial derivative of
the radial component of the astrometric residual is anti-correlated
with the flat-field residual errors: $\frac{\partial \delta
  R}{\partial radius} \sim \delta flat$ (see
Figure~\ref{fig:dastrom.vs.flat}.  This last relationship is somewhat
weakly measured.  Because of the periodic nature of the tree rings, it
is also difficult to completely certain that the flat-field is
proportional to the derivative of the astrometry residual, and not the
other way around.  The correlation is somewhat weaker for derivative
of the flat-field vs astrometry residual.  The correlation is very
weak between the flat-field and the astrometry directly.  We are
convinced that we have the sense of the derivative correct by the
details of specific features.

\begin{table}
\caption{Systematic Trends : Correlations between trends\label{table:correlation.by.trend}}
% \tiny
\begin{center}
\begin{tabular}{|l|rrr|}
\hline
{\bf Filter} & {\bf psf mags} & {\bf $\grad$ smear} & {\bf $\grad$ astrom} \\
             & {\bf vs smear} & {\bf vs astrom}     & {\bf vs flat}        \\
\hline
\gps & -0.056 & -0.060 & -0.47  \\ 
\rps & -0.071 & -0.073 & -0.45  \\
\ips & -0.077 & -0.095 & -0.45  \\
\zps & -0.082 & -0.078 & -0.17  \\
\hline
\end{tabular}
\end{center}
\end{table}

% smear vs psfmag
\def\figwidth{6.5in}
\begin{figure*}[htbp]
\begin{center}
\includegraphics[width=\figwidth]{\picdir/smear.vs.psfmag.\plotext}
\caption{Smear vs PSF mag residuals on the rings
} \label{fig:smear.vs.psfmag}
\end{center}
\end{figure*}

% dsmear vs astrom
\def\figwidth{6.5in}
\begin{figure*}[htbp]
\begin{center}
\includegraphics[width=\figwidth]{\picdir/dsmear.vs.astrom.\plotext}
\caption{gradient of the Smear vs astrometry residuals on the rings
} \label{fig:dsmear.vs.astrom}
\end{center}
\end{figure*}

% dastrom vs flat
\def\figwidth{6.5in}
\begin{figure*}[htbp]
\begin{center}
\includegraphics[width=\figwidth]{\picdir/dastrom.vs.flat.\plotext}
\caption{gradient of the astrometry residuals vs flat-field rings
} \label{fig:dastrom.vs.flat}
\end{center}
\end{figure*}

\section{Discussion}

These trends help to illuminate the underlying causes of these
different effects.  First, we can easily explain the relationship
between the PSF photometry residuals and the observed smear.  In the
photometry analysis, we model the PSF allowing for some spatial
variation in the shape.  However, we limit the 2D variation to a 3x3
grid for each chip: the PSF parameters may vary smoothly across the
chip following the bilinear interpolation between the 3x3 grid points.
Thus, the spatial scale on which we model PSF variations is much
larger than the spatial scale on which PSF variations are apparently
occuring.  When the true PSF is larger than the model PSF, our model
fits systematically underestimate the amount of flux in a given
object.  Conversely, when the PSF is smaller, we overestimate the
flux.  The slope of the trend depends on the mean typical seeing for
the given filter.  For example, the \gps\ seeing is typically
1.3\arcsec, corresponding to a Gaussian $\sigma$ of 2.15 pixels.  A
smearing of $\sigma^2_{major} + \sigma^2_{minor} = 0.1$ pixels$^2$
would increase the size by about 0.02 pixels, or 1\%, so roughly
consistent with the observed photometric deviation of about 5 to 10
millimags for this amount of smearing.  \note{model the 2D effect more
  explicitly}.

Second, the relationship between the flat-field residual and the
astrometric gradient is consistent with radial variations in the
plate-scale.  The tree-rings observed by DES are completely attributed
to effective plate scale changes.  Effective plate scale changes would
result in flat-field deviations since the flat-field illumination is a
source of constant surface brightness.  Pixels see a varying amount of
flux depending on their effective area.  This changing plate scale
also affects the astrometry since these variations occur on spatial
scales much smaller than the astrometric model.  In such a model, the
flat-field deviations are $-1 \times \frac{\partial Pos}{\partial R}$.
The slope of our relationship is \approx 0.5 in normalized units.
Thus the observed trends appear to be too weak by a factor of \approx
2.  \note{looks like a slope of 1.0 would not be excluded by these
  plots}

The fact that the PSF ellipticity changes are {\em not} correlated
with the tree ring structure tells us that the effective plate-scale
changes seen in the flat-field and astrometry signals are not also the
dominant cause of the PSF photometry errors.  Also, the fact that we
do not measure significant aperture photometry errors correlated with
the tree rings confirms this point.  The amplitude of the flat-field
errors are 1-2 millimagnitudes, much smaller than the PSF photometry
errors, and far below the pixel-to-pixel noise in the aperture
magnitudes.

\section{Conclusion}

The tree rings are showing (at least?) two effects, though they must
be related.  First, the images are experiencing circularly-symmetric
changes in the PSF size correlated with the tree-ring pattern.  These
PSF size changes drive errors in the PSF photometry which the are also
correlated with the tree ring pattern on the scale of a few
millimagnitudes.  These PSF size changes are consistent with changes
in the charge diffusion, which also introduces a circularly symmetric
smearing.

In addition, there are radial plate-scale changes
correlated with the tree rings.  These plate-scale changes introduce a
flat-field errors on the scale of \approx 1 millimagnitude and
astrometric errors in the scale of 2-3 milliarcseconds.  The observed
relationship between the flat-field deviations and the radial
derivative of the astrometric deviations confirms that these two
measurements are caused by the same effect.  

There must be some common cause for both the smearing (charge
diffusion) and the radial plate-scale changes since the astrometric
deviations are correlated with the radial derivative of the smearing.

\end{document}
