IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 27, 2018, 3:31:55 PM (8 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/czw_branch/20170908
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20170908

  • branches/czw_branch/20170908/doc/release.2015/ps1.detrend/detrend.tex

    r40081 r40483  
    109109\begin{abstract}
    110110
    111 The Pan-STARRS1 Science Consortium have carried out a set of imaging
    112 surveys using the 1.4 giga-pixel GPC1 camera on the PS1 telescope.  As
     111The Pan-STARRS1 Science Consortium has carried out a set of imaging
     112surveys using the 1.4 gigapixel GPC1 camera on the PS1 telescope.  As
    113113this camera is composed of many individual electronic readouts, and
    114114covers a very large field of view, great care was taken to ensure that
     
    133133the data reduction techniques and the resulting data products. This paper (Paper III)
    134134describes the details of the pixel processing algorithms, including
    135 detrending, warping, and adding (to create stacked images) and subtracting
    136 (to create difference images) and resulting image products and their
     135detrending, warping, adding (to create stacked images), and subtracting
     136(to create difference images), along with the resulting image products and their
    137137properties.
    138138\citet[][Paper I]{chambers2017} provides an overview of the Pan-STARRS System, the
     
    142142%Magnier et al. 2017 (Paper II)
    143143%Pan-STARRS Data Processing Stages
    144 \citet[][Paper II]{magnier2017a}
     144\citet[][Paper II]{magnier2017.datasystem}
    145145describes how the various data processing stages are organized and
    146146implemented
     
    153153%Magnier et al. 2017 (Paper IV)
    154154%Pan-STARRS Pixel Analysis : Source Detection
    155 \citet[][Paper IV]{magnier2017b}
     155\citet[][Paper IV]{magnier2017.analysis}
    156156describes the details of the source detection and photometry, including
    157157point-spread-function and extended source fitting models, and the
     
    159159%Magnier et al. 2017 (Paper V)
    160160%Pan-STARRS Photometric and Astrometric Calibration
    161 \citet[][Paper V]{magnier2017c}
     161\citet[][Paper V]{magnier2017.calibration}
    162162describes the final calibration process, and the resulting photometric and
    163163astrometric quality.
     
    178178
    179179
    180 The Pan-STARRS 1 Science Survey uses the 1.4 giga-pixel GPC1 camera
     180The Pan-STARRS 1 Science Survey uses the 1.4 gigapixel GPC1 camera
    181181with the PS1 telescope on Haleakala Maui to image the sky north of
    182182$-30^\circ$ declination.  The GPC1 camera is composed of 60 orthogonal
    183183transfer array (OTA) devices, each of which is an $8\times{}8$ grid of
    184 readout cells.  This parallelizes the readout process, reducing the
    185 overhead in each exposure.  However, as a consequence of this large
    186 number of individual detector readouts, many calibrations are needed
    187 to ensure the response is consistent across the entire field of view.
    188 
    189 The Processing Version 3 (PV3) reduction represents the third full
    190 reduction of the Pan-STARRS archival data.  The first two reductions
    191 were used internally for pipeline optimization and the development of
    192 the initial photometric and astrometric reference catalog \citep{magnier2017c}.  The
    193 products from these reductions were not publicly released, but have
    194 been used to produce a wide range of scientific papers from the
     184readout cells.  The large number of cells parallelizes the readout
     185process, reducing the overhead in each exposure.  However, as a
     186consequence, many calibration operations are needed to ensure the
     187response is consistent across the entire seven square degree field of
     188view.
     189
     190%The Processing Version 3 (PV3) reduction represents the third full
     191DR1 contains the results of the third full reduction of the Pan-STARRS
     192archival data.  The first two reductions were used internally for
     193pipeline optimization and the development of the initial photometric
     194and astrometric reference catalog \citep{magnier2017.calibration}.
     195The products from these reductions were not publicly released, but
     196have been used to produce a wide range of scientific papers from the
    195197Pan-STARRS 1 Science Consortium members.
    196198
    197199The Pan-STARRS image processing pipeline (IPP) is described elsewhere
    198 \citep{magnier2017a}, but a short summary follows.  The
    199 archive of raw exposures is stored on disk, with a database storing
    200 the metadata of exposure parameters.  For the PV3 processing, large
    201 contiguous regions were defined, and the images for all exposures
    202 within that region launched for the \IPPstage{chip} stage processing.
    203 This stage performs the image detrending (described below in section
     200\citep{magnier2017.datasystem}, but a short summary follows.  The raw
     201image data is stored on the processing cluster, with a database
     202containing the metadata of exposure parameters.  These raw images can
     203be launched for the initial \IPPstage{chip} stage processing.  This
     204stage performs the image detrending (described below in section
    204205\ref{sec:detrending}), as well as the single epoch photometry
    205 \citep{magnier2017b}, in parallel on the individual OTA device data.
    206 Following the \IPPstage{chip} stage is the \IPPstage{camera} stage, in
    207 which the astrometry and photometry for the entire exposure is
    208 calibrated by matching the detections against the reference catalog.
     206\citep{magnier2017.analysis}, in parallel on the individual OTA device
     207data.  Following the \IPPstage{chip} stage is the \IPPstage{camera}
     208stage, in which the astrometry and photometry for the entire exposure
     209is calibrated by matching the detections against a reference catalog.
    209210This stage also performs masking updates based on the now-known
    210211positions and brightnesses of stars that create dynamic features (see
     
    213214\IPPstage{chip} stage images onto common sky oriented images that have
    214215fixed sky projections (Section \ref{sec:warping}).  When all
    215 \IPPstage{warp} stage processing is done for the region of the sky,
     216\IPPstage{warp} stage processing is done for a region of the sky,
    216217\IPPstage{stack} processing is performed (Section \ref{sec:stacking})
    217218to construct deeper, fully populated images from the set of
    218 \IPPstage{warp} images that cover that region of the sky.  Beyond the
    219 \IPPstage{stack} stage, a series of additional stages are done that
    220 are more fully described in other papers.  Transient features are
    221 identified in the \IPPstage{diff} stage, which takes input
    222 \IPPstage{warp} and/or \IPPstage{stack} data and performs image
     219\IPPstage{warp} images that cover that region of the sky.  Transient
     220features are identified in the \IPPstage{diff} stage, which takes
     221input \IPPstage{warp} and/or \IPPstage{stack} data and performs image
    223222differencing (Section \ref{sec:diffs}).  Further photometry is
    224223performed in the \IPPstage{staticsky} and \IPPstage{skycal} stages,
    225224which add extended source fitting to the point source photometry of
    226 objects detected in the \IPPstage{stack} images, and calibrate the
    227 results against the reference catalog.  The \IPPstage{fullforce} stage
    228 takes the catalog output of the \IPPstage{skycal} stage, and uses the
    229 objects detected in that to perform forced photometry on the
     225objects detected in the \IPPstage{stack} images, and again calibrate
     226the results against a reference catalog.  The \IPPstage{fullforce}
     227stage takes the catalog output of the \IPPstage{skycal} stage, and
     228uses the objects detected in that to perform forced photometry on the
    230229individual \IPPstage{warp} stage images.  The details of these stages
    231 are provided in \citet{magnier2017b}.
    232 
    233 The same reduction procedure described above is also performed in real
    234 time on new exposures as they are observed by the telescope.  This
    235 process is largely automatic, with new exposures being downloaded from
    236 the summit to the main IPP processing cluster at the Maui Research and
    237 Technology Center in Kihei, and registered into the processing
    238 database.  This triggers a new \IPPstage{chip} stage reduction for
    239 science exposures, advancing processing upon completion through to the
    240 \IPPstage{diff} stage.  This allows the ongoing solar system moving
    241 object search to identify candidates for follow up observations within
    242 24 hours of the initial set of observations \citep{2015IAUGA..2251124W}.
     230are provided in \citet{magnier2017.analysis}.
     231
     232A limited version of same reduction procedure described above is also
     233performed in real time on new exposures as they are observed by the
     234telescope.  This process is automatic, with new exposures being
     235downloaded from the summit to the main IPP processing cluster at the
     236Maui Research and Technology Center in Kihei, and registered into the
     237processing database.  New \IPPstage{chip} stage reductions are
     238launched for science exposures, advancing processing upon completion
     239through to the \IPPstage{diff} stage, skipping the additional stack
     240and forced warp photometry stages.  This automatic processing allows
     241the ongoing solar system moving object search to identify candidates
     242for follow up observations within 24 hours of the initial set of
     243observations \citep{2015IAUGA..2251124W}.
    243244
    244245Section \ref{sec:detrending} provides an overview of the detrending
    245246process that corrects the instrumental signatures of GPC1, with
    246 details of the construction of those detrends in Section
    247 \ref{sec:detrend construction}.  An analysis of the algorithms used to
    248 complete the \IPPstage{warp} (section \ref{sec:warping}),
     247details of the construction of the reference detrend templates in
     248Section \ref{sec:detrend construction}.  An analysis of the algorithms
     249used to perform the \IPPstage{warp} (section \ref{sec:warping}),
    249250\IPPstage{stack} (section \ref{sec:stacking}), and \IPPstage{diff}
    250 (section \ref{sec:diffs}) stage transformations of the image data to
    251 from the detector frame to a common sky frame, and the co-adding of
    252 those common sky frame images continues after the list of detrend
    253 steps.  Finally, a discussion of the remaining issues and possible
    254 future improvements is presented in section \ref{sec:discussion}.
    255 
    256 Image products presented in figures have been
    257 mosaicked to arrange pixels as follows.  Single cell images are
    258 arranged such that pixel $(1,1)$ is at the lower left corner.  Images
    259 mosaicked to the OTA level have cell xy00 in the lower left corner,
    260 with cells xy10, xy20, etc. sequentially to the right, and cells xy01,
    261 xy02, etc. sequentially to the top of this cell.  Again, pixel $(1,1)$
    262 of cell xy00 is located in the lower left corner of the image.  For
    263 mosaicks of the full field of view, the OTAs are arranged as they see
    264 the sky.  The lower left corner is the empty location where OTA70
    265 would exist.  Toward the right, the OTA labels decrease in $X$ label,
    266 with the empty OTA00 located in the lower right.  The OTA $Y$ labels
    267 increase upward in the mosaic.  The OTAs to the left of the midplane
    268 (OTA4Y-OTA7Y) are oriented with cell xy00 and pixel $(1,1)$ to the
    269 lower left of their position.  Due to the electronic connections of
     251(section \ref{sec:diffs}) stage transformations of the image data
     252follows after the list of detrend steps.  Finally, a discussion of the
     253remaining issues and possible future improvements is presented in
     254section \ref{sec:discussion}.
     255
     256Image products presented in figures have been mosaicked to arrange
     257pixels as follows.  Single cell images are arranged such that pixel
     258$(1,1)$ is at the lower right corner (for example Figure
     259\ref{fig:burntool images}).  This corrects the parity difference
     260between the raw data and the sky.  Images mosaicked to show a full OTA
     261detector are arranged as they are on the focal plane (as in Figure
     262\ref{fig:dark image}.  The OTAs to the left of the midplane
     263(OTA4Y-OTA7Y) are oriented with cell xy00 and pixel $(590,1)$ to the
     264lower right of their position.  Due to the electronic connections of
    270265the OTAs in the focal plane, the OTAs to the right of the midplane
    271266(OTA0Y-OTA3Y) are rotated 180 degrees, and are oriented with cell xy00
    272 and pixel $(1,1)$ to the top right of their position.
     267and pixel $(590,1)$ to the top left of their position. For mosaics of
     268the full field of view, the OTAs are arranged as they see the sky,
     269with the cells arranged as in the single OTA images (Figure \ref{fig:optical ghosts}).  The lower left
     270corner is the empty location where OTA70 would exist.  Toward the
     271right, the OTA labels decrease in $X$ label, with the empty OTA00
     272located in the lower right.  The OTA $Y$ labels increase upward in the
     273mosaic.
    273274
    274275\textit{Note: These papers are being placed on the arXiv.org to
     
    290291level, dark frame subtraction to remove temperature and exposure time
    291292dependent detector glows, and flat field correction to remove pixel to
    292 pixel response functions.  We also construct fringe correction for the
    293 reddest data in the \yps{} filter, to remove the interference patterns that
    294 arise in that filter due to the variations in the thickness of the
    295 detector surface.
    296 
    297 These corrections, however, assume that the detector response is
    298 linear across the full range of values.  This is not universally the
    299 case with GPC1, and this requires an additional set of detrending
    300 steps to remove these non-linear responses.  The first of these is the
    301 \IPPprog{burntool} correction, which removes the persistence trails
    302 caused by the incomplete transfer of charge along the readout columns.
    303 This bright-end nonlinearity is generally only evident for the
    304 brightest stars, as only pixels that are at or beyond the saturation
    305 point of the detector have this issue.  More widespread is the
    306 non-linearity at the faint end of the pixel range.  Some readout cells
    307 and some readout cell edge pixels experience a sag relative to linear
    308 at low illumination, such that faint pixels appear fainter than
    309 expected.  The correction to this requires amplifying the pixel values
    310 in these regions to match the expected model.
    311 
    312 The final non-linear response issue has no good option for correction.
     293pixel response functions.  We also perform fringe correction for the
     294reddest data in the \yps{} filter to remove the interference patterns
     295that arise in that filter due to the variations in the thickness of
     296the detector surface.
     297
     298These corrections assume that the detector response is linear across
     299the full range of values.  This assumption is not universally true for
     300GPC1, and an additional set of detrending steps are required to remove
     301these artifacts.  The first of these is the \IPPprog{burntool}
     302correction, which removes the flux trails left by the incomplete
     303transfer of charge along the readout columns.  These trails are
     304generally only evident for the brightest stars, as only pixels that
     305are at or beyond the saturation point of the detector leave residual
     306charge.  More widespread is the non-linearity at the faint end of the
     307pixel range.  Some readout cells and some readout cell edge pixels
     308experience a sag relative to linear at low illumination, such that
     309faint pixels appear fainter than expected.  The correction to this
     310requires amplifying the pixel values in these regions to match the
     311expected model.
     312
    313313Large regions of some OTA cells experience significant charge transfer
    314314issues, making them unusable for science observations.  These regions
    315315are therefore masked in processing, with these CTE regions making up
    316316the largest fraction of masked pixels on the detector.  Other regions
    317 are masked for other regions, such as static bad pixel features or
    318 temporary readout masking caused by issues in the camera electronics
    319 that make these regions unreliable.  These all contribute to the
    320 detector mask, which is augmented in each exposure for dynamic
     317are masked for reasons such as static bad pixel features or temporary
     318readout masking caused by issues in the camera electronics that make
     319these regions unreliable.  These all contribute to the detector mask,
     320a 16 bit value which records the reason a pixel is masked based on the
     321value added.  This mask is augmented in each exposure for dynamic
    321322features that are masked based on the astronomical features within the
    322323field of view.
    323324
    324325For the PV3 processing, all detrending is done by the
    325 \IPPprog{ppImage} program.  This program applies the detrends to the
    326 individual cells, and then an OTA level mosaic is constructed for the
    327 science image, the mask image, and the variance map image.  The single
    328 epoch photometry is done at this stage as well.  The following
    329 subsections (\ref{sec:burntool} - \ref{sec:background}) detail these
    330 detrending steps, presented in the order in which they are applied to
    331 the individual OTA image data.
    332 
    333 \subsection{Burntool / Persistence effect}
    334 \label{sec:burntool}
    335 
    336 Pixels that approach the saturation point on GPC1, which varies by
    337 readout with common values around 60000 DN, cause persistence problems
    338 on that and subsequent images.  During the read out process of an
    339 image with such a bright pixel, some of the charge associated with it
    340 is not fully shifted down the detector column toward the amplifier.
    341 As a result, this charge remains in the starting cell, and is
    342 partially collected in subsequent shifts, resulting in a ``burn
    343 trail'' that extends from the center of the bright source away from
    344 the amplifier (vertically along the pixel columns toward the top of
    345 the cell).
    346 
    347 This incomplete charge shifting in nearly full wells continues as each
    348 row is read out.  This results in a remnant charge being deposited in
    349 the pixels that the full well was shifted through.  In following
    350 exposures, this remnant charge leaks out, resulting in a trail that
    351 extends from the initial location of the bright source on the previous
    352 image towards the amplifier (vertically down along the pixel column).
    353 This remnant charge can remain on the detector for up to thirty
    354 minutes, requiring the locations of these ``burns'' be retained
    355 between exposures.
    356 
    357 Both of these types of persistence trails are measured and optionally
    358 repaired via the \IPPprog{burntool} program.  This program does an
    359 initial scan of the images, and identifies objects with pixel values
    360 brighter than a conservative threshold of 30000 DN.  The trail from
    361 the peak of that object is fit with a one-dimensional power law in
    362 each pixel column above the threshold, based on empirical evidence
    363 that this is the functional form of this persistence effect.  This
    364 also matches the expectation that a constant fraction of charge is
    365 incompletely transferred at each shift beyond the persistence
    366 threshold.  Once this fit is done, the model can be subtracted from
    367 the image, and the location of the star is stored in a table along
    368 with the exposure PONTIME, which denotes the number of seconds since
    369 the detector was last powered on, and provides an internally consistent
    370 time scale.
    371 
    372 For subsequent exposures, the table associated with the previous image
    373 is read in, and after correcting trails from the stars on the new
    374 image, the positions of the bright stars from the table are used to
    375 check for remnant trails on the image.  These are fit and subtracted
    376 using a one-dimensional exponential model, again based on empirical
    377 studies.  If a significant model is found, then this location is
    378 retained in the image output table.  If not, the old burn is allowed
    379 to expire.
    380 
    381 The main concern with this method of correcting the persistence trails
    382 is that it is based on fits to the raw image data, which may have
    383 other signal sources not determined by the persistence effect.  The
    384 presence of other stars or artifacts along the path of the burn can
    385 result in a poor model to be fit, resulting in either an over- or
    386 under-subtraction of the persistence burn.  For this reason, the image
    387 mask is marked with a value indicating that this correction has been
    388 applied.  These pixels are not fully excluded, but they are marked as
    389 suspect, which allows them to be excluded from consideration in
    390 subsequent stages, such as image stacking.
    391 
    392 Another concern is that the cores of very bright stars are deformed by
    393 this process, as the burntool fitting subtracts flux
    394 from only one side of the star.  As most stars that result in burns already
    395 have saturated cores, they are already ignored for the purpose of
    396 PSF determination and are flagged as saturated by the photometry
    397 reduction.
    398 
    399 \begin{figure}
    400   \centering
    401   \begin{minipage}{0.45\hsize}
    402     \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0123o_XY11_bt_trail.png}
    403 %    \caption{(a)}
    404 %  \end{subfigure}%
    405 %  \begin{subfigure}[]{.45\hsize}
    406   \end{minipage}%
    407   \begin{minipage}{0.45\hsize}
    408     \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0124o_XY11_bt_trail.png}
    409 %    \caption{(b)}
    410 %  \end{subfigure}
    411   \end{minipage}
    412 
    413   \caption{Example of a profile cut along the y-axis through a bright star on exposure o5677g0123o OTA11 in cell xy60 (left panel) and on the subsequent exposure o5677g0124o (right panel).  In both figures, the green points show the image corrected with all appropriate detrending steps, but without burntool applied, illustrating the amplitude of the persistence trails.  The red points show the same data after the burntool correction, which reduces the impact of these features.  Both exposures are in the \gps{} filter with exposure times of 43s}
    414 \end{figure}
    415 
    416 \begin{figure}
    417   \centering
    418   \begin{minipage}{0.45\hsize}
    419     \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0123o_XY11_nobt.png}
    420 %    \caption{(a)}
    421 %  \end{subfigure}%
    422 %  \begin{subfigure}[]{.45\hsize}
    423   \end{minipage}%
    424   \begin{minipage}{0.45\hsize}
    425     \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0124o_XY11_nobt.png}
    426 %    \caption{(b)}
    427 %  \end{subfigure}
    428   \end{minipage}
    429   \begin{minipage}{0.45\hsize}
    430     \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0123o_XY11_bt.png}
    431 %    \caption{(a)}
    432 %  \end{subfigure}%
    433 %  \begin{subfigure}[]{.45\hsize}
    434   \end{minipage}%
    435   \begin{minipage}{0.45\hsize}
    436     \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0124o_XY11_bt.png}
    437 %    \caption{(b)}
    438 %  \end{subfigure}
    439   \end{minipage}
    440   \caption{Example of OTA11 cell xy60 on exposures o5677g0123o (left) and o5677g0124o (right).  The top panels show the image with all appropriate detrending steps, but without burntool, and the bottom show the same with burntool applied.  There is some slight over subtraction in fitting the initial trail, but the impact of the trail is greatly reduced in both exposures.}
    441 \end{figure}
    442 
     326\IPPprog{ppImage} program.  This program applies the detrend
     327corrections to the individual cells, and then an OTA-level mosaic is
     328constructed for the signal image, the mask image, and the variance map
     329image.  The single epoch photometry is done at this stage as well.
     330The following subsections (\ref{sec:overscan} - \ref{sec:background})
     331detail the detrending process used on GPC1 that are common to other
     332detectors.  The GPC1 specific detrending steps are included after,
     333explaining these additional steps that remove the instrument signature.
    443334
    444335\subsection{Overscan}
     
    447338Each cell on GPC1 has an overscan region that covers the first 34
    448339columns of each row, and the last 10 rows of each column.  No light
    449 lands on these pixels, so the image region is trimmed to exclude them.
    450 Each row has an overscan value subtracted, calculated by finding the
    451 median value of that row's overscan pixels and then smoothing between
    452 rows with a three-row boxcar median.
    453 
    454 \subsection{Non-linearity Correction}
    455 \label{sec:nonlinearity}
    456 
    457 The pixels of GPC1 are not uniformly linear at all flux levels.  In
    458 particular, at low flux levels, some pixels have a tendency to sag
    459 relative to the expected linear value.  This effect is most pronounced
    460 along the edges of the detector cells, although some entire cells show
    461 evidence of this effect.
    462 
    463 To correct this sag, we studied the flux behavior of a series of flat
    464 frames for a ramp of exposure times with approximate logarithmically
    465 equal spacing between 0.01s and 57.04s.  As the exposure time
    466 increases, the flux on each pixel also increases in what is expected
    467 to be a linear manner.  Each of these flat exposures in this ramp is
    468 overscan corrected, and then the median is calculated for each cell,
    469 as well as for the rows and columns within ten pixels of the edge of
    470 the science region.  From these median values at each exposure time
    471 value, we can construct the expected trend by fitting a linear model,
    472 $f_{region} = G * t_{exp} + B$, to determine the gain, $G$, and the
    473 bias, $B$, for the region considered.  This fitting was limited to only
    474 the range of fluxes between 12000 and 38000 counts, as these ranges
    475 were found to match the linear model well.  This range avoids the
    476 non-linearity at low fluxes, as well as the possibility of high-flux
    477 non-linearity effects.
    478 
    479 We store the average flux measurement and deviation from the linear
    480 fit for each exposure time for all regions on all detector cells in
    481 the linearity detrend look up tables.  When this is applied to science
    482 data, these lookup tables are loaded, and a linear interpolation is
    483 performed to determine the correction needed for the flux in that
    484 pixel.  This look up is performed for both the row and column of each
    485 pixel, to allow the edge correction to be applied where applicable,
    486 and the full cell correction elsewhere.  The average of these two
    487 values is then applied to the pixel value, reducing the effects of
    488 pixel nonlinearity.
    489 
    490 This non-linearity effect appears to be stable in time for the
    491 majority of the detector pixels, with little evident change over the
    492 survey duration.  However, as the non-linearity is most pronounced at
    493 the edges of the detector cells, those are the regions where the
    494 correction is most likely to be incomplete.  Because of this fact,
    495 most pixels in the static mask with either the DARKMASK or FLATMASK
    496 bit set are found along these edges.  As the non-linearity correction
    497 is unable to reliably restore these pixels, they produce inconsistent
    498 values after the dark and flat have been applied, and are therefore
    499 rejected.
    500 
    501 \begin{figure}
    502   \centering
    503   \includegraphics[width=0.9\hsize,angle=0,clip]{images/linearity_XY27_xy16.png}
    504   \caption{Example plot of the linearity correction as a fraction of observed flux for OTA27, cell xy16.}
    505 \end{figure}
     340lands on these pixels, so the science region is trimmed to exclude
     341them.  Each row has an overscan value subtracted, calculated by
     342finding the median value of that row's overscan pixels and then
     343smoothing between rows with a three-row boxcar median.
    506344
    507345\subsection{Dark/Bias Subtraction}
    508346\label{sec:dark}
    509347
    510 The dark model we make for GPC1 considers each pixel individually,
    511 independent of any neighbors.  To construct this model, we fit a
    512 multi-dimensional model to the array of input pixels from a randomly
    513 selected set of 100-150 overscan and non-linearity corrected dark
    514 frames chosen from a given date range.  The model fits each pixel as a
    515 function of the exposure time $t_{exp}$ and the detector temperature
    516 $T_{chip}$ of the input images such that $\mathrm{dark} = a_0 + a_1
    517 t_{exp} + a_2 T_{chip} t_{exp} + a_3 T_{chip}^2 t_{exp}$.  This
    518 fitting uses two iterations to produce a clipped fit, rejecting at the
    519 $3\sigma$ level.  The final coefficients $a_i$ for the dark model are
    520 stored in the detrend image.  The constant $a_0$ term includes the
    521 residual bias signal after overscan subtraction, and as such, a
    522 separate bias subtraction is not necessary.
     348The dark current in the GPC1 detectors has significant variations
     349across each cell.  The model we make to remove this signal considers
     350each pixel individually, independent of any neighbors.  To construct
     351this model, we fit a multi-dimensional model to the array of input
     352pixels from a randomly selected set of 100-150 overscan and
     353non-linearity corrected dark frames chosen from a given date range.
     354The model fits each pixel as a function of the exposure time $t_{exp}$
     355and the detector temperature $T_{chip}$ of the input images such that
     356$\mathrm{dark} = a_0 + a_1 t_{exp} + a_2 T_{chip} t_{exp} + a_3
     357T_{chip}^2 t_{exp}$.  This fitting uses two iterations to produce a
     358clipped fit, rejecting at the $3\sigma$ level.  The final coefficients
     359$a_i$ for the dark model are stored in the detrend image.  The
     360constant $a_0$ term includes the residual bias signal after overscan
     361subtraction, and as such, a separate bias subtraction is not
     362necessary.
    523363
    524364Applying the dark model is simply a matter of calculating the response
    525 to the exposure time and detector temperature for the image to be
     365for the exposure time and detector temperature of the image to be
    526366corrected, and subtracting the resulting dark signal from the image.
     367Figure \ref{fig:dark image} shows the results of the dark subtraction.
    527368
    528369\subsubsection{Time evolution}
     
    531372significant drift over the course of multiple months.  Some of the
    532373changes in the dark can be attributed to changes in the voltage
    533 settings of the GPC1 controller electronics, but the majority seem to
    534 be the result of some unknown parameter.  We can separate the dark
    535 model history of GPC1 into three epochs.  The first epoch covers all
    536 data taken prior to 2010-01-23.  This epoch used a different header
    537 keyword for the detector temperature, making data from this epoch
    538 incompatible with later dark models.
     374settings of the GPC1 controller electronics, but the causes of others
     375are unknown.  We can separate the dark model history of GPC1 into
     376three epochs.  The first epoch covers all data taken prior to
     3772010-01-23.  This epoch used a different header keyword for the
     378detector temperature, making data from this epoch incompatible with
     379later dark models.  In addition, the temperatures recorded in this
     380value were not fully calibrated, making the dark model generated less
     381reliable.
    539382
    540383The second epoch covers data between 2010-01-23 and 2011-05-01, and is
    541384characterized by a largely stable but oscillatory dark solution.
    542 There are two modes that the dark model switches between apparently at
     385The dark model switches between two modes apparently at
    543386random.  No clear cause has been established for the switching, but
    544387there are clear differences between the two modes that require the
     
    570413
    571414After 2011-05-01, the two-mode behavior of the dark disappears, and is
    572 replaced with a slow observation date dependent drift in the magnitude
     415replaced with a slow observation-date-dependent drift in the magnitude
    573416of the gradient.  This drift is sufficiently slow that we have modeled
    574 it using three observation date independent dark model for different
    575 date ranges.  These darks cover the range from 2011-05-01 to
    576 2011-08-01, 2011-08-01 to 2011-11-01, and 2011-11-01 and on.  The
    577 reason for this time evolution is unknown, but as it is correctable
    578 with a small number of dark models, this does not significantly impact
    579 detrending.
     417it by generating models for different date ranges.  These darks cover
     418the range from 2011-05-01 to 2011-08-01, 2011-08-01 to 2011-11-01, and
     4192011-11-01 and on.  The reason for this time evolution is unknown, but
     420as it is correctable with a small number of dark models, this does not
     421significantly impact detrending.
    580422
    581423\begin{figure}
    582424  \centering
    583 %  \begin{subfigure}[]{.45\hsize}
    584425  \begin{minipage}{0.45\hsize}
    585426    \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0123o_M_OS_NL_XY23_b1.jpg}
    586 %    \caption{(a)}
    587 %  \end{subfigure}%
    588 %  \begin{subfigure}[]{.45\hsize}
    589427  \end{minipage}%
    590428  \begin{minipage}{0.45\hsize}
    591429    \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0123o_to_DARK_XY23_b1.jpg}
    592 %    \caption{(b)}
    593 %  \end{subfigure}
    594430  \end{minipage}
    595   \caption{An example of the dark model application to exposure o5677g0123o, OTA23 (2011-04-26, 43s \gps{} filter).  The left panel shows the image data mosaicked to the OTA level, and has had the static mask applied, the overscan subtracted, and the detector non-linearity corrected.  The right panel, shows the same exposure with the dark applied in addition to the processing shown on the left.}
     431  \caption{An example of the dark model application to exposure o5677g0123o, OTA23 (2011-04-26, 43s \gps{} filter).  The left panel shows the image data mosaicked to the OTA level, and has had the static mask applied, the overscan subtracted, and the detector non-linearity corrected.  The right panel, shows the same exposure with the dark applied in addition to the processing shown on the left, removing the amplifier glows in the cell corners.}
     432  \label{fig:dark image}
    596433\end{figure}
    597434
     
    599436  \centering
    600437  \includegraphics[width=0.9\hsize,angle=0,clip]{images/B_profile_ex.png}
    601   \caption{Example showing a profile cut across exposure o5676g0195, OTA67 (2011-04-25, 43s \gps{} filter).  The entire first row of cells (xy00-xy07) have had a median calculated along each pixel column on the OTA mosaicked image.  Arbitrary offsets have been applied to shift the curves to not overlap.  The top curve (in purple) shows the initial raw profile, with no dark model applied.  The next curve (in green) shows the smoother profile after applying the correct B-mode dark model.  Applying the incorrect A-mode dark results in the blue curve, which shows a significant increase in gradients across the cells.  The orange curve shows the result of the PATTERN.CONTINUITY correction.  Although this creates a larger gradient across the mosaicked images, it decreases the cell-to-cell level changes.  The final yellow curve shows the final image profile after all detrending and background subtraction, and has not had an offset applied.  The bright source at the cell xy00 to xy01 transition is a result of a large optical ghost, which due to the area covered, increases the median level more than the field stars.}
     438  \caption{Example showing a profile cut across exposure o5676g0195, OTA67 (2011-04-25, 43s \gps{} filter).  The entire first row of cells (xy00-xy07) have had a median calculated along each pixel column on the OTA mosaicked image.  Arbitrary offsets have been applied to shift the curves to not overlap.  The top curve (in purple) shows the initial raw profile, with no dark model applied.  The next curve (in green) shows the smoother profile after applying the appropriate B-mode dark model.  Applying the A-mode dark instead results in the blue curve, which shows a significant increase in gradients across the cells.  The orange curve shows the result of the PATTERN.CONTINUITY correction.  Although this creates a larger gradient across the mosaicked images, it decreases the cell-to-cell level changes.  The final yellow curve shows the final image profile after all detrending and background subtraction, and has not had an offset applied.  The bright source at the cell xy00 to xy01 transition is a result of a large optical ghost, which due to the area covered, increases the median level more than the field stars.}
    602439  \label{fig:dark switching}
    603440\end{figure}
     
    606443\label{sec:video_darks}
    607444
    608 The dark signal is stronger in cell corners due to glow from the
    609 read-out amplifiers.  The standard dark model corrects this for most
    610 observations.  However, as mentioned above, when a cell is repeatedly
    611 read in video mode, the dark model for the OTA containing it changes.
    612 Surprisingly, added reads for the video cell do not amplify the
    613 amplifier glow, but rather decrease the dark signal in these regions.
    614 As a result, using the standard dark model on the data for these OTAs
    615 results in oversubtraction of the corner glow.
    616 
    617 Video darks have been constructed to eliminate the effect this
    618 observational change has on the final image quality.  This was done by
    619 running the standard dark construction process on a series of dark
    620 frames that have had the video signal enabled for some cells.  GPC1
    621 can only run video signals on a subset of the OTAs at a given time.
    622 This requires two passes to enable the video signal across the full
    623 set of OTAs that support video cells.  This is convenient for the
    624 process of creating darks, as those OTAs that do not have video
    625 signals enabled create standard dark models, while the video dark is
    626 created for those that do.
     445Individual cells on GPC1 can be repeatedly read to create a video
     446signal used for telescope guiding.  However, when a cell is used for
     447this purpose, the dark signal for the entire OTA is changed.  The most
     448noticeable feature of this change is that the glows in cell corners
     449caused by the read-out amplifiers are suppressed.  As a result, using
     450the standard dark model on the data for these OTAs results in
     451oversubtraction of the corner glow.
     452
     453To generate a correction for this change, a set of video dark models
     454were created by running the standard dark construction process on a
     455series of dark frames that had the video signal enabled for some
     456cells.  GPC1 can only run video signals on a subset of the OTAs at a
     457given time.  This requires two passes to enable the video signal
     458across the full set of OTAs that support video cells.  This is
     459convenient for the process of creating darks, as those OTAs that do
     460not have video signals enabled create standard dark models, while the
     461video dark is created for those that do.
    627462
    628463This simultaneous construction of video and standard dark models is
    629 useful, as it provides the ability to isolate the response on the
    630 standard dark from the video signals.  Isolating this response is
    631 essential for attempting to create archival video darks.  We only have
    632 raw video dark frame data after 2012-05-16, when this problem was
    633 initially identified, so any data prior to that can not be directly
    634 corrected for the video dark signal.  Isolating the video signal
    635 response allows linear corrections to the pre-existing standard dark
    636 models for archival data.  Testing this shows that constructing a
    637 video dark for older data simply as $VD_{2009} = D_{2009} - D_{Modern}
    638 + VD_{Modern}$ produces a satisfactory result that does not
    639 over subtract the amplifier glow.  This is shown in figure
    640 \ref{fig:video_darks}, which shows video cells from before 2012-05-16,
    641 corrected with both the standard and video darks, with the early video
    642 dark constructed in such a manner.
     464useful, as it provides a way to isolate the response on the standard
     465dark from the video signals.  If the standard and video dark signals
     466are separable, then archival video darks can be constructed by
     467applying the video dark response to the previously constructed dark
     468models.  Raw video dark frame data only exists after 2012-05-16, when
     469this problem was initially identified, so any data prior to that can
     470not be directly corrected for the video dark signal.  Testing the
     471separability shows that constructing a video dark for older data
     472simply as $VD_{Old} = D_{Old} - D_{Modern} + VD_{Modern}$ produces a
     473satisfactory result that does not over subtract the amplifier glow.
     474This is shown in figure \ref{fig:video_darks}, which shows video cells
     475from before 2012-05-16, corrected with both the standard and video
     476darks, with the early video dark constructed in such a manner.
    643477
    644478\begin{figure}
    645479  \centering
    646 %  \begin{subfigure}[]{.45\hsize}
    647480  \begin{minipage}{0.45\hsize}
    648481    \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0123o_VIDEODARK_VDim_Rdark_XY22_b1.jpg}
    649 %    \caption{(a)}
    650 %  \end{subfigure}%
    651 %  \begin{subfigure}[]{.45\hsize}
    652482  \end{minipage}%
    653483  \begin{minipage}{0.45\hsize}
    654484    \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0123o_VIDEODARK_VDim_VDdark_XY22_b1.jpg}
    655 %    \caption{(b)}
    656 %  \end{subfigure}
    657485  \end{minipage}
    658486  \caption{An example of the video dark model application to exposure o5677g0123o, OTA22 (2011-04-26, 43s \gps{} filter), which has a video cell located in cell xy16.  The left panel shows the image data mosaicked to the OTA level, and has had the static mask applied, the overscan subtracted, the detector non-linearity corrected, and a regular dark applied.  The right panel, shows the same exposure with a video dark applied instead of the standard dark.  The main impact of this change is the improved correction of the corner glows, which are over subtracted with the standard dark.}
     
    664492
    665493Based on a study of the positional dependence of all detected sources,
    666 we have discovered that the cells in GPC1 do not have uniform noise
     494we discovered that the cells in GPC1 do not have uniform noise
    667495characteristics.  Instead, there is a gradient along the pixel rows,
    668496with the noise generally higher away from the read out amplifier
    669497(higher cell x pixel positions).  This is likely an effect of the
    670 row-by-row bias issue discussed below.  This gradient causes the read
    671 noise to increase as the row is read out.  As a result of this
     498row-by-row bias issue discussed below.  As a result of this
    672499increased noise, more sources are detected in the higher noise regions
    673 when the read noise is assumed constant across the readout.  Read noise is the
    674 
    675 To
    676 mitigate this noise gradient, we constructed an initial set of
    677 noisemap images by measuring the median variance on bias frames.  The
    678 variance is calculated in boxes of 20x20 pixels, and then linearly
    679 interpolated to cover the full image.
     500when the read noise is assumed constant across the readout. 
     501
     502To mitigate this noise gradient, we constructed an initial set of
     503noisemap images by measuring the median variance on bias frames
     504processed as science images.  The variance is calculated in boxes of
     50520x20 pixels, and then linearly interpolated to cover the full image.
    680506
    681507Unfortunately, due to correlations within this noise, the variance
     
    689515contaminating the final object catalogs.
    690516
    691 In the detection process, we expect false positives at a rate equal to
    692 the one-tailed probability beyond the detection threshold.  For these
    693 tests, only detections measured at the $\sigma_{thresh} = 5\sigma$
    694 level are used, to match that used in the photometry on science data.
    695 This probability can be converted into a number of false number by
    696 considering a given area.  As the detections must be isolated to not
    697 be detected as an extended object, this area must be reduced by the
    698 area a given PSF occupies.  Combining this, we find that we expect a
    699 probability $P = 1 - \Phi_{normal}(5) = \frac{1}{2}
    700 \erfcinv\left(\frac{5}{\sqrt{2}}\right)$, and an area given $N$
    701 exposures of area $X\times Y$, $A = \frac{X \times Y \times
    702   N}{A_{PSF}}$.  For a typical $1"$ seeing, $A_{PSF}$ is approximately
    703 16 pixels.  Using this model for the false positives, we found that
    704 the added read noise was insufficient to account for the observed
    705 false positive rate.  Inverting this relation, we can measure
    706 $\sigma_{obs}$, the true threshold level based on the number of false
    707 positives observed.  This $\sigma_{obs}$ is the combined to form a
    708 boost factor $B = \sigma_{thresh} / \sigma_{obs}$ that amplifies the
    709   noisemap to match the observed false detection rate.
    710 
    711 The row-to-row variations that contribute to the extra noise are
    712 related to the dark model, and because of this, as the dark model
    713 changes, the effective noise also changes.  To ensure that the
    714 noisemap accurately matches the true noise level, we have created
    715 different noisemap models for the three major time ranges of the dark
    716 model.  We do not see any strong evidence that the noisemaps have the
    717 A/B modes visible in the dark, and so we do not generate different
    718 models for each individual dark model.  The additional pixel-to-pixel
    719 variance from this noisemap is added to the Poissonian variance to
    720 form the science variance image generated by the \IPPstage{chip}
    721 processing.
     517In the detection process, we expect false positives at a low rate,
     518given that all sources are required to be significant at the $5\sigma$
     519level.  Since the observed false positive rate was significantly
     520higher than expected, we implemented an empirical ``boost'' to
     521increase the noisemap to more accurately account for the position
     522dependent read noise.  By binning the number of false positives
     523measured on the bias frames on the noisemap inputs using 20 pixel
     524boxes in the cell x-axis, and comparing this to the number expected
     525from random Gaussian noise, we estimated the true read noise level.
     526
     527As the noisemap uses bias frames that have had a dark model
     528subtracted, we constructed noisemaps for each dark model used for
     529science processing.  There is some evidence that the noise has changed
     530over time as measured on full cells, so matching the noisemap to the
     531dark model allows for these changes to be tracked.  There is no
     532evidence that the noisemap has the A/B modes found in the dark, so we
     533do not generate separate models for that time period.
     534
     535The noisemap detrend is not directly applied to the science image.
     536Instead, it is used to construct the weight image that contains the
     537pixel-by-pixel variance for the \IPPstage{chip} stage image.  The
     538initial weight image is constructed by dividing the science image by
     539the cell gain (approximately 1.0 e$^{-} /$ DN).  This weight image
     540contains the expected Poissonian variance in electrons measured.  The
     541square of the noisemap is then added to this initial weight, adding
     542the additional empirical variance term in place of a single read noise
     543value.
    722544
    723545\subsection{Flat}
     
    736558correction to remove the effect of the illumination differences over
    737559the detector surface.  This is done by dithering a series of science
    738 exposures with a given pointing.  By fully calibrating these exposures
     560exposures with a given pointing, as described in
     561\citet{2004PASP..116..449M}.  By fully calibrating these exposures
    739562with the initial flat model, and then comparing the measured fluxes
    740563for the same star as a function of position on the detector, we can
     
    748571In addition to this flat field applied to the individual images, the
    749572ubercal process used to calibrate the database of all detections
    750 \citep{2012ApJ...756..158S} constructs internal ``flat field'' corrections.
    751 Although a single set of image flat fields was used for the entire PV3
    752 survey, five separate ``seasons'' of database flat fields were needed
    753 to ensure proper calibration.  This indicates that the flat field
    754 response is not completely fixed in time.  More details on this
    755 process are contained in \citet{magnier2017c}.
    756 
    757 \subsection{Pattern correction}
    758 \label{sec:pattern}
    759 
    760 Due to detector specific issues that are not cleanly removed by the
    761 dark model, we have a set of ``pattern'' corrections that are applied
    762 to some selection of the OTAs in the camera.  This is done to reduce
    763 the effect that detector differences have on the measured astronomical
    764 signal that are not stable enough to be corrected with a static model.
    765 Because of this, the pattern corrections attempt to identify and
    766 correct the detector issues based on appropriate filtering the
    767 individual science exposures.
    768 
    769 The PATTERN.ROW correction is used to remove any remaining row-by-row
    770 bias variation, and the PATTERN.CONTINUITY correction attempts to
    771 ensure that the cells of a given OTA are consistent with the other
    772 cells on that OTA.
    773 
    774 \subsubsection{Pattern Row}
    775 %% Statistics so I have them written down somewhere
    776 %% chipProcessedImfile.bg/bg_stdev by filter for XY33 (a good chip)
    777 %% filter  bg_mean stdev median Qsig                              bg_stdev_mean stdev median Qsig
    778 %% g        36.37422026669   64.64175104057  32.693   6.10284     14.696938349131  78.80460307171  8.8401  0.5417843
    779 %% r       200.96143304525  471.87743546238 117.105  94.55608     33.854672792146  79.01642728089 13.4564  5.3771355
    780 %% i       447.00504994458  938.38517801037 286.810 154.71397     57.298335510188  99.38392923935 20.0217 24.2254723
    781 %% z       317.54933679054  390.38930252748 241.014 114.13316     48.359069000176  94.44452756094 17.9404  9.1535209
    782 %% y       371.09019536218  293.57439970375 288.481 133.38769     43.724342221691 135.04286534327 19.9029  7.5396461
    783 
    784 As discussed above in the dark and noisemap sections, certain
    785 detectors have significant bias offsets between adjacent rows, caused
    786 by noise in the camera control electronics.  The magnitude of these
    787 offsets increases as the distance from the readout amplifier
    788 increases, resulting in horizontal streaks that are more pronounced
    789 along the large x pixel edge of the cell.  As the level of the offset
    790 is apparently random between exposures, the dark correction cannot
    791 fully remove this structure from the images, and the noisemap value
    792 only indicates the level of the average variance added by these bias
    793 offsets.  Therefore, we apply the PATTERN.ROW correction in an attempt
    794 to mitigate the offsets and correct the image values.  To force the
    795 rows to agree, a second order clipped polynomial is fit to each row in
    796 the cell.  Four fit iterations are run, and pixels $2.5\sigma$ deviant
    797 are excluded from subsequent fits, to minimize the effect stars and
    798 other astronomical signals have.  This final trend is then subtracted
    799 from that row.  Simply doing this subtraction will also have the
    800 effect of removing the background sky level.  To prevent this, the
    801 constant and linear terms for each row are stored, and linear fits are
    802 made to these parameters as a function of row, perpendicular to the
    803 initial fits.  This produces a plane that is added back to the image
    804 to restore the background offset and any linear ramp that exists in
    805 the sky.
    806 
    807 These row-by-row variations have the largest impact on data taken in
    808 the \gps{} filter, as the read noise is the dominant noise source in
    809 that filter.  At longer wavelengths, the noise from the Poissonian
    810 variation in the sky level increases.  Although the PATTERN.ROW correction is still applied to data taken in the other filters,
    811 
    812 This correction was required on all cells on all OTAs prior to
    813 2009-12-01, at which point a modification of the camera electronics
    814 reduced the scale of the row-by-row offsets for the majority of the
    815 OTAs.  As a result, we only apply this correction to the cells where
    816 it is still necessary, as shown in Figure \ref{fig: pattern row
    817   cells}.  A list of these cells is listed in Table
    818 \ref{tab:pattern_row_cells}.
    819 
    820 Although this correction does largely resolve the row-by-row offset
    821 issue in a satisfactory way, large and bright astronomical objects can
    822 bias the fit significantly.  This results in an oversubtraction of the
    823 offset near these objects.  As the offsets are calculated on the pixel
    824 rows, this oversubtraction is not uniform around the object, but is
    825 preferentially along the horizontal x axis of the object.  Most
    826 astronomical objects are not significantly distorted by this, with
    827 this only becoming on issue for only bright objects comparable to the
    828 size of the cell (598 pixels = 150").
    829 
    830 \begin{deluxetable}{lcccc}
    831   \tablecolumns{3}
    832   \tablewidth{0pc}
    833   \tablecaption{Cells which have PATTERN.ROW correction applied}
    834   \tablehead{\colhead{OTA} & \colhead{Cell columns} & \colhead{Additional cells}}
    835   \startdata
    836   OTA11 &  & xy02, xy03, xy04, xy07 \\
    837   OTA14 &  & xy23 \\
    838   OTA15 & 0 & \\
    839   OTA27 & 0, 1, 2, 3, 7 & \\
    840   OTA31 & 7 & \\
    841   OTA32 & 3, 7 & \\
    842   OTA45 & 3, 7 & \\
    843   OTA47 & 0, 3, 5, 7 & \\
    844   OTA57 & 0, 1, 2, 6, 7 & \\
    845   OTA60 &  & xy55 \\
    846   OTA74 & 2, 7 & \\
    847   \enddata
    848   \label{tab:pattern_row_cells}
    849 \end{deluxetable}
    850 
    851 \begin{figure}
    852   \centering
    853   \includegraphics[width=0.9\hsize,angle=0,clip]{images/pattern_row_edit.png}
    854   \caption{Diagram illustrating in red which cells on GPC1 require the PATTERN.ROW correction to be applied.  The footprint of each OTA is outlined, and cell xy00 is marked with either a filled box or an outline.  The labeling of the non-existent corner OTAs is provided to orient the focal plane.}
    855   \label{fig: pattern row cells}
    856 \end{figure}
    857 
    858 \begin{figure}
    859   \centering
    860   \begin{minipage}{0.45\hsize}
    861     \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5379g0103o_XY57_nopat.png}
    862 %    \caption{(a)}
    863 %  \end{subfigure}%
    864 %  \begin{subfigure}[]{.45\hsize}
    865   \end{minipage}%
    866   \begin{minipage}{0.45\hsize}
    867     \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5379g0103o_XY57_pat.png}
    868 %    \caption{(b)}
    869 %  \end{subfigure}
    870   \end{minipage}
    871   \caption{Example of the PATTERN.ROW correction on exposure o5379g0103o OTA57 cell xy00 (\ips{} filter 45s).  The left panel shows the cell with all appropriate detrending except the PATTERN.ROW, and the right shows the same cell with PATTERN.ROW applied.  The correction reduces the correlated noise on the right side, which is most distant from the read out amplifier.  There is a slight over subtraction along the rows near the bright star.}
    872 \end{figure}
    873 
    874 \subsubsection{Pattern Continuity}
    875 
    876 After previous attempts to ensure that adjacent cells on an OTA
    877 matched background levels were insufficient in many situations, we
    878 designed a replacement correction that would reduce the background
    879 distortion for large objects.  In addition, studies of the background
    880 level illustrated that the row-by-row bias can introduce small
    881 background gradient variations along the rows of the cells that is not
    882 stable enough to be completely fit by the dark model.  This common
    883 feature across the columns of cells results in a ``saw tooth'' pattern
    884 horizontally across an OTA, and as the background model fits a smooth
    885 sky level, this induces over and under subtraction at the cell
    886 boundaries. 
    887 
    888 The PATTERN.CONTINUITY correction, attempts to match the edges of a
    889 cell to those of its neighbors.  For each cell, a thin box 10 pixels
    890 wide on each edge is extracted and the median value of unmasked values
    891 calculated for that box.  These median values are then used to
    892 construct a vector of differences $\Delta_i = \sum_{j} \mathrm{Edge}_{i} -
    893 \mathrm{Edge}_{j}$, along with a matrix of associations $A_{i,i'} = \sum_{j}
    894 \delta(i,j) \delta(j,i')$ denoting which cell boundaries are adjacent.
    895 By solving the system $A x = \Delta$, we find the set of offsets $x_i$
    896 to be applied to each cell to ensure the minimum differences between
    897 all cell edges and their neighbors.
    898 
    899 For OTAs that initially show the saw tooth pattern, the effect of this
    900 correction is to align the cells into a single ramp, at the expense of
    901 the absolute background level.  However, as we subtract off a smooth
    902 background model prior to doing photometry, these deviations from an
    903 absolute sky level are unimportant.  The fact that the final ramp is
    904 smoother than it would be otherwise also allows for the background
    905 subtracted image to more closely match the astronomical sky, without
    906 significant errors at cell boundaries.  An example of the effect of
    907 this correction on an image profile is shown in Figure \ref{fig:dark switching}.
    908 
     573\citep{2012ApJ...756..158S} constructs ``in catalog'' flat field
     574corrections.  Although a single set of image flat fields was used for
     575the entire PV3 survey, five separate ``seasons'' of database flat
     576fields were needed to ensure proper calibration.  This indicates that
     577the flat field response is not completely fixed in time.  More details
     578on this process are contained in \citet{magnier2017.calibration}.
    909579
    910580\subsection{Fringe correction}
     
    928598input images with two iteration of clipping at the $3\sigma$ level.
    929599
    930 A course background model for each cell is constructed by calculating
     600A coarse background model for each cell is constructed by calculating
    931601the median on a 3x3 grid (approximately 200x200 pixels each).  A set
    932 of 1000 randomly selected points are then selected on the fringe image
    933 for each cell, and a median calculated for this position in a 10x10
    934 pixel box, with the background level subtracted.  These sample
    935 locations provide scale points to allow the amplitude of the measured
    936 fringe to be compared to that found on science images.
     602of 1000 points are randomly selected from the fringe image for each
     603cell, and a median calculated for this position in a 10x10 pixel box,
     604with the background level subtracted.  These sample locations provide
     605scale points to allow the amplitude of the measured fringe to be
     606compared to that found on science images.
    937607
    938608To apply the fringe, the same sample locations are measured on the
     
    962632\label{sec:static_masks}
    963633
    964 Due to the large size of the detector, it is expected that there
    965 are a number of pixel defects that do not have the detection
    966 sensitivity on par with their neighbors.  To remove these pixels, we
    967 have constructed a static mask that identifies the known defects.
    968 This mask is constructed in three phases.
    969 
    970 First, a CTEMASK is constructed to mask out regions in which the
    971 charge transfer efficiency is low compared to the rest of the
    972 detector.  Twenty-five of the sixty OTAs in GPC1 show some evidence of
    973 CTE issues, with this pattern appearing (to varying degrees) in
    974 roughly triangular patches on the OTA due to defects in the
    975 semiconductor manufacturing.  To generate the mask for these regions,
    976 a sample set of 26 evenly illuminated flat field images were measured
    977 to produce a map of the image variance in 20x20 pixel bins.  As the
    978 flat image is expected to illuminate the image uniformly, the expected
    979 variances in each bin should be Poissonian distributed with the flux
    980 level.  However, in regions with CTE issues, adjacent pixels are not
    981 independent, as the charge in those pixels is more free to spread.
    982 This reduces the pixel-to-pixel differences, resulting in a lower than
    983 expected variance.  All regions with variance less than half the
    984 average image level are added to the static CTEMASK.
     634Due to the large size of the detector, it is expected that there are a
     635number of pixels that respond poorly.  To remove these pixels, we have
     636constructed a mask that identifies the known defects.  This mask is
     637referred to as the ``static'' mask, as it is applied to all images
     638processed.  The ``dynamic'' mask (Section \ref{sec:dynamic_masks}) is
     639calculated based on objects in the field, and so changes between
     640images.  Construction of the static mask consists of three phases.
     641
     642First, regions in which the charge transfer efficiency (CTE) is low
     643compared to the rest of the detector are identified.  Twenty-five of
     644the sixty OTAs in GPC1 show some evidence of poor CTE, with this
     645pattern appearing (to varying degrees) in roughly triangular patches.
     646During the manufacture of the devices, an improperly tuned
     647semiconductor process step resulted in a radial pattern of poor
     648performance on some silicon wafers.  When the OTAs were cut from these
     649wafers, the outer corners exhibited the issue.  To generate the mask
     650for these regions, a sample set of 26 evenly-illuminated flat-field
     651images were measured to produce a map of the image variance in 20x20
     652pixel bins.  As the flat screen is expected to illuminate the image
     653uniformly on this scale, the expected variances in each bin should be
     654Poissonian distributed with the flux level.  However, in regions with
     655poor CTE, adjacent pixels are not independent, as the charge in those
     656pixels is more free to spread along the image columns.  This reduces
     657the pixel-to-pixel differences, resulting in a lower than expected
     658variance.  All regions with variance less than half the average image
     659level are added to the static mask.
     660
    985661
    986662The next step of mask construction is to examine the flat and dark
     
    998674removing the pixels that cannot be corrected to a linear response.
    999675
     676% http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/StaticMasks20101215
    1000677The final step of mask construction is to examine the detector for
    1001678bright columns and other static pixel issues.  This is first done by
     
    1020697  \centering
    1021698  \includegraphics[width=0.9\hsize,angle=0,clip]{images/gpc1_mask_indexed.png}
    1022   \label{fig:static mask}
    1023699 
    1024700  \caption{Image map of the GPC1 static mask.  The CTE regions are clearly visible as roughly triangular patches covering the corners of some OTAs.  Some entire cells are masked, including an entire column of cells on OTA14.  Calcite cells remove large areas from OTA17 AND OTA76.}
     701  \label{fig:static mask}
    1025702\end{figure}
    1026703
     
    1060737nature, and do not completely exclude the pixel from further
    1061738processing consideration.  The first of these dynamic masks is the
    1062 burntool advisory mask mentioned above.  These pixels are included for
     739burntool advisory mask described below.  These pixels are included for
    1063740photometry, but are rejected more readily in the stacking and
    1064741difference image construction, as they are more likely to have small
    1065742deviations due to imperfections in the burntool correction.
    1066743
    1067 The remaining dynamic masks are not generated until the IPP
    1068 \IPPstage{camera} stage, at which point all object photometry is
    1069 complete, and an astrometric solution is known for the exposure.  This
    1070 added information provides the positions of bright sources based on
    1071 the reference catalog, including those that fall slightly out of the
     744The remaining dynamic masks are generated in the IPP \IPPstage{camera}
     745stage, at which point all object photometry is complete, and an
     746astrometric solution is known for the exposure.  This added
     747information provides the positions of bright sources based on the
     748reference catalog, including those that fall slightly out of the
    1072749detector field of view or within the inter chip gaps, where internal
    1073750photometry may not identify them.  These bright sources are the origin
     
    1083760Table \ref{tab:crosstalk_rules} summarizes the list of known crosstalk
    1084761rules, with an estimate of the magnitude difference between the source
    1085 and ghost.  For all of the rules, any cell $v$ within the specified
     762and ghost.  For all of the rules, any source cell $v$ within the specified
    1086763column of cells on any of the OTAs in the specified column of OTAs $Y$
    1087 creates the ghost in the same $v$ and $Y$ in the target column of
     764can create a ghost in the same cell $v$ and OTA $Y$ in the target column of
    1088765cells and OTAs.  In each of these cases, a source object with an
    1089766instrumental magnitude brighter than -14.47 creates a ghost object
     
    1129806  \label{tab:crosstalk_rules}
    1130807\end{deluxetable}
    1131  
    1132808
    1133809\subsubsubsection{Optical ghosts}
    1134810\label{sec:optical_ghosts}
    1135811
    1136 Due to imperfections in the anti-reflective coating on the optical
    1137 surfaces of GPC1, bright sources can also result in large out of focus
    1138 objects, particularly in the \gps{} filter data.  These objects are the
    1139 result of light reflecting back off the surface of the detector,
    1140 reflecting again off the lower surfaces of the optics (particularly
    1141 the L1 corrector lens), and then back down onto the focal plane.  Due
    1142 to the extra travel distance, the resulting source is out of focus and
     812The anti-reflective coating on the optical surfaces of GPC1 is less
     813effective at shorter wavelengths, which can allow bright sources to
     814reflect back onto the focal plane and generate large out-of-focus
     815objects.  Due to the wavelength dependence, these objects are most
     816prominent in the \gps{} filter data.  These objects are the result of
     817light reflecting back off the surface of the detector, reflecting
     818again off the lower surfaces of the optics (particularly the L1
     819corrector lens), and then back down onto the focal plane.  Due to the
     820extra travel distance, the resulting source is out of focus and
    1143821elongated along the radial direction of the camera focal plane. These
    1144822optical ghosts can be modeled in the focal plane coordinates (L,M)
    1145823which has its origin at the center of the focal plane.  In this
    1146824system, a bright object at location (L,M) on the focal plane creates a
    1147 reflection ghost on the opposite side of the optical axis at (-L,-M).
    1148 The exact location is fit as a third order polynomial in the focal
    1149 plane L and M directions (as listed in Table \ref{tab:ghost_centers}).
    1150 An elliptical annulus mask is constructed at the expected ghost
    1151 location, with the major and minor axes defined by linear functions of
    1152 the ghost distance from the optical axis, and oriented with the
    1153 ellipse major axis is along the radial direction (Table
    1154 \ref{tab:ghost_radii}).  All stars brighter than a filter-dependent
    1155 threshold (listed in Table \ref{tab:ghost_magnitudes}) have such masks
    1156 constructed.
     825reflection ghost on the opposite side of the optical axis near
     826(-L,-M).  The exact location is fit as a third order polynomial in the
     827focal plane L and M directions (as listed in Table
     828\ref{tab:ghost_centers}).  An elliptical annulus mask is constructed
     829at the expected ghost location, with the major and minor axes defined
     830by linear functions of the ghost distance from the optical axis, and
     831oriented with the ellipse major axis is along the radial direction
     832(Table \ref{tab:ghost_radii}).  All stars brighter than a
     833filter-dependent threshold (listed in Table
     834\ref{tab:ghost_magnitudes}) have such masks constructed.
    1157835
    1158836\begin{deluxetable}{lcc}
     
    1204882\end{deluxetable}
    1205883
    1206 
    1207884\begin{figure}
    1208885  \centering
    1209886  \includegraphics[width=0.9\hsize,angle=0,clip]{images/full_fpa_ghosts.jpg}
    1210887  \caption{Example of the full GPC1 field of view illustrating the sources and destinations of optical ghosts on exposure o5677g0123o (2011-04-26, 43s \gps{} filter).  The bright stars on OTA33 and OTA44 result in nearly circular ghosts on the opposite OTA.  In contrast, the trio of stars on OTA11 result in very elongated ghosts on OTA66.}
     888  \label{fig:optical ghosts}
    1211889\end{figure}
    1212890
     
    1220898detector surface in a long narrow glint.  This surface was physically
    1221899masked on 2010-08-24, removing the possibility of glints in subsequent
    1222 data, but that taken prior have an advisory dynamic mask constructed
    1223 when a reference source falls on the focal plane within one degree of
    1224 the detector edge.  This mask is 150 pixels wide, with length $L =
    1225 2500 \left(-20 - m_{inst}\right)$ pixels.  These glint masks are
    1226 constructed by selecting sufficiently bright sources in the reference
    1227 catalog that fall within rectangular regions around each edge of the
    1228 GPC1 camera.  These regions are separated from the edge of the camera
    1229 by 17 arcminutes, and extend outwards an additional degree.
     900data, but images that were taken prior to this date have an advisory
     901dynamic mask constructed when a reference source falls on the focal
     902plane within one degree of the detector edge.  This mask is 150 pixels
     903wide, with length $L = 2500 \left(-20 - m_{inst}\right)$ pixels.
     904These glint masks are constructed by selecting sufficiently bright
     905sources in the reference catalog that fall within rectangular regions
     906around each edge of the GPC1 camera.  These regions are separated from
     907the edge of the camera by 17 arcminutes, and extend outwards an
     908additional degree.
    1230909
    1231910\begin{figure}
     
    1233912  \includegraphics[width=0.9\hsize,angle=0,clip]{images/glint_example_o5379g0103o.jpg}
    1234913  \caption{Example of a glint on exposure o5379g0103o (2010-07-02, 45s \ips{} filter).  The source star out of the field of view creates a long reflection that extends through OTA73 and OTA63.}
     914  \label{fig:optical glints}
    1235915\end{figure}
    1236916
     
    1244924mask is constructed, as the source is likely too faint to produce the
    1245925feature.  These spikes are dependent on the camera rotation, and are
    1246 oriented at $\theta = n * \frac{\pi}{2} - \mathrm{ROTANGLE} + 0.798$,
    1247 based on the header keyword.
     926oriented based on the header keyword at $\theta = n * \frac{\pi}{2} -
     927\mathrm{ROTANGLE} + 0.798$, for $n = {0,1,2,3}$.
    1248928
    1249929The cores of stars that are saturated are masked as well, with a
     
    1263943\label{sec:masking_fraction}
    1264944
    1265 Although there are a large number of masked pixels within the sixty
    1266 OTAs of GPC1, the camera was designed to move chips with problematic
    1267 areas (most notably CTE issues) to the edges of the detector.  Because
    1268 of this, the main analysis of the mask fraction is based not on the
    1269 total footprint of the detector, but upon a circular reference field
    1270 of view with a radius of 1.5 degrees.  This field of view corresponds
    1271 approximately to half the width and height of the detector.  This
    1272 field of view underestimates the unvignetted region of GPC1.  A second
    1273 ``maximum'' field of view is also used to estimate the mask fraction
    1274 within a larger 1.628 degree radius.  This larger radius includes far
    1275 larger missing fractions due to the circular regions outside region
    1276 populated with OTAs, but does include the contribution from
    1277 well-illuminated pixels that are ignored by the reference radius.
    1278 
    1279 The results of simulating simulating the footprint of the detector as
    1280 a grid of uniformly sized pixels of $0\farcs{}258$ size are provided
    1281 in Table \ref{tab:mask fraction}.  Both fields of view contain
    1282 circular segments outside of the footprint of the detector, which
    1283 increase the area estimate that is unpopulated.  This category also
    1284 accounts for the inter-OTA and inter-cell gaps.  The regions with poor
    1285 CTE also account for a significant fraction of the masked pixels.  The
     945The GPC1 camera was designed such that where possible, OTAs with CTE
     946issues were placed towards the edge of the detector.  Because of this,
     947the main analysis of the mask fraction is based not on the total
     948footprint of the detector, but upon a circular reference field of view
     949with a radius of 1.5 degrees.  This radius corresponds approximately
     950to half the width and height of the detector.  This field of view
     951underestimates the unvignetted region of GPC1.  A second ``maximum''
     952field of view is also used to estimate the mask fraction within a
     953larger 1.628 degree radius.  This larger radius includes far larger
     954missing fractions due to the circular regions outside region populated
     955with OTAs, but does include the contribution from well-illuminated
     956pixels that are ignored by the reference radius.
     957
     958The results of simulating the footprint of the detector as a grid of
     959uniformly sized pixels of $0\farcs{}258$ size are provided in Table
     960\ref{tab:mask fraction}.  Both fields of view contain circular
     961segments outside of the footprint of the detector, which increase the
     962area estimate that is unpopulated.  This category also accounts for
     963the inter-OTA and inter-cell gaps.  The regions with poor CTE also
     964contribute to a significant fraction of the masked pixels.  The
    1286965remaining mask category accounts for known bad columns, cells that do
    1287966not calibrate well, and vignetting.  There are also a small fraction
     
    1297976input masks already account for the inter-cell gaps).  This estimate
    1298977does not include the circular segments outside of the detector
    1299 footprint.  This is minor for the reference field of view (1\%
    1300 difference), but does underestimate the static mask fraction for the
    1301 maximum radius by 7.3\%.  This analysis does provide a the observed
    1302 dynamic and advisory mask fractions, which are 0.03\% and 3\%
    1303 respectively.  The significant advisory value is a result of applying
    1304 such masks to all burntool corrected pixels.
     978footprint.  This difference is minor for the reference field of view
     979(1\% difference), but underestimates the static mask fraction for the
     980maximum radius by 7.3\%.  This analysis provides the observed dynamic
     981and advisory mask fractions, which are 0.03\% and 3\% respectively.
     982The significant advisory value is a result of applying such masks to
     983all burntool corrected pixels.
    1305984
    1306985\begin{deluxetable}{lcc}
     
    13261005background model for the full OTA is then determined prior to the
    13271006photometric analysis.  The mosaicked image is subdivided into
    1328 $800\times{}800$ pixel segments that define each pixel of the
    1329 background model, with the segments centered on the image center, and
    1330 overlapping adjacent subdivisions by 400 pixels.  These overlaps help
    1331 smooth the background model, as adjacent model pixels share input
     1007$800\times{}800$ pixel segments that define each superpixel of the
     1008background model, with the superpixels centered on the image center
     1009and overlapping adjacent superpixels by 400 pixels.  These overlaps
     1010help smooth the background model, as adjacent model pixels share input
    13321011pixels.
    13331012
    1334 From each subdivision, 10000 random unmasked pixels are drawn.  In the
     1013From each segment, 10000 random unmasked pixels are drawn.  In the
    13351014case where the mask fraction is large (such as on OTAs near the edge
    13361015of the field of view), and there are insufficient unmasked pixels to
    13371016meet this criterion, all possible unmasked pixels are used instead.
    13381017If this number is still small (less than 100 good pixels), the
    1339 subdivision does not have a background model calculated, and instead,
     1018superpixel does not have a background model calculated.  Instead,
    13401019the value assigned to that model pixel is set as the average of the
    13411020adjacent model pixels.  This allows up to eight neighboring background
    13421021values to be used to patch these bad pixels.
    13431022
    1344 For the remaining subdivisions that have sufficient unmasked pixels
    1345 for the background to be measured, the pixel values are used to
    1346 calculate a set of robust statistics for the initial background guess.
    1347 The minimum and maximum of the values are found, and checked to ensure
     1023For the subdivisions that have sufficient unmasked pixels for the
     1024background to be measured, the pixel values are used to calculate a
     1025set of robust statistics for the initial background guess.  The
     1026minimum and maximum of the values are found, and checked to ensure
    13481027that these are not the same value, which would indicate some problem
    13491028with the input values.  The values are then inserted into a histogram
    1350 with 1000 bins between the minimum and maximum values, and again
    1351 checked for issues with the inputs by ensuring that the bin with the
    1352 most input pixels does not contain more than half of the input values.
    1353 In this case, the minimum and maximum do not constrain the true
    1354 distribution of the input values well, and any values outside of the
    1355 20 bins closest to the bin with the peak are masked for future
    1356 consideration.  A cumulative distribution is then constructed from the
     1029with 1000 bins between the minimum and maximum values.  If the bin
     1030with the most input pixels contains more than half of the input
     1031values, the bin size is too coarse for the population of interest.  In
     1032this case, a new histogram is constructed using a range corresponding
     1033to the 20 bins closes to the peak, again dividing the range into 1000
     1034bins.  This process is iterated up to 20 times until a binsize is
     1035determined.  A cumulative distribution is then constructed from the
    13571036histogram, which saves the computational cost of sorting all the input
    13581037values.  The bins containing the 50-percentile point, as well as the
     
    13681047If this measured standard deviation is smaller than 3 times the bin
    13691048size, then all points more than 25 bins away from the calculated
    1370 median are masked, and the process is repeated until the bin size is
    1371 sufficiently small to ensure that the distribution width is well
    1372 sampled.  Once this iterative process converges, or 20 iterations are
    1373 run, the 25- and 75-percentile values are found by interpolating the 5
    1374 bins around the expected bin as well, and the count of the number of
    1375 input values within this inner 50-percentile region, $N_{50}$ is
    1376 calculated.
     1049median are masked, and the process is repeated with a new 1000 bin
     1050histogram until the bin size is sufficiently small to ensure that the
     1051distribution width is well sampled.  Once this iterative process
     1052converges, or 20 iterations are run, the 25- and 75-percentile values
     1053are found by interpolating the 5 bins around the expected bin as well,
     1054and the count of the number of input values within this inner
     105550-percentile region, $N_{50}$ is calculated.
    13771056
    13781057These initial statistics are then used as the starting guesses for a
     
    13801059distribution with a Gaussian.  All pixels that were masked in the
    13811060initial calculation are unmasked, and a histogram is again constructed
    1382 of the values, with a bin size set to $\sigma_{guess} / \left( N_{50} /
     1061from the values, with a bin size set to $\sigma_{guess} / \left( N_{50} /
    13831062500 \right)$.  With this bin size, we expect that a bin at $\pm 2
    13841063\sigma$ will have approximately 50 input points, which gives a
    1385 Poissonian signal to noise estimate around 7.  In the case where
     1064Poissonian signal-to-noise estimate around 7.  In the case where
    13861065$N_{50}$ is small (due to a poorly populated input image), this bin
    13871066size is fixed to be no larger than the guess of the standard
     
    13931072Two second order polynomial fits are then performed to the logarithm
    13941073of the histogram counts set at the midpoint of each bin.  The first
    1395 fit considers the ``lower half'' of the distribution, under the
     1074fit considers the lower portion of the distribution, under the
    13961075assumption that deviations from a normal distribution are caused by
    13971076real astrophysical sources that will be brighter than the true
     
    14071086fit.  The Gaussian mean and standard deviation are calculated from the
    14081087polynomial coefficients, and the symmetric fit results are accepted
    1409 unless the lower-half fit results in a smaller mean.  This process is
    1410 repeated again if the calculated standard deviation is not larger than
    1411 75\% of the initial guess (suggesting an issue with the initial bin
    1412 size).
     1088unless the lower-half fit results in a smaller mean.  This histogram
     1089and polynomial fit process is repeated again, with updated bin size
     1090based on the previous iteration standard deviation, if the calculated
     1091standard deviation is not larger than 75\% of the initial guess
     1092(suggesting an issue with the initial bin size).
    14131093
    14141094With this two-stage calculation performed across all subdivisions of
    14151095the mosaicked OTA image, and missing model pixels filled with the
    14161096average of their neighbors, the final background model is stored on
    1417 disk as a $13\times{}13$ image with header entries listing the binning
    1418 used.  The full scale background image is then constructed by
    1419 bilinearly interpolating this binned model, and this is subtracted
    1420 from the science image.  Each object in the photometric catalog has a
    1421 SKY and SKY\_SIGMA value that is the evaluation of this model at the
    1422 location of that object.
     1097disk as a $13\times{}13$ image for the GPC1 chips with header entries
     1098listing the binning used.  The full scale background image is then
     1099constructed by bilinearly interpolating this binned model, and this is
     1100subtracted from the science image.  Each object in the photometric
     1101catalog has a SKY and SKY\_SIGMA value determined from the background
     1102model mean and standard deviation.
    14231103
    14241104Although this background modeling process works well for most of the
     
    14311111of GPC1, the measured background was added back to the \IPPstage{chip}
    14321112stage images, but this special processing was not used for the large
    1433 scale $3\Pi$ PV3 reduction.
     1113scale $3\pi$ PV3 reduction.
     1114
     1115\subsection{Burntool / Persistence effect}
     1116\label{sec:burntool}
     1117
     1118Pixels that approach the saturation point on GPC1, which varies by
     1119cell with common values around 60000 DN, introduce ``persistent
     1120charge'' on that and subsequent images.  During the read out process
     1121of a cell with such a bright pixel, some of the charge remains in the
     1122undepleted region of the silicon and is not shifted down the detector
     1123column toward the amplifier.  This charge remains in the starting
     1124pixel and slowly leaks out of the undepleted region, contaminating
     1125subsequent pixels during the read out process, resulting in a ``burn
     1126trail'' that extends from the center of the bright source away from
     1127the amplifier (vertically along the pixel columns toward the top of
     1128the cell).
     1129
     1130This incomplete charge shifting in nearly full wells continues as each
     1131row is read out.  This results in a remnant charge being deposited in
     1132the pixels that the full well was shifted through.  In following
     1133exposures, this remnant charge leaks out, resulting in a trail that
     1134extends from the initial location of the bright source on the previous
     1135image towards the amplifier (vertically down along the pixel column).
     1136This remnant charge can remain on the detector for up to thirty
     1137minutes.
     1138
     1139Both of these types of persistence trails are measured and optionally
     1140repaired via the \IPPprog{burntool} program.  This program does an
     1141initial scan of the image, and identifies objects with pixel values
     1142higher than a conservative threshold of 30000 DN.  The trail from the
     1143peak of that object is fit with a one-dimensional power law in each
     1144pixel column above the threshold, based on empirical evidence that
     1145this is the functional form of this persistence effect.  This fit also
     1146matches the expectation that a constant fraction of charge is
     1147incompletely transferred at each shift beyond the persistence
     1148threshold.  Once the fit is done, the model can be subtracted from
     1149the image.  The location of the source is stored in a table along
     1150with the exposure PONTIME, which denotes the number of seconds since
     1151the detector was last powered on and provides an internally
     1152consistent time scale.
     1153
     1154For subsequent exposures, the table associated with the previous image
     1155is read in, and after correcting trails from the stars on the new
     1156image, the positions of the bright stars from the table are used to
     1157check for remnant trails from previous exposures on the image.  These
     1158are fit and subtracted using a one-dimensional exponential model,
     1159again based on empirical studies.  The output table retains this
     1160remnant position for 2000 seconds after the initial PONTIME recorded.
     1161This allows fits to be attempted well beyond the nominal lifetime of
     1162these trails.  Figure \ref{fig:burntool images} shows an example of a
     1163cell with a persistence trail from a bright star, the post-correction
     1164result, as well as the pre and post correction versions of the same
     1165cell on the subsequent exposure.  The profiles along the detector
     1166columns for these two exposures are presented in Figure
     1167\ref{fig:burntool plot}.
     1168
     1169Using this method of correcting the persistence trails has the
     1170challenge that it is based on fits to the raw image data, which may
     1171have other signal sources not determined by the persistence effect.
     1172The presence of other stars or artifacts in the detector column can
     1173result in a poor model to be fit, resulting in either an over- or
     1174under-subtraction of the trail.  For this reason, the image mask is
     1175marked with a value indicating that this correction has been applied.
     1176These pixels are not fully excluded, but they are marked as suspect,
     1177which allows them to be excluded from consideration in subsequent
     1178stages, such as image stacking.
     1179
     1180The cores of very bright stars can also be deformed by this process,
     1181as the burntool fitting subtracts flux from only one side of the star.
     1182As most stars that result in persistence trails already have saturated
     1183cores, they are already ignored for the purpose of PSF determination
     1184and are flagged as saturated by the photometry reduction.
     1185
     1186\begin{figure}
     1187  \centering
     1188  \begin{minipage}{0.45\hsize}
     1189    \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0123o_XY11_nobt.png}
     1190  \end{minipage}%
     1191  \begin{minipage}{0.45\hsize}
     1192    \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0124o_XY11_nobt.png}
     1193  \end{minipage}
     1194  \begin{minipage}{0.45\hsize}
     1195    \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0123o_XY11_bt.png}
     1196  \end{minipage}%
     1197  \begin{minipage}{0.45\hsize}
     1198    \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0124o_XY11_bt.png}
     1199  \end{minipage}
     1200  \caption{Example of OTA11 cell xy50 on exposures o5677g0123o (left) and o5677g0124o (right).  The top panels show the image with all appropriate detrending steps, but without burntool, and the bottom show the same with burntool applied.  There is some slight over subtraction in fitting the initial trail, but the impact of the trail is greatly reduced in both exposures.}
     1201  \label{fig:burntool images}
     1202\end{figure}
     1203
     1204
     1205\begin{figure}
     1206  \centering
     1207  \begin{minipage}{0.45\hsize}
     1208    \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0123o_XY11_bt_trail.png}
     1209  \end{minipage}%
     1210  \begin{minipage}{0.45\hsize}
     1211    \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5677g0124o_XY11_bt_trail.png}
     1212  \end{minipage}
     1213
     1214  \caption{Example of a profile cut along the y-axis through a bright star on exposure o5677g0123o OTA11 in cell xy50 (left panel) and on the subsequent exposure o5677g0124o (right panel).  In both figures, the green points show the image corrected with all appropriate detrending steps, but without burntool applied, illustrating the amplitude of the persistence trails.  The red points show the same data after the burntool correction, which reduces the impact of these features.  Both exposures are in the \gps{} filter with exposure times of 43s}
     1215  \label{fig:burntool plot}
     1216\end{figure}
     1217
     1218\subsection{Non-linearity Correction}
     1219\label{sec:nonlinearity}
     1220
     1221The pixels of GPC1 are not uniformly linear at all flux levels.  In
     1222particular, at low flux levels, some pixels have a tendency to sag
     1223relative to the expected linear value.  This effect is most pronounced
     1224along the edges of the detector cells, although some entire cells show
     1225evidence of this effect.
     1226
     1227To correct this sag, we studied the behavior of a series of flat
     1228frames for a ramp of exposure times with approximate logarithmically
     1229equal spacing between 0.01s and 57.04s.  As the exposure time
     1230increases, the signal on each pixel also increases in what is expected
     1231to be a linear manner.  Each of the flat exposures in this ramp is
     1232overscan corrected, and then the median is calculated for each cell,
     1233as well as for the rows and columns within ten pixels of the edge of
     1234the science region.  From these median values at each exposure time
     1235value, we can construct the expected trend by fitting a linear model
     1236for the region considered.  This fitting was limited to only the range
     1237of fluxes between 12000 and 38000 counts, as these ranges were found
     1238to match the linear model well.  This range avoids the non-linearity
     1239at low fluxes, as well as the possibility of high-flux non-linearity
     1240effects.
     1241
     1242We store the average flux measurement and deviation from the linear
     1243fit for each exposure time for each region on all detector cells in
     1244the linearity detrend look up tables.  An example of this data is
     1245shown in figure \ref{fig: nonlinearity}.  When this correction is
     1246applied to science data, these lookup tables are loaded, and a linear
     1247interpolation is performed to determine the correction needed for the
     1248flux in that pixel.  This look up is performed for both the row and
     1249column of each pixel, to allow the edge correction to be applied where
     1250applicable, and the full cell correction elsewhere.  The average of
     1251these two values is then applied to the pixel value, reducing the
     1252effects of pixel nonlinearity.
     1253
     1254This non-linearity effect appears to be stable in time for the
     1255majority of the detector pixels, with little evident change over the
     1256survey duration.  However, as the non-linearity is most pronounced at
     1257the edges of the detector cells, those are the regions where the
     1258correction is most likely to be incomplete.  Because of this fact,
     1259most pixels in the static mask with either the DARKMASK or FLATMASK
     1260bit set are found along these edges.  As the non-linearity correction
     1261is unable to reliably restore these pixels, they produce inconsistent
     1262values after the dark and flat have been applied, and are therefore
     1263rejected.
     1264
     1265\begin{figure}
     1266  \centering
     1267  \includegraphics[width=0.9\hsize,angle=0,clip]{images/linearity_XY27_xy16.png}
     1268  \caption{Example plot of the linearity correction as a fraction of observed flux for OTA27, cell xy16.}
     1269  \label{fig: nonlinearity}
     1270\end{figure}
     1271
     1272\subsection{Pattern correction}
     1273\label{sec:pattern}
     1274
     1275\subsubsection{Pattern Row}
     1276%% Statistics so I have them written down somewhere
     1277%% chipProcessedImfile.bg/bg_stdev by filter for XY33 (a good chip)
     1278%% filter  bg_mean stdev median Qsig                              bg_stdev_mean stdev median Qsig
     1279%% g        36.37422026669   64.64175104057  32.693   6.10284     14.696938349131  78.80460307171  8.8401  0.5417843
     1280%% r       200.96143304525  471.87743546238 117.105  94.55608     33.854672792146  79.01642728089 13.4564  5.3771355
     1281%% i       447.00504994458  938.38517801037 286.810 154.71397     57.298335510188  99.38392923935 20.0217 24.2254723
     1282%% z       317.54933679054  390.38930252748 241.014 114.13316     48.359069000176  94.44452756094 17.9404  9.1535209
     1283%% y       371.09019536218  293.57439970375 288.481 133.38769     43.724342221691 135.04286534327 19.9029  7.5396461
     1284
     1285As discussed above in the dark and noisemap sections, certain
     1286detectors have significant bias offsets between adjacent rows, caused
     1287by drifts in the bias level due to cross talk.  The magnitude of these
     1288offsets increases as the distance from the readout amplifier and
     1289overscan region increases, resulting in horizontal streaks that are
     1290more pronounced along the large x pixel edge of the cell.  As the
     1291level of the offset is apparently random between exposures, the dark
     1292correction cannot fully remove this structure from the images, and the
     1293noisemap value only indicates the level of the average variance added
     1294by these bias offsets.  Therefore, we apply the PATTERN.ROW correction
     1295in an attempt to mitigate the offsets and correct the image values.
     1296To force the rows to agree, a second order clipped polynomial is fit
     1297to each row in the cell.  Four fit iterations are run, and pixels
     1298$2.5\sigma$ deviant are excluded from subsequent fits, to minimize the
     1299effect stars and other astronomical signals have.  This final trend is
     1300then subtracted from that row.  Simply doing this subtraction will
     1301also have the effect of removing the background sky level.  To prevent
     1302this, the constant and linear terms for each row are stored, and
     1303linear fits are made to these parameters as a function of row,
     1304perpendicular to the initial fits.  This produces a plane that is
     1305added back to the image to restore the background offset and any
     1306linear ramp that exists in the sky.
     1307
     1308These row-by-row variations have the largest impact on data taken in
     1309the \gps{} filter, as the read noise is the dominant noise source in
     1310that filter.  At longer wavelengths, the noise from the Poissonian
     1311variation in the sky level increases.  The PATTERN.ROW correction is
     1312still applied to data taken in the other filters, as the increase in
     1313sky noise does not fully obscure the row-by-row noise.
     1314
     1315This correction was required on all cells on all OTAs prior to
     13162009-12-01, at which point a modification of the camera electronics
     1317reduced the scale of the row-by-row offsets for the majority of the
     1318OTAs.  \czw{describe modification} As a result, we only apply this
     1319correction to the cells where it is still necessary, as shown in
     1320Figure \ref{fig: pattern row cells}.  A list of these cells is in
     1321Table \ref{tab:pattern_row_cells}.
     1322
     1323Although this correction largely resolves the row-by-row offset issue
     1324in a satisfactory way, large and bright astronomical objects can bias
     1325the fit significantly.  This results in an oversubtraction of the
     1326offset near these objects.  As the offsets are calculated on the pixel
     1327rows, this oversubtraction is not uniform around the object, but is
     1328preferentially along the horizontal x axis of the object.  Most
     1329astronomical objects are not significantly distorted by this, with
     1330this only becoming on issue for only bright objects comparable to the
     1331size of the cell (598 pixels = 150").  Figure \ref{fig: pattern row example}
     1332shows an example of a cell pre- and post-correction.
     1333
     1334\begin{deluxetable}{lcccc}
     1335  \tablecolumns{3}
     1336  \tablewidth{0pc}
     1337  \tablecaption{Cells which have PATTERN.ROW correction applied}
     1338  \tablehead{\colhead{OTA} & \colhead{Cell columns} & \colhead{Additional cells}}
     1339  \startdata
     1340  OTA11 &  & xy02, xy03, xy04, xy07 \\
     1341  OTA14 &  & xy23 \\
     1342  OTA15 & 0 & \\
     1343  OTA27 & 0, 1, 2, 3, 7 & \\
     1344  OTA31 & 7 & \\
     1345  OTA32 & 3, 7 & \\
     1346  OTA45 & 3, 7 & \\
     1347  OTA47 & 0, 3, 5, 7 & \\
     1348  OTA57 & 0, 1, 2, 6, 7 & \\
     1349  OTA60 &  & xy55 \\
     1350  OTA74 & 2, 7 & \\
     1351  \enddata
     1352  \label{tab:pattern_row_cells}
     1353\end{deluxetable}
     1354
     1355\begin{figure}
     1356  \centering
     1357  \includegraphics[width=0.9\hsize,angle=0,clip]{images/pattern_row_edit.png}
     1358  \caption{Diagram illustrating in red which cells on GPC1 require the PATTERN.ROW correction to be applied.  The footprint of each OTA is outlined, and cell xy00 is marked with either a filled box or an outline.  The labeling of the non-existent corner OTAs is provided to orient the focal plane.}
     1359  \label{fig: pattern row cells}
     1360\end{figure}
     1361
     1362\begin{figure}
     1363  \centering
     1364  \begin{minipage}{0.45\hsize}
     1365    \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5379g0103o_XY57_nopat.png}
     1366  \end{minipage}%
     1367  \begin{minipage}{0.45\hsize}
     1368    \includegraphics[width=0.9\hsize,angle=0,clip]{images/o5379g0103o_XY57_pat.png}
     1369  \end{minipage}
     1370  \caption{Example of the PATTERN.ROW correction on exposure o5379g0103o OTA57 cell xy01 (\ips{} filter 45s).  The left panel shows the cell with all appropriate detrending except the PATTERN.ROW, and the right shows the same cell with PATTERN.ROW applied.  The correction reduces the correlated noise on the right side, which is most distant from the read out amplifier.  There is a slight over subtraction along the rows near the bright star.}
     1371  \label{fig: pattern row example}
     1372\end{figure}
     1373
     1374\subsubsection{Pattern Continuity}
     1375
     1376The background levels of cells on a single OTA do not always have the
     1377same value.  Even with dark and flat corrections applied, adjacent
     1378cells may not match.  In addition, studies of the background level
     1379indicate that the row-by-row bias can introduce small background
     1380gradient variations along the rows of the cells that are not stable.
     1381This common feature across the columns of cells results in a ``saw
     1382tooth'' pattern horizontally across an the mosaicked OTA, and as the
     1383background model fits a smooth sky level, this induces over and under
     1384subtraction at the cell boundaries.
     1385
     1386The PATTERN.CONTINUITY correction, attempts to match the edges of a
     1387cell to those of its neighbors.  For each cell, a thin box 10 pixels
     1388wide running the full length of each edge is extracted and the median
     1389value of unmasked values calculated for that box.  These median values
     1390are then used to construct a vector of the sum of the differences
     1391between that cell's edges and the corresponding edge on any adjacent
     1392cell $\Delta$.  A matrix $A$ of these associations is also
     1393constructed, with the diagonal containing the number of cells adjacent
     1394to that cell, and the off-diagonal values being set to -1 for each
     1395pair of adjacent cells.  The offsets needed for each chip, $x$ can
     1396then be found by solving the system $A x = \Delta$. A cell with the
     1397maximum number of neighbors, usually cell xy11, the first cell not on
     1398the edge of the OTA, is used to constrain the system, ensuring that
     1399that cell has zero correction and that there is a single solution.
     1400
     1401For OTAs that initially show the saw tooth pattern, the effect of this
     1402correction is to align the cells into a single ramp, at the expense of
     1403the absolute background level.  However, as we subtract off a smooth
     1404background model prior to doing photometry, these deviations from an
     1405absolute sky level do not affect photometry for point sources and
     1406extended sources smaller than a single cell.  The fact that the
     1407final ramp is smoother than it would be otherwise also allows for the
     1408background subtracted image to more closely match the astronomical
     1409sky, without significant errors at cell boundaries.  An example of the
     1410effect of this correction on an image profile is shown in Figure
     1411\ref{fig:dark switching}.
    14341412
    14351413\section{GPC1 Detrend Construction}
    14361414\label{sec:detrend construction}
    14371415
    1438 The various detrends for GPC1 are constructed in similar ways.  A
    1439 series of appropriate exposures is selected from the database, and
    1440 processed with the \IPPprog{ppImage} program.  This program is used
    1441 for the \IPPstage{chip} stage processing as well, and is designed to
    1442 do multiple image processing operations.  The extent of this
    1443 processing is dependent on the order in which the detrend to be
    1444 constructed is applied to science data.  In general, the input
    1445 exposures to the detrend have all prior stages of detrend processing
    1446 applied.  Table \ref{tab:detrend ppImage} summarizes stages applied
    1447 for the detrends we construct.
     1416The various master detrend images for GPC1 are constructed using a
     1417common approach.  A series of appropriate exposures is selected from
     1418the database, and processed with the \IPPprog{ppImage} program, which
     1419is designed to do multiple image processing operations.  The
     1420processing steps applied to the images depend on the type of master
     1421detrend to be constructed.  In general, the input exposures to the
     1422detrend have all prior stages of detrend processing applied.  Table
     1423\ref{tab:detrend ppImage} summarizes stages applied for the detrends
     1424we construct.
    14481425
    14491426Once the input data has been prepared, the \IPPprog{ppMerge} program
    1450 is used to construct some sort of ``average'' of the inputs.  This
    1451 step need not be a mathematical average, but is used to combine the
    1452 signal from the individual exposures into a single output product.
    1453 Table \ref{tab:detrend ppMerge} lists some of the properties of the
    1454 process for the detrends, including how discrepant values are removed
    1455 and the combination method used.  The outputs from this step have the
    1456 format of the detrend under construction, and after construction, are
    1457 applied to the processed input data.  This creates a set of residual
    1458 files that are checked to determine if the newly created detrend
    1459 correctly removes the detector dependent signal.
     1427is used to combine the inputs.  In some cases, this is the
     1428mathematical average, but in other cases it is a fit across the
     1429inputs.  Table \ref{tab:detrend ppMerge} lists some of the properties
     1430of the process for the detrends, including how discrepant values are
     1431removed and the combination method used.  The outputs from this step
     1432have the format of the detrend under construction.  After
     1433construction, these combined outputs are applied to the processed
     1434input data.  This creates a set of residual files that are checked to
     1435determine if the newly created detrend correctly removes the detector
     1436dependent signal.
    14601437
    14611438This process of detrend construction and testing can be iterated, with
    14621439individual exposures excluded if they are found to be contaminating
    1463 the output.  If the final detrend has sufficiently small residuals,
    1464 then the iterations are stopped and the detrend is finalized by
    1465 selecting the date range to which it applies.  This allows subsequent
    1466 science processing to select the detrends needed based on the
    1467 observation date.  Table \ref{tab:detrend list} lists the set of
    1468 detrends used in the PV3 processing.
     1440the output.  The construction of detrends is largely automatic, but
     1441manual intervention is needed to accept the detrend for use on science
     1442data.  If the final detrend has sufficiently small residuals, then the
     1443iterations are stopped and the detrend is finalized by selecting the
     1444date range to which it applies.  This allows subsequent science
     1445processing to select the detrends needed based on the observation
     1446date.  Table \ref{tab:detrend list} lists the set of detrends used in
     1447the PV3 processing.
    14691448
    14701449\begin{deluxetable}{lcccc}
     
    14751454  \startdata
    14761455  LINEARITY & Y & & & \\
     1456%%  DARKMASK  & Y & Y & Y & \\
     1457%%  FLATMASK  & Y & Y & Y & Y \\
     1458%%  CTEMASK   & Y & Y & Y & Y \\
     1459  DARK      & Y & Y & & \\
     1460%%  NOISEMAP  & Y & Y & & \\
     1461  FLAT      & Y & Y & Y & \\
     1462  FRINGE    & Y & Y & Y & Y \\
    14771463  DARKMASK  & Y & Y & Y & \\
    14781464  FLATMASK  & Y & Y & Y & Y \\
    14791465  CTEMASK   & Y & Y & Y & Y \\
    1480   DARK      & Y & Y & & \\
    14811466  NOISEMAP  & Y & Y & & \\
    1482   FLAT      & Y & Y & Y & \\
    1483   FRINGE    & Y & Y & Y & Y \\
    14841467  \enddata
    14851468  \label{tab:detrend ppImage}
     
    15511534\section{Warping}
    15521535\label{sec:warping}
    1553 To provide a consistent and uniform set of images for co-added image
    1554 stacking and differences, the individual mosaicked OTA images are
    1555 projected onto a common set of tangent plane projected regions called
    1556 projection cells.  These projection cells are $4\times{}4$ degree
    1557 fields spaced onto a set of centers that fully cover the sky.  They are
    1558 arranged into rings of constant declination, and allowed to overlap as
    1559 $|\delta|$ increases.  Each projection cell is further subdivided into
    1560 $10\times{}10$ sky cells with fixed $0.25"$ resolution pixels, and
    1561 constant overlap regions between adjacent skycells of $60"$.  These
    1562 skycells are the main image unit used for processing image data beyond
    1563 the initial chip stage.  The coordinate system used for these images
    1564 matches the parity of the sky, with north in the positive y direction
    1565 and east to the negative x direction.
     1536To provide a consistent and uniform set of coordinates for image
     1537combination (including stacking and differences), the individual
     1538mosaicked OTA images are projected onto a common pixel grids, called
     1539tessellations.  A tessellation can contain any number of tangent plane
     1540projections, with those designed for single pointing surveys using
     1541only one, while the tessellation used for the $3\pi$ survey contains
     15422643 tangent plane projection centers.  These ``projection cells'' are
     1543$4\times{}4$ degree fields spaced onto a set of centers that fully
     1544cover the sky.  They are arranged into rings of constant declination,
     1545and allowed to overlap as $|\delta|$ increases.  Each projection cell
     1546is further subdivided into $10\times{}10$ ``skycells'' with fixed
     1547$0.25"$ resolution pixels, and constant overlap regions between
     1548adjacent skycells of $60"$.  These skycells are the main image unit
     1549used for processing image data beyond the initial chip stage.  The
     1550coordinate system used for these images matches the parity of the sky,
     1551with north in the positive y direction and east to the negative x
     1552direction.
    15661553
    15671554After the detrending and photometry, the detection catalog for the
    1568 full camera is fit to the reference catalog, producing third-order
    1569 astrometric solutions that map the detector focal plane to the sky,
    1570 and map the individual OTA pixels to the detector focal plane.  This
    1571 solution is then used to determine which skycells the exposure OTAs
    1572 overlap.
     1555full camera is fit to the reference catalog, producing astrometric
     1556solutions that map the detector focal plane to the sky, and map the
     1557individual OTA pixels to the detector focal plane
     1558\citep[see][]{magnier2017.calibration}.  This solution is then used to
     1559determine which skycells the exposure OTAs overlap.
    15731560
    15741561For each output skycell, all overlapping OTAs and the calibrated
    1575 catalog are read into the \IPPprog{pswarp} program.  Each input image
    1576 is examined in order, and the same transformation performed.  This
    1577 transformation breaks the output warp image into $128\times{}128$
    1578 pixel grid boxes.  Each grid box has a locally linear map calculated
    1579 that converts the output warp image coordinates to the input chip
    1580 image coordinates.  By doing the transformation in this direction,
    1581 each output pixel has a unique sampling position on the input image
     1562catalog are read into the \IPPprog{pswarp} program.  The output warp
     1563image is broken into $128\times{}128$ pixel grid boxes.  For purposes
     1564of speed, each grid box has a locally linear map calculated that
     1565converts the output warp image coordinates to the input chip image
     1566coordinates.  By doing the transformation in this direction, each
     1567output pixel has a unique sampling position on the input image
    15821568(although it may be off the image frame and therefore not populated),
    15831569preventing gaps in the output image due to the spacing of the input
    15841570pixels.
    15851571
    1586 With the locally linear grid defined, Lanczos interpolation with
    1587 filter size parameter $a = 3$ on the input image is used to determine
    1588 the values to assign to the output pixel location.  The output
    1589 locations are shifted by 0.5 pixels to let the interpolation select
    1590 the value that would be assigned to the center of the output
    1591 pixel. This process is repeated for all grid boxes, for all input
     1572With the locally linear grid defined, Lanczos interpolation
     1573\citep{lanczos1956applied} with filter size parameter $a = 3$ on the input
     1574image is used to determine the values to assign to the output pixel
     1575location.  This process is repeated for all grid boxes, for all input
    15921576images, and for each output image product: the science image, the
    15931577variance, and the mask.  The image values are scaled by the absolute
    1594 value of the Jacobian determinant of the transformation.  This
    1595 corrects the pixel values for the possible change in pixel area due to
    1596 the transformation.  Similarly, the variance image is scaled by the
    1597 square of this value, again to correctly account for the pixel area
    1598 change.
    1599 
    1600 As the interpolation constructs the output pixels from more than one
    1601 input pixel, there is a covariance term that is must be included.  For
    1602 each locally linear grid box, the covariance is calculated from the
     1578value of the Jacobian determinant of the transformation for each grid
     1579box.  This corrects the pixel values for the possible change in pixel
     1580area due to the transformation.  Similarly, the variance image is
     1581scaled by the square of this value, again to correctly account for the
     1582pixel area change.
     1583
     1584The interpolation constructs the output pixels from more than one
     1585input pixel, which introduces covariance between pixels.  For each
     1586locally-linear grid box, the covariance matrix is calculated from the
    16031587kernel in the center of the 128 pixel range.  Once the image has been
    1604 fully populated, this set of individual covariance matrices is
     1588fully populated, this set of individual covariance matrices are
    16051589averaged to create the final covariance for the full image.
    16061590
     
    16081592catalog, including only those objects that fall on the new warped image.
    16091593These detections are transformed to match the new image location, and
    1610 to scale the position errors based on the new orientation.
     1594to scale the position uncertainties based on the new orientation.
    16111595
    16121596The output image also contains header keywords SRC\_0000, SEC\_0000,
    1613 MPX\_0000, and MPY\_0000 that contain the mappings from the warped
     1597MPX\_0000, and MPY\_0000 that define the mappings from the warped
    16141598pixel space to the input image.  The SRC keyword lists the input OTA
    1615 name, and the SEC keyword lists the image section corresponding to the
    1616 locally linear grid box.  The MPX and MPY contain the transformation
    1617 parameters for the locally linear grid.  These parameters are stored
    1618 in a string listing the reference position in the chip coordinate
    1619 frame, the slope of the relation in the warp x axis, and the slope of
    1620 the relation in the warp y axis.  From these keywords, any position in
    1621 the warp can be mapped back to the location in any of the input OTA
    1622 images.
     1599name, and the SEC keyword lists the image section that the mapping
     1600covers.  The MPX and MPY contain the back-transformation linearized
     1601across the full chip.  These parameters are stored in a string listing
     1602the reference position in the chip coordinate frame, the slope of the
     1603relation in the warp x axis, and the slope of the relation in the warp
     1604y axis.  From these keywords, any position in the warp can be mapped
     1605back to the location in any of the input OTA images, with some
     1606reduction in accuracy.
    16231607
    16241608\begin{figure}
     
    16711655
    16721656Once individual exposures have been warped onto a common projection
    1673 system, they can then be combined pixel-by-pixel regardless of their
     1657system, they can be combined pixel-by-pixel regardless of their
    16741658original orientation.  Creating a stacked image by co-adding the
    16751659individual warps increases the signal to noise, allowing for the
    1676 detection of objects that would not be sufficiently significant to be measured from a single image.
    1677 Creating this stack also allows a complete image to be
    1678 constructed that does not have regions masked due to the gaps between
    1679 cells and OTAs.  This fully populated static sky image can also be
    1680 used as a template for subtraction to find transient sources.
    1681 
    1682 The stacked image is comprised of all warp frames for a given skycell
    1683 in a single filter.  The source catalogs and image components are
    1684 loaded into the \IPPprog{ppStack} program to prepare the inputs and
    1685 stack the frames.
     1660detection of objects that would not be sufficiently significant to be
     1661measured from a single image.  Creating this stack also allows a more
     1662complete image to be constructed that has fewer regions masked due to
     1663the gaps between cells and OTAs.  This deeper and more complete image
     1664can also be used as a template for subtraction to find transient
     1665sources.
     1666
     1667For the $3\pi$ survey, the stacked image is comprised of all warp
     1668frames for a given skycell in a single filter.  The source catalogs
     1669and image components are loaded into the \IPPprog{ppStack} program to
     1670prepare the inputs and stack the frames.
    16861671
    16871672Once all files are ingested, the first step is to measure the size and
     
    16891674FWHM greater than 10 pixels (2.5 arcseconds), as those images have the
    16901675seeing far worse than average, and would degrade the final output
    1691 stack.  For the PV3 $3\Pi$ survey, this size represents a PSF larger
     1676stack.  For the PV3 $3\pi$ survey, this size represents a PSF larger
    16921677than the $97$th percentile in all filters.  A target PSF for the stack
    16931678is constructed by finding the maximum envelope of all input PSFs,
     
    16971682input images when matched to the target.
    16981683
    1699 The input images also need to have their fluxes normalized to prevent
    1700 differences in seeing and sky transparency from causing discrepancies
    1701 during pixel rejection.  From the reference catalog calibrated input
    1702 catalogs, we have the instrumental magnitudes of all sources, along
    1703 with the airmass, image exposure time, and zeropoint.  All output
    1704 stacks are calibrated to a zeropoint of 25.0 in all filters, and to
    1705 have an airmass of 1.0.  The output exposure time is set to the sum of
    1706 the input exposure times, regardless of if those inputs are rejected
    1707 later in the combination process.  We can determine the relative
     1684The input image fluxes are normalized to prevent differences in seeing
     1685and sky transparency from causing discrepancies during pixel
     1686rejection.  From the reference catalog calibrated input catalogs, we
     1687have the instrumental magnitudes of all sources, along with the
     1688airmass, image exposure time, and zeropoint.  All output stacks are
     1689constructed to a target zeropoint of 25.0 in all filters, and to have
     1690an airmass of 1.0.  The output exposure time is set to the sum of the
     1691input exposure times, regardless of whether those inputs are rejected later
     1692in the combination process.  We can determine the relative
    17081693transparency for each input image by comparing the magnitudes of
    17091694matched sources between the different images.  Each image then has a
    1710 normalization factor defined, equal to $\mathrm{norm}_{input} = (ZP_\mathrm{input}
    1711 - ZP_\mathrm{target}) - \mathrm{transparency}_\mathrm{input} - 2.5 *
    1712 \log_{10} (t_\mathrm{target} / t_\mathrm{input}) -
    1713 \mathrm{F}_\mathrm{airmass} * (\mathrm{airmass}_\mathrm{input} -
    1714 \mathrm{airmass}_\mathrm{target})$.  For the PV3 processing, the
    1715 airmass factor $\mathrm{F}_\mathrm{airmass}$ was set to zero, such
    1716 that all flux differences from differing exposure airmasses are
    1717 assumed to be included in the zeropoint and transparency values.
     1695normalization factor defined, equal to $\mathrm{norm}_{input} =
     1696(ZP_\mathrm{input} - ZP_\mathrm{target}) -
     1697\mathrm{transparency}_\mathrm{input} - 2.5 * \log_{10}
     1698(t_\mathrm{target} / t_\mathrm{input}) - \mathrm{F}_\mathrm{airmass} *
     1699(\mathrm{airmass}_\mathrm{input} - \mathrm{airmass}_\mathrm{target})$.
     1700For the PV3 processing, the airmass factor
     1701$\mathrm{F}_\mathrm{airmass}$ was set to zero, such that all flux
     1702differences from differing exposure airmasses are assumed to be
     1703included in the zeropoint and transparency values.
    17181704
    17191705The zeropoint calibration performed here uses the calibration of the
     
    17241710the entire region of the sky imaged.  This further calibration is not
    17251711available at the time of stacking, and so there may be small residuals
    1726 in the transparency values as a result of this \citet{magnier2017c}.
     1712in the transparency values as a result of this \citet{magnier2017.calibration}.
    17271713
    17281714With the flux normalization factors and target PSF chosen, the
     
    17331719the kernel, and the residual with the target PSF used to update the
    17341720parameters of the kernel via least squares optimization.  Stamps that
    1735 significantly deviate are rejected, but as the squared residual
     1721significantly deviate are rejected, although the squared residual
    17361722difference will increase with increasing source flux.  To mitigate
    17371723this effect, a parabola is fit to the distribution of squared
     
    17411727convolution kernel is returned.
    17421728
    1743 This convolution may change the image flux scaling, so a normalization
    1744 factor is used to correct this.  This normalization factor is equal to
     1729This convolution may change the image flux scaling, so the kernel is
     1730normalized to account for this.  The normalization factor is equal to
    17451731the ratio of $10^{-0.4 \mathrm{norm}_{input}}$ to the sum of the
    17461732kernel.  The image is multiplied by this factor, and the variance by
     
    17491735Once the convolution kernels are defined for each image, they are used
    17501736to convolve the image to match the target PSF.  Any input image that
    1751 has a kernel match $\chi^2$ value greater than 4.0$\sigma$ larger than
    1752 the median value is rejected from the stack.  Each image also has a
    1753 weight assigned, based on the image variance after convolution.  A
    1754 full image weight is then calculated for each input, with the weight,
    1755 $W_\mathrm{input}$ is equal to the inverse of the median of the image
    1756 variance multiplied by the peak of the image covariance (due to the
    1757 warping process).
     1737has a kernel match $\chi^2$ value (defined as the sum of the RMS error
     1738across the kernel) 4.0$\sigma$ or larger than the median
     1739value is rejected from the stack.  Each image also has a weight
     1740assigned, based on the image variance after convolution.  A full image
     1741weight is then calculated for each input, with the weight,
     1742$W_\mathrm{input}$ equal to the inverse of the median of the image
     1743variance multiplied by the peak of the image covariance (from the
     1744warping process).  This ensures that low signal-to-noise images are
     1745down-weighted in the final combination.
    17581746
    17591747Following the convolution, an initial stack is constructed.  For a
    17601748given pixel coordinate, the values at that coordinate are extracted
    1761 from all input images.  Images that have a suspect mask bit (including
    1762 the SUSPECT, BURNTOOL, SPIKE, STREAK, STARCORE, and CONV.POOR bit
    1763 values) are appended to a suspect pixel list for preferential
    1764 exclusion.  Following this, the pixel values are combined and tested
    1765 to attempt to identify discrepant input values that should be excluded.
     1749from all input images, with pixels masked excluded from consideration.
     1750Images that only have a suspect mask bit (including the SUSPECT,
     1751BURNTOOL, SPIKE, STREAK, STARCORE, and CONV.POOR bit values) are
     1752appended to a suspect pixel list for preferential exclusion.
     1753Following this, the pixel values are combined and tested to attempt to
     1754identify discrepant input values that should be excluded.
    17661755
    17671756If only a single input is available, the initial stack contains the
    17681757value from that single input.  If there are only two inputs, the
    17691758average of the two is used.  These cases should occur only rarely in
    1770 the $3\Pi$ survey, as there are many input exposures that overlap each
     1759the $3\pi$ survey, as there are many input exposures that overlap each
    17711760point on the sky.  For the more common case of three or more inputs, a
    17721761weighted average from the inputs is used, with the weight for each
     
    17891778there were no valid inputs, in which case the BLANK mask bit is set.
    17901779
    1791 Due to the various non-astronomical ghosts that can occur on GPC1, and
    1792 the fact that they may not be fully masked to ensure all bad pixels
    1793 are removed, it is expected that some of the inputs for a given stack
    1794 pixel are not in agreement with the others.  In general, there is the
    1795 population of input pixel values around the correct astronomical
    1796 level, as well as possible populations at lower pixel value (such as
    1797 due to an over-subtracted burntool trail) and at higher pixel values
    1798 (such as that caused by an incompletely masked optical ghost).  Due to
    1799 the observation strategy to image a given field twice to allow for
     1780Due to uncorrected artifacts that can occur on GPC1, and the fact that
     1781they may not be fully masked to ensure all bad pixels are removed, it
     1782is expected that some of the inputs for a given stack pixel are not in
     1783agreement with the others.  In general, there is the population of
     1784input pixel values around the correct astronomical level, as well as
     1785possible populations at lower pixel value (such as due to an
     1786over-subtracted burntool trail) and at higher pixel values (such as
     1787that caused by an incompletely masked optical ghost).  Due to the
     1788observation strategy to observe a given field twice to allow for
    18001789warp-warp difference images to be constructed to identify transient
    18011790detections, higher pixel values that come from sources like optical
    1802 ghosts that depend on the telescope pointing will come in pairs as well.
    1803 The higher pixel value contaminants are also potentially problematic
    1804 as they may appear to be real sources, prompting photometry to be
    1805 performed on false objects.  Because of the expectation that there are
    1806 more bright contaminants than faint ones, there is a slight preference
    1807 to reject higher pixel values than lower pixel values.
     1791ghosts that depend on the telescope pointing will come in pairs.
     1792Detector artifacts will  appear in pairs as well.  The higher
     1793pixel value contaminants are also potentially problematic as they may
     1794appear to be real sources, prompting photometry to be performed on
     1795false objects.  Because of the expectation that there are more positive
     1796deviations than negative ones, there is a slight preference to  reject
     1797higher pixel value outliers than lower pixel values, as described below.
    18081798
    18091799Following the initial combination, a ``testing'' loop iterates in an
     
    18181808and both are flagged for rejection
    18191809
    1820 If the number of inputs is larger than 6, then a Gaussian mixture
    1821 model analysis is run on the inputs to fit two sub populations, and
    1822 determine an the likelihood that the distribution is best described by
     1810If the number of input pixels is larger than 6, then a Gaussian mixture
     1811model analysis is run on the inputs fitting two sub populations, to
     1812determine the likelihood that the distribution is best described by
    18231813an uni-modal model.  If this probability is less than $5\%$, then the
    18241814mean is taken from the bimodal sub population with the largest
     
    18261816comprised of high pixel value outliers.
    18271817
    1828 If this is not the case, and the distribution is likely unimodal, or
    1829 if there are insufficient inputs for this mixture model analysis, the
    1830 input values are passed to an Olympic weighted mean calculation.  We
    1831 reject $20\%$ of the number of inputs through this process.  The
    1832 number of bad inputs is set to $N_\mathrm{bad} = 0.2 *
    1833 N_\mathrm{input} + 0.5$, with the 0.5 term ensuring at least one input
    1834 is rejected.  This number is further separated into the number of low
    1835 values to exclude $N_\mathrm{low} = N_\mathrm{bad} / 2$, which will
    1836 default to zero if there are few inputs, and $N_\mathrm{high} =
    1837 N_\mathrm{input} + N_\mathrm{low} - N_\mathrm{bad}$.  After sorting
    1838 the input values to determine which values fall into the low and high
    1839 groups, the remaining input values are used in a weighted mean using
    1840 the image weights above.
     1818If the unimodal probability is greater than $5\%$ (indicating the
     1819distribution is likely to be unimodal), or if there are insufficient
     1820inputs for this mixture model analysis, the input values are passed to
     1821an Olympic weighted mean calculation.  We reject $20\%$ of the number
     1822of inputs through this process.  The number of bad inputs is set to
     1823$N_\mathrm{bad} = 0.2 * N_\mathrm{input} + 0.5$, with the 0.5 term
     1824ensuring at least one input is rejected.  This number is further
     1825separated into the number of low values to exclude, $N_\mathrm{low} =
     1826N_\mathrm{bad} / 2$, which will default to zero if there are few
     1827inputs, and $N_\mathrm{high} = N_\mathrm{low} - N_\mathrm{bad}$.
     1828After sorting the input values to determine which values fall into the
     1829low and high groups, the remaining input values are used in a weighted
     1830mean using the image weights above.
    18411831
    18421832A systematic variance term is necessary to correctly scale how
    18431833discrepant points can be from the ensemble mean.  If the mixture model
    1844 analysis was run, the Gaussian sigma from the largest sub population
    1845 is squared and used.  If this is not available, a $10\%$ systematic
    1846 error on the input values is used.  Each point then has a limit
    1847 calculated using a $4\sigma$ rejection
     1834analysis has been run, the Gaussian sigma from the largest sub
     1835population is squared and used.  Otherwise, a $10\%$ systematic error
     1836on the input values is used.  Each point then has a limit calculated
     1837using a $4\sigma$ rejection
    18481838
    18491839\begin{eqnarray}
     
    18561846\mathrm{mean})^2$ exceeding this limit is identified.  If there are
    18571847suspect pixels in the set, those pixels are marked for rejection,
    1858 otherwise this worst pixel is marked for rejection.  Following this,
    1859 the combine and test loop is repeated for until no more pixels are
     1848otherwise this worst pixel is marked for rejection.  Following this step,
     1849the combine and test loop is repeated until no more pixels are
    18601850rejected, up to a maximum number of iterations equal to $50\%$ of the
    18611851number of inputs.
     
    18701860the entire image is rejected as it likely has some systematic issue.
    18711861
    1872 Finally, a second pass at rejecting pixels is conducted, by growing the
    1873 current list to include pixels that are neighbors to many rejected
     1862Finally, a second pass at rejecting pixels is conducted, by extending
     1863the current list to include pixels that are neighbors to many rejected
    18741864pixels.  The ISIS kernel used in the previous step is again used to
    1875 determine the largest square box that contains under the limit of
     1865determine the largest square box that does not exceed the limit of
    18761866$0.25 * \sum_{x,y} kernel^2$.  This square box is then convolved with
    18771867the rejected pixel mask to reject the neighboring pixels.  This final
     
    18831873a map of the number of inputs per pixel.
    18841874
    1885 These convolved stack products are not retained, as the convolution
    1886 reduces the resolution of the final image.  Instead, we apply the
    1887 normalizations and rejected pixel maps generated from the convolved
    1888 stack process to the original unconvolved input images.  This produces
    1889 an unconvolved stack that has the optimum image quality possible from
    1890 the input images.  Not convolving does mean that the PSF shape changes
    1891 across the image, as the different PSF widths of the input images
    1892 print through in the different regions to which they have contributed.
     1875These convolved stack products are not retained, as the convolution is
     1876used to ensure that the pixel rejection uses seeing-matched images.
     1877This prevents any differences in the input PSF shape from skewing the
     1878input pixel rejection.  We apply the normalizations and rejected pixel
     1879maps generated from the convolved stack process to the original
     1880unconvolved input images.  This produces an unconvolved stack that has
     1881the optimum image quality possible from the input images.  Not
     1882convolving does mean that the PSF shape changes across the image, as
     1883the different PSF widths of the input images print through in the
     1884different regions to which they have contributed.
    18931885
    18941886%% Asinh compression
    18951887
    1896 Due to the expected large range of data values in the final stacked
    1897 image, saving them as compressed 16-bit integer images with linear
    1898 BSCALE and BZERO scaling values is likely to offer poor
    1899 reconstructions of the stacked image.  This will lead either to
    1900 truncation of the extrema of the image, or quantized values that are
    1901 poorly spaced for the image histogram.  Saving the images as 32-bit
    1902 floating point values would alleviate this quantization issue, at the
    1903 cost of a large increase in the disk space required for the stacked
    1904 images.
    1905 
    1906 Transforming the data prior to writing to disk by taking the logarithm
    1907 of the pixel values can resolve this, with the complication that all
    1908 data values must first be made positive, which then sets the highest
    1909 quantization sampling near the lowest values in the image.  Following
    1910 techniques used by SDSS \citep{2000AJ....120.1579Y}, we have instead opted to use the
    1911 inverse hyperbolic sine function to transform the data.  The domain of
    1912 this function allows any input value to be converted.  In addition,
    1913 the quantization sampling can be tuned by placing the zero of the
    1914 inverse hyperbolic sine function at a value where the highest sampling
    1915 is desired.
     1888While IPP image products from single exposures use compressed 16-bit
     1889integer images, this dynamic range is insufficient for the expected
     1890scale of the stacked images.  This will lead either to truncation of
     1891the extrema of the image, or quantized values that poorly sample the
     1892image noise distribution.  Saving the images as 32-bit floating point
     1893values would alleviate this quantization issue, at the cost of a large
     1894increase in the disk space required for the stacked images.
     1895
     1896Inspired by techniques used by SDSS \citep{1999AJ....118.1406L}, we
     1897use the inverse hyperbolic sine function to transform the data.  The
     1898domain of this function allows any input value to be converted.  In
     1899addition, the quantization sampling can be tuned by placing the zero
     1900of the inverse hyperbolic sine function at a value where the highest
     1901sampling is desired.
    19161902
    19171903Formally, prior to being written to disk, the pixel values are
    19181904transformed by $C = \alpha \asinh\left(\frac{L - \mathrm{BOFFSET}}{2.0
    19191905  \cdot \mathrm{BSOFTEN}}\right)$, where $L$ are the linear input
    1920 pixel values, $C$ the transformed values, $\alpha = 2.5 \log_{10}(e)$.
     1906pixel values, $C$ the transformed values, and $\alpha = 2.5 \log_{10}(e)$.
    19211907BOFFSET centers the transformed values, and the mean of the linear
    19221908input pixel values is used.  BSOFTEN controls the stretch of the
     
    20202006\label{sec:diffs}
    20212007
    2022 Constructing difference images is essentially the same as that used in
    2023 the stacking process.  An image is chosen as a template, another image
    2024 as the input, and after matching sources to determine the scaling and
    2025 transparency, convolution kernels are defined that are used to
    2026 convolve one or both of the images to a target PSF.  The images are
    2027 then subtracted, and as they should now share a common PSF, static
    2028 sources are largely subtracted (completely in an ideal case), whereas
    2029 sources that are not static between the two images leave a significant
    2030 remnant.  More information on the difference image construction is
    2031 contained in \citet{price2017}.  The follow section contains a
    2032 overview of the difference image construction used for the data in
    2033 DR2.
     2008The image matching process used in constructing difference images is
     2009essentially the same as for the stacking process.  An image is chosen
     2010as a template, another image as the input, and after matching sources
     2011to determine the scaling and transparency, convolution kernels are
     2012defined that are used to convolve one or both of the images to a
     2013target PSF.  The images are then subtracted, and as they should now
     2014share a common PSF, static sources are largely subtracted (completely
     2015in an ideal case), whereas sources that are not static between the two
     2016images leave a significant remnant.  More information on the
     2017difference image construction is contained in \citet{price2017}.  The
     2018following section contains an overview of the difference image
     2019construction used for the data in DR2.
    20342020
    20352021The images used to construct difference images can be either
     
    20452031minus stack) and inverse (stack minus warp) to allow for the
    20462032photometry of the difference image to detect sources that both rise
    2047 and fall relative to the stack.  Note that the convolution process
    2048 grows the mask fraction of pixels relative to the warp (the largest
    2049 source of masked pixels in these warp stack differences).  Any pixel
    2050 that after convolution has any contribution from a masked pixel is
    2051 masked as well, ensuring only fully unmasked pixels are used.
     2033and fall relative to the stack.  The convolution process grows the
     2034mask fraction of pixels relative to the warp (the largest source of
     2035masked pixels in these warp stack differences).  Any pixel that after
     2036convolution has any contribution from a masked pixel is masked as
     2037well, ensuring only fully unmasked pixels are used.
    20522038
    20532039For warp-warp differences, such as those used for the ongoing Solar
    2054 System moving object search in nightly observations \citep{2013PASP..125..357D}, the
    2055 warp that was taken first is used as the template.  As there is less
    2056 certainty in which of the two input images will have better seeing, a
    2057 ``dual'' convolution method is used.  Both inputs are convolved to a
    2058 target PSF that is not identical to either input.  This intermediate
    2059 target is essential for the case in which the PSFs of the two inputs
    2060 have been distorted in orthogonal directions.  Simply convolving one
    2061 to match the other would require some degree of deconvolution along
    2062 one axis.  As this convolution method by necessity uses more free
    2063 parameters, the ISIS kernels used are chosen to be simpler than those
    2064 used in the warp-stack differences.  The ISIS widths are kept the same
    2065 (1.5, 3.0, 6.0 pixel FWHMs), but each Gaussian kernel is constrained
    2066 to only use a second-order polynomial.  As with the warp-stack
    2067 differences, the mask fraction grows between the input warp and the
    2068 final difference image due to the convolution.  For the warp-warp
    2069 differences, each image mask grows based on the appropriate
    2070 convolution kernel, so the final usable image area is highly dependent
    2071 on ensuring that the telescope pointings are as close to identical as
    2072 possible.  The observing strategy to enable this is discussed in more
    2073 detail in \citet{chambers2017}.
    2074 
    2075 
    2076 
    2077 \section{Discussion}
     2040System moving object search in nightly observations
     2041\citep{2013PASP..125..357D}, the warp that was taken first is used as
     2042the template.  As there is less certainty in which of the two input
     2043images will have better seeing, a ``dual'' convolution method is used.
     2044Both inputs are convolved to a target PSF that is not identical to
     2045either input.  This intermediate target is essential for the case in
     2046which the PSFs of the two inputs have been distorted in orthogonal
     2047directions.  Simply convolving one to match the other would require
     2048some degree of deconvolution along one axis.  As this convolution
     2049method by necessity uses more free parameters, the ISIS kernels used
     2050are chosen to be simpler than those used in the warp-stack
     2051differences.  The ISIS widths are kept the same (1.5, 3.0, 6.0 pixel
     2052FWHMs), but each Gaussian kernel is constrained to only use a
     2053second-order polynomial.  As with the warp-stack differences, the mask
     2054fraction grows between the input warp and the final difference image
     2055due to the convolution.  For the warp-warp differences, each image
     2056mask grows based on the appropriate convolution kernel, so the final
     2057usable image area is highly dependent on ensuring that the telescope
     2058pointings are as close to identical as possible.  The observing
     2059strategy to enable this is discussed in more detail in
     2060\citet{chambers2017}.
     2061
     2062
     2063
     2064\section{Future Plans}
    20782065\label{sec:discussion}
    20792066
     
    20852072dependent on focal plane position.
    20862073
    2087 An obvious way to make use of the PV3 catalog is to do a statistical
     2074One obvious way to make use of the PV3 catalog is to do a statistical
    20882075search for electronic crosstalk ghosts that do not match a known rule.
    20892076Given that bright stars do not equally populate all fields, choosing
     
    20972084There is some evidence that we have not fully identified all of these
    20982085crosstalk rules, based on a study of PV3 images.  For example,
    2099 extremely bright stars may be able to create crosstalk ghosts between the second
    2100 cell column of OTA01 and OTA21, with possibly fainter ghosts appearing
    2101 on OTA11.  Despite the symmetry observed in the main ghost rules,
    2102 there do not appear to be clear examples of a similar ghost between
    2103 OTA47 and OTA66.  Examining this further based on the PV3 catalog
    2104 should provide a clear answer to this, as well as clarify brightness
    2105 limits below which the ghost does not appear.
     2086extremely bright stars may be able to create crosstalk ghosts between
     2087the second cell column of OTA01 and OTA21, with possibly fainter
     2088ghosts appearing on OTA11.  Despite the symmetry observed in the main
     2089ghost rules, there do not appear to be clear examples of a similar
     2090ghost between OTA47 and OTA66.  Examining this further based on the
     2091PV3 catalog should provide a clear answer to this, as well as clarify
     2092brightness limits below which the ghost does not appear.
    21062093
    21072094The PV3 catalog may also allow better determination of which date
    21082095ranges we should use to build the dark model.  The date ranges
    21092096currently in use are based on limited sampling of exposures, and do
    2110 not have strong tests indicating that they are the best.  By examining
     2097not have strong tests indicating that they are optimal.  By examining
    21112098the scatter between the detections on a given exposure and the catalog
    21122099average, we can attempt to look for increases in scatter that might
     
    21432130to isolate and remove this signal in the Fourier domain.  Preliminary
    21442131investigations have shown that there is a small peak visible in the
    2145 power spectrum of a single cell, but determining the optimal way to
     2132power spectrum of a single cell, but determining the best way to
    21462133clip this peak to reduce the noise in the image space is not clear.
    21472134
     
    21502137
    21512138The Pan-STARRS1 PV3 processing has reduced an unprecedented volume of
    2152 image data, and has produced a catalog for the $3\Pi$ Survey
     2139image data, and has produced a catalog for the $3\pi$ Survey
    21532140containing hundreds of billions of individual measurements of
    21542141three billion astronomical objects.  Accurately calibrating
Note: See TracChangeset for help on using the changeset viewer.