IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39844 for trunk


Ignore:
Timestamp:
Dec 9, 2016, 6:32:52 PM (10 years ago)
Author:
watersc1
Message:

Update with most of the red text removed. Also addition work on the stack section, and example images of the warp and stack. Some formatting work to ensure things are clearer.

Location:
trunk/doc/release.2015/ps1.detrend
Files:
9 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/release.2015/ps1.detrend/detrend.tex

    r39817 r39844  
    3636\newcommand{\ippstage}[1]{\textsc{#1}}
    3737\newcommand{\asinh}{\mathop{\rm asinh}\nolimits}
    38 
    3938
    4039% Pick a terse version of the title here;
     
    127126reduction of the Pan-STARRS archival data.  The first two reductions
    128127were used internally for pipeline optimization and the development of
    129 the initial photometric and astrometric reference catalog.  The
     128the initial photometric and astrometric reference catalog \citep{ps1_reference_catalog}.  The
    130129products from these reductions were not publicly released, but have
    131130been used to produce a wide range of scientific papers from the
    132131Pan-STARRS 1 Science Consortium members.
     132
     133\czwdraft{Nigel: you mention calibrating to the reference catalog without telling us
     134what this is composed of (maybe this is in a different section, but would be
     135nice to have some idea here).}
     136
     137\czwdraft{Can we get around this point by simply adding a reference to
     138  the paper describing the reference catalog?  It's not really part of
     139  the detrending process, and is discussed here mostly to give an
     140  overview of the stages, and later to find sources of ghosts for
     141  masking.}
    133142
    134143The Pan-STARRS image processing pipeline (IPP) is described elsewhere
     
    17918824 hours of the initial set of observations \citep{WainscoatXXX}.
    180189
    181 \czwdraft{Should there be a discussion of any header keywords/OTA file formats?}
    182 
    183190Section \ref{sec:detrending} provides an overview of the detrending
    184191process that corrects the instrumental signatures of GPC1, with
     
    193200\ref{sec:discussion}.
    194201
    195 
    196 \czwdraft{Is this a sufficient explanation?  Also, is this the right
    197   place for it?}  Image products presented in figures have been
     202Image products presented in figures have been
    198203mosaicked to arrange pixels as follows.  Single cell images are
    199204arranged such that pixel $(1,1)$ is at the lower left corner.  Images
     
    222227\label{sec:detrending}
    223228
     229\czwdraft{Nigel: I forgot: when we are talking about the various bias corrections it might be
     230worth pointing out that we expect these to be more of an issue in the g-band
     231(and maybe r?) where read noise is a significant contributor.
     232}
     233
    224234Ensuring a consistent and uniform detector response across the
    225235three-degree diameter field of view of the GPC1 camera is essential to
     
    229239dependent detector glows, and flat field correction to remove pixel to
    230240pixel response functions.  We also construct fringe correction for the
    231 reddest data in the y filter, to remove the interference patterns that
     241reddest data in the \yps{} filter, to remove the interference patterns that
    232242arise in that filter due to the variations in the thickness of the
    233243detector surface.
     
    349359  \end{minipage}
    350360
    351   \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 g-filter with exposure times of 43s}
     361  \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}
    352362\end{figure}
    353363
     
    564574%  \end{subfigure}
    565575  \end{minipage}
    566   \caption{An example of the dark model application to exposure o5677g0123o, OTA23 (2011-04-26, 43s g-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.}
     576  \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.}
    567577\end{figure}
    568578
     
    570580  \centering
    571581  \includegraphics[width=0.9\hsize,angle=0,clip]{images/B_profile_ex.png}
    572   \caption{Example showing a profile cut across exposure o5676g0195, OTA67 (2011-04-25, 43s g-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.}
     582  \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.}
    573583  \label{fig:dark switching}
    574584\end{figure}
     
    627637%  \end{subfigure}
    628638  \end{minipage}
    629   \caption{An example of the video dark model application to exposure o5677g0123o, OTA22 (2011-04-26, 43s g-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 oversubtracted with the standard dark.}
     639  \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 oversubtracted with the standard dark.}
    630640  \label{fig:video_darks}
    631641\end{figure}
     
    642652noise to increase as the row is read out.  As a result of this
    643653increased noise, more sources are detected in the higher noise regions
    644 when the read noise is assumed constant across the readout.  To
     654when the read noise is assumed constant across the readout.  Read noise is the
     655
     656To
    645657mitigate this noise gradient, we constructed an initial set of
    646658noisemap images by measuring the median variance on bias frames.  The
     
    743755
    744756The PATTERN.ROW correction is used to remove any remaining row-by-row
    745 bias variation, and the PATTERN.CELL and PATTERN.CONTINUITY
    746 corrections attempt to ensure that the cells of a given OTA are
    747 consistent with the other cells on that OTA. 
     757bias variation, and the PATTERN.CONTINUITY correction attempts to
     758ensure that the cells of a given OTA are consistent with the other
     759cells on that OTA.
    748760
    749761\subsubsection{Pattern Row}
     762%% Statistics so I have them written down somewhere
     763%% chipProcessedImfile.bg/bg_stdev by filter for XY33 (a ``good'' chip)
     764%% filter  bg_mean stdev median Qsig                              bg_stdev_mean stdev median Qsig
     765%% g        36.37422026669   64.64175104057  32.693   6.10284     14.696938349131  78.80460307171  8.8401  0.5417843
     766%% r       200.96143304525  471.87743546238 117.105  94.55608     33.854672792146  79.01642728089 13.4564  5.3771355
     767%% i       447.00504994458  938.38517801037 286.810 154.71397     57.298335510188  99.38392923935 20.0217 24.2254723
     768%% z       317.54933679054  390.38930252748 241.014 114.13316     48.359069000176  94.44452756094 17.9404  9.1535209
     769%% y       371.09019536218  293.57439970375 288.481 133.38769     43.724342221691 135.04286534327 19.9029  7.5396461
     770
    750771% http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/GPC1_Bias_Pattern_Study
    751772As discussed above in the dark and noisemap sections, certain
     
    772793the sky.
    773794
     795These row-by-row variations have the largest impact on data taken in
     796the \gps{} filter, as the read noise is the dominant noise source in
     797that filter.  At longer wavelengths, the noise from the Poissonian
     798variation in the sky level increases.  Although the PATTERN.ROW correction is still applied to data taken in the other filters,
     799
    774800This correction was required on all cells on all OTAs prior to
    7758012009-12-01, at which point a modification of the camera electronics
     
    841867%  \end{subfigure}
    842868  \end{minipage}
    843   \caption{Example of the PATTERN.ROW correction on exposure o5379g0103o OTA57 cell xy00 (i-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.}
     869  \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.}
    844870\end{figure}
    845871
    846872\subsubsection{Pattern Continuity}
    847873
    848 As the PATTERN.CELL correction was insufficient in many situations, we
     874After previous attempts to ensure that adjacent cells on an OTA
     875matched background levels were insufficient in many situations, we
    849876designed a replacement correction that would reduce the background
    850877distortion for large objects.  In addition, studies of the background
     
    855882horizontally across an OTA, and as the background model fits a smooth
    856883sky level, this induces over and under subtraction at the cell
    857 boundaries.  As the PATTERN.CELL was designed to correct changes only
    858 in the median value between cells, it could not adequately resolve
    859 this higher order issue.
    860 
    861 The replacement for PATTERN.CELL is the PATTERN.CONTINUITY correction,
    862 which attempts to match the edges of a cell to those of its neighbors.
    863 For each cell, a thin box 10 pixels wide on each edge is extracted and
    864 the median value of unmasked values calculated for that box.  These
    865 median values are then used to construct a vector of differences
    866 $\Delta_i = \sum_{j} Edge_{i} - Edge_{j}$, along with a matrix of
    867 associations $A_{i,i'} = \sum_{j} \delta(i,j) \delta(j,i')$ denoting
    868 which cell boundaries are adjacent.  By solving the system $A x =
    869 diff$, we find the set of offsets $x_i$ to be applied to each cell to
    870 ensure the minimum differences between all cell edges and their
    871 neighbors.
     884boundaries. 
     885
     886The PATTERN.CONTINUITY correction, attempts to match the edges of a
     887cell to those of its neighbors.  For each cell, a thin box 10 pixels
     888wide on each edge is extracted and the median value of unmasked values
     889calculated for that box.  These median values are then used to
     890construct a vector of differences $\Delta_i = \sum_{j} \mathrm{Edge}_{i} -
     891\mathrm{Edge}_{j}$, along with a matrix of associations $A_{i,i'} = \sum_{j}
     892\delta(i,j) \delta(j,i')$ denoting which cell boundaries are adjacent.
     893By solving the system $A x = \Delta$, we find the set of offsets $x_i$
     894to be applied to each cell to ensure the minimum differences between
     895all cell edges and their neighbors.
    872896
    873897For OTAs that initially show the saw tooth pattern, the effect of this
     
    895919wavelength of the light becomes comparable to the thickness of the
    896920detectors.  Visually inspecting the images shows that the fringing is
    897 most prevalent in the y filter images, with negligible fringing in the
     921most prevalent in the \yps{} filter images, with negligible fringing in the
    898922other bands.  As a result of this, we only apply a fringe correction
    899 to the y filter data.
     923to the \yps{} filter data.
    900924
    901925The fringe used for PV3 processing was constructed from a set of 20
     
    925949  \centering
    926950  \begin{minipage}{0.5\hsize}
    927     \includegraphics[width=1.0\hsize,angle=0,clip]{images/o5220g0025o_XY53_nofringe.png}
    928 %    \caption{(a)}
    929 %  \end{subfigure}%
    930 %  \begin{subfigure}[]{.45\hsize}
     951    \includegraphics[width=1.5\hsize,angle=0,clip]{images/o5220g0025o_XY53_nofringe.png}
    931952  \end{minipage}%
    932953  \begin{minipage}{0.5\hsize}
    933     \includegraphics[width=1.0\hsize,angle=0,clip]{images/o5220g0025o_XY53_fringe.png}
    934 %    \caption{(b)}
    935 %  \end{subfigure}
     954    \includegraphics[width=1.5\hsize,angle=0,clip]{images/o5220g0025o_XY53_fringe.png}
    936955  \end{minipage}
    937   \caption{Example of the y-filter fringe pattern on exposure o5220g0025o OTA53 (y-filter 30s).  The left panel shows the OTA mosaic with all detrending except the fringe correction, while the right shows the same including the fringe correction.  Both images have been smoothed with a Gaussian with $\sigma = 3$ pixels to highlight the faint and large scale fringe patterns. \czwdraft{See if there's a way to have mana produce images larger than the screen size.}}
     956  \caption{Example of the \yps{} filter fringe pattern on exposure o5220g0025o OTA53 (\yps{} filter 30s).  The left panel shows the OTA mosaic with all detrending except the fringe correction, while the right shows the same including the fringe correction.  Both images have been smoothed with a Gaussian with $\sigma = 3$ pixels to highlight the faint and large scale fringe patterns. \czwdraft{See if there's a way to have mana produce images larger than the screen size.}}
    938957  \label{fig: fringe example}
    939958\end{figure}
     
    9831002The final step of mask construction is to examine the detector for
    9841003bright columns and other static pixel issues.  This is first done by
    985 processing a set of 100 i filter science images in the same fashion as
     1004processing a set of 100 \ips{} filter science images in the same fashion as
    9861005for the DARKMASK.  A median image is constructed from these inputs
    9871006along with the per-pixel variance.  These images are used to identify
     
    11241143Due to imperfections in the anti-reflective coating on the optical
    11251144surfaces of GPC1, bright sources can also result in large out of focus
    1126 objects, particularly in the g-filter data.  These objects are the
     1145objects, particularly in the \gps{} filter data.  These objects are the
    11271146result of light reflecting back off the surface of the detector,
    11281147reflecting again off the lower surfaces of the optics (particularly
     
    11821201  \tablehead{\colhead{Filter}&\colhead{$m_{inst}$}}
    11831202  \startdata
    1184   g & -16.5 \\
    1185   r & -20.0 \\
    1186   i & -25.0 \\
    1187   z & -25.0 \\
    1188   y & -25.0 \\
    1189   w & -20.0 \\
     1203  \gps{} & -16.5 \\
     1204  \rps{} & -20.0 \\
     1205  \ips{} & -25.0 \\
     1206  \zps{} & -25.0 \\
     1207  \yps{} & -25.0 \\
     1208  \wps{} & -20.0 \\
    11901209  \enddata
    11911210  \label{tab:ghost_magnitudes}
     
    11961215  \centering
    11971216  \includegraphics[width=0.9\hsize,angle=0,clip]{images/full_fpa_ghosts.jpg}
    1198   \caption{Example of the full GPC1 field of view illustrating the sources and destinations of optical ghosts on exposure o5677g0123o (2011-04-26, 43s g-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.}
     1217  \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.}
    11991218\end{figure}
    12001219
     
    12021221\label{sec:glints}
    12031222
    1204 Prior to \czwdraft{DATE}, a reflective surface at the edge of the
    1205 camera aperture was incompletely screened to light passing through the
     1223% I finally tracked it down:
     1224%% > On 8/26/2010 9:24 AM, John Tonry wrote:
     1225%% >
     1226%% > Gene,
     1227%% >
     1228%% > This is a bit of a case of the dog that didn't bark, but the shutter mask
     1229%% > went in on Tuesday.
     1230%% >
     1231%% > Can you can tell us whether
     1232%% >
     1233%% >  a) it's helped the shutter glint problem and
     1234%% >  b) whether there's any discernable vignetting anywhere?
     1235%% >
     1236%% > - John
     1237
     1238%% On Thu, Aug 26, 2010 at 4:00 PM, Chris Waters <watersc1@ifa.hawaii.edu>wrote:
     1239
     1240%% > I'm not entirely sure why I'm not on the ps-ipp mailing list, but
     1241%% > Heather forwarded this to me.  I compared 240 exposures from
     1242%% > 2010-08-22/ThreePi/y.00000 and 2010-08-25/ThreePi/y.00000.
     1243%% >
     1244%% > a) For the 22nd, I counted 28 star glints visible.  For the 25th, I
     1245%% > counted maybe 0-2 (I think the first is a conveniently placed satellite,
     1246%% > and the other has a companion, so I think it's actually a moon glint).
     1247%% >
     1248%% > b) I was going to compare flat field images, but we don't have any
     1249%% > from after the mask was applied.  Blinking between a few pairs of the
     1250%% > 240x2 exposures does not show any vignetting that I can detect from
     1251%% > the IPP jpeg mosaics.
     1252
     1253Prior to 2010-08-24, a reflective surface at the edge of the camera
     1254aperture was incompletely screened to light passing through the
    12061255telescope.  Sources brighter than $m_{inst} = -21$ that fell on this
    12071256reflective surface resulted in light being scattered across the
    12081257detector surface in a long narrow glint.  This surface was physically
    1209 masked on \czwdraft{DATE}, removing the possibility of glints in
    1210 subsequent data, but that taken prior have a dynamic mask constructed
     1258masked on 2010-08-24, removing the possibility of glints in subsequent
     1259data, but that taken prior have an advisory dynamic mask constructed
    12111260when a reference source falls on the focal plane within one degree of
    12121261the detector edge.  This mask is 150 pixels wide, with length $L =
     
    12441293  \centering
    12451294  \includegraphics[width=0.9\hsize,angle=0,clip]{images/glint_example_o5379g0103o.jpg}
    1246   \caption{Example of a glint on exposure o5379g0103o (2010-07-02, 45s i-filter).  The source star out of the field of view creates a long reflection that extends through OTA73 and OTA63.}
     1295  \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.}
    12471296\end{figure}
    12481297
     
    12711320  \centering
    12721321  \includegraphics[width=0.9\hsize,angle=0,clip]{images/o6802g0338o_XY51_b1.jpg}
    1273   \caption{Example of saturated star, with diffraction spikes extending from the core on exposure o6802g0338o, OTA51 (2014-05-25, 45s g-filter).}
     1322  \caption{Example of saturated star, with diffraction spikes extending from the core on exposure o6802g0338o, OTA51 (2014-05-25, 45s \gps{} filter).}
    12741323  \label{fig:saturated star}
    12751324\end{figure}
     
    12951344calculations to estimate the masking fraction.  The reference field of
    12961345view of GPC1 is 3 degrees, which at the nominal plate scale of 0.258
    1297 arcseconds per pixel, translates to a 20930 FPA pixel radius. \czwdraft{I need a percentage here.}
     1346arcseconds per pixel, translates to a 20930 FPA pixel radius.  Summing
     1347mask fractions from these three contributions within the unvignetted
     1348field of view results in an average of $\sim 20\%$ masking fraction
     1349across the field of view.  Dynamic masking adds an additional $2-3\%$
     1350on average, with advisory burntool masking contributing the largest
     1351single component.
     1352
    12981353
    12991354%% mysql> select filter,AVG(camProcessedExp.maskfrac_ref_static), AVG(camProcessedExp.maskfrac_ref_dynamic), AVG(camProcessedExp.maskfrac_ref_advisory), AVG(camProcessedExp.maskfrac_max_static),AVG(camProcessedExp.maskfrac_max_dynamic),AVG(camProcessedExp.maskfrac_max_advisory) from camRun join camProcessedExp USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) WHERE camRun.label = 'LAP.PV3.20140730.final' GROUP BY filter;
     
    13131368%%           |   0.21130344126869 | 0.00013634812877977 |     0.02163070300815 |
    13141369
    1315 Summing mask fractions from these three contributions within the
    1316 unvignetted field of view results in an average of $\sim 20\%$ masking
    1317 fraction across the field of view.  Dynamic masking adds an additional
    1318 $2-3\%$ on average, with advisory burntool masking contributing the
    1319 largest single component.
    13201370
    13211371\subsection{Background subtraction}
    13221372\label{sec:background}
     1373
     1374\czwdraft{Nigel: 2.10 The background section is rather short, given all the fuss DRAVG made
     1375about it. What is done to eliminate contamination by bright objects - isn't
     1376there some sort of clipping? We also have a confusing number of ``bins'' in the
     1377text (``These bins have 10000 .... a binned cumulative distribution is
     1378generated. These bins are interpolated ... levels. Repeating this across all
     1379bins ...''). There is no mention of the fact that this will subtract real
     1380astrophysics backgrounds if they are on a suitably large scale, or of the fact
     1381that the subtraction is not perfect (don't I remember that the stacks end up
     1382with a non-zero background which scales with the number of input warps?).
     1383}
     1384
     1385\czwdraft{Based on the wiki page on 2014-05-21 the stack background issue should be resolved.}
    13231386
    13241387Once all other detrending is done, the pixels from each cell are
    13251388mosaicked into the full $4846\times{}4868$ pixel OTA image.  A
    13261389background model for the full OTA is then determined prior to the
    1327 photometric analysis.  The mosaicked image is binned into
    1328 $800\times{}800$ pixel bins, centered on the image center, and
    1329 overlapping by a factor of 2 in both axes.  These bins have 10000
    1330 random samples drawn, and a binned cumulative distribution function is
    1331 generated.  These bins are interpolated to find the best mean value at
    1332 the $50\%$ level, as well as the distribution $\sigma$ by estimating
    1333 from the $32\%$ and $68\%$ levels.  Repeating this across all bins
    1334 results in a $13\times{}13$ grid of background bins, which are
    1335 bilinearly interpolated to generate the background model to subtract.
    1336 Each object in the photometric catalog has a SKY and SKY\_SIGMA value
    1337 based on this model as well.
     1390photometric analysis.  The mosaicked image is subdivided into
     1391$800\times{}800$ pixel segments that define each pixel of the
     1392background model, with the segments centered on the image center, and
     1393overlapping adjacent subdivisions by 400 pixels.  These overlaps help
     1394smooth the background model, as adjacent model pixels share input
     1395pixels.
     1396
     1397From each subdivision, 10000 random unmasked pixels are drawn.  In the
     1398case where the mask fraction is large (such as on OTAs near the edge
     1399of the field of view), and there are insufficient unmasked pixels to
     1400meet this criterion, all possible unmasked pixels are used instead.
     1401If this number is still small (less than 100 good pixels), the
     1402subdivision does not have a background model calculated, and instead,
     1403the value assigned to that model pixel is set as the average of the
     1404adjacent model pixels.  This allows up to eight neighboring background
     1405values to be used to patch these bad pixels.
     1406
     1407For the remaining subdivisions that have sufficient unmasked pixels
     1408for the background to be measured, the pixel values are used to
     1409calculate a set of robust statistics for the initial background guess.
     1410The minimum and maximum of the values are found, and checked to ensure
     1411that these are not the same value, which would indicate some problem
     1412with the input values.  The values are then inserted into a histogram
     1413with 1000 bins between the minimum and maximum values, and again
     1414checked for issues with the inputs by ensuring that the bin with the
     1415most input pixels does not contain more than half of the input values.
     1416In this case, the minimum and maximum do not constrain the true
     1417distribution of the input values well, and any values outside of the
     141820 bins closest to the bin with the peak are masked for future
     1419consideration.  A cumulative distribution is then constructed from the
     1420histogram, which saves the computational cost of sorting all the input
     1421values.  The bins containing the 50-percentile point, as well as the
     142215.8\%, 84.1\% ($\pm 1 \sigma$), 30.8\%, 69.1\% ($\pm 0.5 \sigma$),
     14232.2\%, and 97.7\% ($\pm 2 \sigma$) points are identified in this
     1424cumulative histogram.  These bins, and the two bins to either side are
     1425then linearly interpolated to identify the pixel value corresponding
     1426to these points in the distribution.  The 50\% point is set as the
     1427median of the pixel distribution, with the standard deviation of the
     1428distribution set as the median of the $\sigma$ values calculated from
     1429the $0.5 * (\sigma_{+1} - \sigma_{-1})$, $\sigma_{+0.5} -
     1430\sigma_{-0.5}$, and $0.25 * (\sigma_{+2} - \sigma_{-2})$ differences.
     1431If this measured standard deviation is smaller than 3 times the bin
     1432size, then all points more than 25 bins away from the calculated
     1433median are masked, and the process is repeated until the bin size is
     1434sufficiently small to ensure that the distribution width is well
     1435sampled.  Once this iterative process converges, or 20 iterations are
     1436run, the 25- and 75-percentile values are found by interpolating the 5
     1437bins around the expected bin as well, and the count of the number of
     1438input values within this inner 50-percentile region, $N_{50}$ is
     1439calculated.
     1440
     1441These initial statistics are then used as the starting guesses for a
     1442second calculation of the background level that attempts to fit the
     1443distribution with a Gaussian.  All pixels that were masked in the
     1444initial calculation are unmasked, and a histogram is again constructed
     1445of the values, with a binsize set to $\sigma_{guess} / \left( N_{50} /
     1446500 \right)$.  With this binsize, we expect that a bin at $\pm 2
     1447\sigma$ will have approximately 50 input points, which gives a
     1448Poissonian signal to noise estimate around 7.  In the case where
     1449$N_{50}$ is small (due to a poorly populated input image), this bin
     1450size is fixed to be no larger than the guess of the standard
     1451deviation.  The endpoints of the histogram are clipped based on the
     1452input guesses, such that any input point with a value more than $5
     1453\sigma_{guess}$ away from the input mean are excluded from
     1454consideration. 
     1455
     1456Two second order polynomial fits are then performed to the logarithm
     1457of the histogram counts set at the midpoint of each bin.  The first
     1458fit considers the ``lower half'' of the distribution, under the
     1459assumption that deviations from a normal distribution are caused by
     1460real astrophysical sources that will be brighter than the true
     1461background level.  From the bin with most pixel values, the lower
     1462bound is set by searching for the first bin from the peak that has
     1463fewer inputs than 25\% of the peak.  A similar search is performed for
     1464the upper bound, but with a criterion that the bin has fewer than 50\%
     1465of the peak.  On both sides of the peak, the bounds are adjusted to
     1466ensure that at least seven bins, equally distributed around the peak,
     1467are used.  The second fit is symmetric, fitting both sides of the
     1468distribution out to the point where the bin contains fewer than 15\%
     1469of the peak value.  The same seven-bin constraint is used for this
     1470fit.  The Gaussian mean and standard deviation are calculated from the
     1471polynomial coefficients, and the symmetric fit results are accepted
     1472unless the lower-half fit results in a smaller mean.  This process is
     1473repeated again if the calculated standard deviation is not larger than
     147475\% of the initial guess (suggesting an issue with the initial bin
     1475size).
     1476
     1477With this two-stage calculation performed across all subdivisions of
     1478the mosaicked OTA image, and missing model pixels filled with the
     1479average of their neighbors, the final background model is stored on
     1480disk as a $13\times{}13$ image with header entries listing the binning
     1481used.  The full scale background image is then constructed by
     1482binlinearly interpolating this binned model, and this is subtracted
     1483from the science image.  Each object in the photometric catalog has a
     1484SKY and SKY\_SIGMA value that is the evaluation of this model at the
     1485location of that object.
     1486
     1487Although this background modeling process works well for most of the
     1488sky, astronomical sources that are large compared to the
     1489$800\times{}800$ pixel subdivisions can bias the calculated background
     1490level high, resulting in an oversubtraction near that object.  The
     1491most common source that can cause this issue are large galaxies, which
     1492can have their own features modeled as being part of the background.
     1493For the specialized processing of M31, which covers an entire pointing
     1494of GPC1, the measured background was added back to the \ippstage{chip}
     1495stage images, but this special processing was not used for the large
     1496scale $3\Pi$ PV3 reduction.
    13381497
    13391498%% * Magic
     
    14521611            & 964  & 2010-09-01 00:00:00 & 2011-05-01 00:00:00 & \\
    14531612            & 965  & 2011-05-01 00:00:00 & & \\
    1454   FLAT      & 300  & 2009-12-09 00:00:00 & & g filter \\
    1455             & 301  & 2009-12-09 00:00:00 & & r filter \\
    1456             & 302  & 2009-12-09 00:00:00 & & i filter \\
    1457             & 303  & 2009-12-09 00:00:00 & & z filter \\
    1458             & 304  & 2009-12-09 00:00:00 & & y filter \\
     1613  FLAT      & 300  & 2009-12-09 00:00:00 & & \gps{} filter \\
     1614            & 301  & 2009-12-09 00:00:00 & & \rps{} filter \\
     1615            & 302  & 2009-12-09 00:00:00 & & \ips{} filter \\
     1616            & 303  & 2009-12-09 00:00:00 & & \zps{} filter \\
     1617            & 304  & 2009-12-09 00:00:00 & & \yps{} filter \\
     1618            & 305  & 2009-12-09 00:00:00 & & \wps{} filter \\
    14591619  FRINGE    & 296  & 2009-12-09 00:00:00 & & \\
    14601620  ASTROM    & 1064 & 2008-05-06 00:00:00 & & \\
     
    15301690name, and the SEC keyword lists the image section corresponding to the
    15311691locally linear grid box.  The MPX and MPY contain the transformation
    1532 parameters for the locally linear grid.  \czwdraft{Is this accurate?}
     1692parameters for the locally linear grid.  These parameters are stored
     1693in a string listing the reference position in the chip coordinate
     1694frame, the slope of the relation in the warp x axis, and the slope of
     1695the relation in the warp y axis.  From these keywords, any position in
     1696the warp can be mapped back to the location in any of the input OTA
     1697images.
     1698
     1699\begin{figure}
     1700  \centering
     1701  \includegraphics[width=0.9\hsize,angle=0,clip]{images/warp_1046511_sci.jpg}
     1702  \caption{Example of the warp image for skycell skycell.2047.005
     1703    centered at ($\alpha,\delta$) = (179.763, 32.1899) for exposure
     1704    o4985g0073o, (2009-06-03, 30s \zps{} filter).  The data from six
     1705    OTAs contribute to this image, although they are all truncated by
     1706    the skycell boundaries.  This skycell image is aligned such that
     1707    north points to the top of the image, and east to the left.  The
     1708    contributing OTAs are from the right half of the detector, with
     1709    OTA24 contributing the most pixels, and originally have the
     1710    positive y axis pointing to the southwest in this warped image,
     1711    with the positive x axis to the northwest.}
     1712  \label{fig:warp image}
     1713\end{figure}
     1714
     1715\begin{figure}
     1716  \centering
     1717  \includegraphics[width=0.9\hsize,angle=0,clip]{images/warp_1046511_wt.jpg}
     1718  \caption{Example of the warp variance image for skycell
     1719    skycell.2047.005 of exposure o4985g0073o, the same as in Figure
     1720    \ref{fig:warp image}.  This variance map retains information about
     1721    the higher flux levels that were found in burntool corrected
     1722    persistence trails, which appear here as streaks along the
     1723    original OTA y axis.  The amplifier glows that are corrected in
     1724    the dark model are also more visible in the corners of the cells
     1725    in OTA24.  As both of these effects are corrected in the science
     1726    image, there are no significant features visible there.}
     1727  \label{fig:warp variance}
     1728\end{figure}
     1729
     1730\begin{figure}
     1731  \centering
     1732  \includegraphics[width=0.9\hsize,angle=0,clip]{images/warp_1046511_sci.jpg}
     1733  \caption{Example of the warp mask image for skycell skycell.2047.005
     1734    of exposure o4985g0073o, the same as in Figure \ref{fig:warp
     1735      image}.  This mask image shows the many small defects removed
     1736    from the image, along with larger advisory trails on corrected
     1737    burntool trails.  The saturated cores of the bright stars are also
     1738    masked, along with the diffraction spikes found on these stars.
     1739    In addition OTA24 shows the precautionary crosstalk bleed masks
     1740    for the two brightest stars applied to all cells within the same
     1741    row.}
     1742\end{figure}
     1743
    15331744
    15341745% Read all images and astrometry
     
    15581769system, they can then be combined pixel-by-pixel regardless of their
    15591770original orientation.  Creating a stacked image by coadding the
    1560 individual warps increases the signal to noise, allowing objects
    1561 fainter than the single image signal to noise threshold.  Creating
    1562 this stack also allows a complete image to be constructed that does
    1563 not have regions masked due to the gaps between cells and OTAs.  This
    1564 fully populated static sky image can also be used as a template for
    1565 subtraction to find transient sources.
     1771individual warps increases the signal to noise, allowing for the
     1772detection of objects that would not be sufficiently significant to be measured from a single image.
     1773Creating this stack also allows a complete image to be
     1774constructed that does not have regions masked due to the gaps between
     1775cells and OTAs.  This fully populated static sky image can also be
     1776used as a template for subtraction to find transient sources.
    15661777
    15671778The stacked image is comprised of all warp frames for a given skycell
     
    15721783Once all files are ingested, the first step is to measure the size and
    15731784shapes of the input image PSFs.  We exclude images that have a PSF
    1574 FWHM greater than 10 pixels, as those images have the seeing far worse
    1575 than average, and would degrade the final output stack.  For the PV3
    1576 survey, this size represents a PSF larger than $97$th percentile in
    1577 all filters.  A target PSF for the stack is constructed by finding the
    1578 maximum envelope of all input PSFs, which sets the target PSF to the
    1579 largest value among the input PSFs for a given position from the peak.
    1580 This PSF is then circularized to ensure azimuthal symmetry, which
    1581 prevents any of the input images from being deconvolved when matched
    1582 to the target.
    1583 
    1584 The input images also need to have their flux normalized to prevent
     1785FWHM greater than 10 pixels (2.5 arcseconds), as those images have the
     1786seeing far worse than average, and would degrade the final output
     1787stack.  For the PV3 $3\Pi$ survey, this size represents a PSF larger
     1788than the $97$th percentile in all filters.  A target PSF for the stack
     1789is constructed by finding the maximum envelope of all input PSFs,
     1790which sets the target PSF to the largest value among the input PSFs
     1791for a given position from the peak.  This PSF is then circularized to
     1792ensure azimuthal symmetry, which prevents deconvolution of any of the
     1793input images when matched to the target.
     1794
     1795The input images also need to have their fluxes normalized to prevent
    15851796differences in seeing and sky transparency from causing discrepancies
    1586 during pixel rejection.  From the calibrated input catalogs, we have
    1587 the instrumental magnitudes of all sources, along with the airmass,
    1588 image exposure time, and zeropoint.  All output stacks are calibrated
    1589 to a zeropoint of 25.0 in all filters, and to have an airmass of 1.0.
    1590 The output exposure time is set to the sum of the input exposure
    1591 times.  We can determine the relative transparency for each input
    1592 image by comparing the magnitudes of matched sources between the
    1593 different images.  Each image then has a normalization factor defined,
    1594 equal to $norm_{i} = (ZP_{i} - ZP_{target}) - transparency_{i} - 2.5 *
    1595 \log_{10} (t_{target} / t_{i}) - airmassTerm * (airmass_{i} -
    1596 airmass_{target})$.  \czwdraft{ZP.AIRMASS is zero for all filters.
    1597   Does this simply mean that we assume any airmass differences are
    1598   folded into the transparency differences?  This would simplify this
    1599   discussion quite a bit if that's the case, as we can just say that
    1600   and skip all the extra airmass terms.}
     1797during pixel rejection.  From the reference catalog calibrated input
     1798catalogs, we have the instrumental magnitudes of all sources, along
     1799with the airmass, image exposure time, and zeropoint.  All output
     1800stacks are calibrated to a zeropoint of 25.0 in all filters, and to
     1801have an airmass of 1.0.  The output exposure time is set to the sum of
     1802the input exposure times, regardless of if those inputs are rejected
     1803later in the combination process.  We can determine the relative
     1804transparency for each input image by comparing the magnitudes of
     1805matched sources between the different images.  Each image then has a
     1806normalization factor defined, equal to $\mathrm{norm}_{input} = (ZP_\mathrm{input}
     1807- ZP_\mathrm{target}) - \mathrm{transparency}_\mathrm{input} - 2.5 *
     1808\log_{10} (t_\mathrm{target} / t_\mathrm{input}) -
     1809\mathrm{F}_\mathrm{airmass} * (\mathrm{airmass}_\mathrm{input} -
     1810\mathrm{airmass}_\mathrm{target})$.  For the PV3 processing, the
     1811airmass factor $\mathrm{F}_\mathrm{airmass}$ was set to zero, such
     1812that all flux differences from differing exposure airmasses are
     1813assumed to be included in the zeropoint and transparency values.
     1814
     1815
     1816\czwdraft{Nigel: 5. ``The ouput exposure time is set to the sum of the input exposure times.''
     1817True, but we should note that as warps can be rejected later on in the
     1818stacking process this output time is notional in some sense.
     1819Calibration - for PV3 what photometric calibration has been used at this stage
     1820for the input warps? Should we make it clear here that pixels are not subject
     1821to the final (any?) ubercal?
     1822}
    16011823
    16021824% PREPARE
     
    16361858convolution kernels can be calculated for each image.  ISIS kernels
    16371859\citep{ISIS_kernels} are used with FWHM values of 1.5, 3.0, and 6.0
    1638 pixels and polynomial orders of 6, 4, and 2.  \czwdraft{Skipping this
    1639   bit because I'm not completely sure I understand it.}  The image is
    1640 then scaled by the normalization as $renorm = 10^{-0.4 * norm_{image}}
    1641 / norm_{convolution}$, and the variance by the square of that value.
    1642 
     1860pixels and polynomial orders of 6, 4, and 2.  Regions around the
     1861sources identified in the input images are extracted, convolved with
     1862the kernel, and the residual with the target PSF used to update the
     1863parameters of the kernel via least squares optimization.  Stamps that
     1864significantly deviate are rejected, but as the squared residual
     1865difference will increase with increasing source flux.  To mitigate
     1866this effect, a parabola is fit to the distribution of squared
     1867residuals as a function of source flux.  Stamps that deviate from this
     1868fit by more than $2.5\sigma$ are rejected, and not used on further
     1869kernel fit iterations.  This process is repeated twice, and the final
     1870convolution kernel is returned.
     1871
     1872This convolution may change the image flux scaling, so a normalization
     1873factor is used to correct this.  This normalization factor is equal to
     1874the ratio of $10^{-0.4 \mathrm{norm}_{input}}$ to the sum of the
     1875kernel.  The image is multiplied by this factor, and the variance by
     1876the square of it, scaling all inputs to the common zeropoint.
    16431877
    16441878% MATCH
     
    16511885Once the convolution kernels are defined for each image, they are used
    16521886to convolve the image to match the target PSF.  Any input image that
    1653 has a $\chi^2$ value greater than 4.0$\sigma$ larger than the median
    1654 value is rejected from the stack.  Each image also has a weight
    1655 assigned, based on the image variance after convolution.  For a given
    1656 image, the weight is equal to $W^{-1} = \langle Variance(x,y) \rangle
    1657 * f_{covariance}$, where the angle brackets denote a robust median of
    1658 the variance image, and the covariance factor $f_{covariance}$ is the
    1659 peak value of the covariance matrix of the convolution.
     1887has a kernel match $\chi^2$ value greater than 4.0$\sigma$ larger than
     1888the median value is rejected from the stack.  Each image also has a
     1889weight assigned, based on the image variance after convolution.  A
     1890full image weight is then calculated for each input, with the weight,
     1891$W_\mathrm{input}$ is equal to the inverse of the median of the image
     1892variance multiplied by the peak of the image covariance (due to the
     1893warping process).
    16601894
    16611895% CONVOLVE
     
    16851919
    16861920\begin{eqnarray}
    1687   S_{value} &=& \sum_i\left(value_{i} * W_i\right) / \sum_i\left(W_i\right) \\
    1688   S_{exp weight} &=& \sum_i \left(exptime_i * W_i\right) / \sum_i\left(W_i\right) \\
     1921  \mathrm{Stack}_\mathrm{value} &=& \sum_i\left(\mathrm{value}_\mathrm{input} * W_\mathrm{input}\right) / \sum_\mathrm{inputs}\left(W_\mathrm{input}\right) \\
     1922  \mathrm{Stack}_\mathrm{exp weight} &=& \sum_i \left(\mathrm{exptime}_\mathrm{input} * W_\mathrm{input}\right) / \sum_\mathrm{inputs}\left(W_\mathrm{input}\right) \\
    16891923\end{eqnarray}
    16901924
     
    16921926
    16931927\begin{eqnarray}
    1694   S_{variance} &=& 1 / \sum_i \left( 1 / variance_i \right)
     1928  \mathrm{Stack}_\mathrm{variance} &=& 1 / \sum_i \left( 1 / \sigma^2_\mathrm{input} \right)
    16951929\end{eqnarray}
    16961930
     
    17662000to reject higher pixel values than lower pixel values.
    17672001
    1768 Following this initial combination, a ``testing'' loop iterates in an
     2002Following the initial combination, a ``testing'' loop iterates in an
    17692003attempt to identify outlier points.  Again, if only one input is
    17702004available, that input is accepted.  If there are two inputs, $A$ and
    1771 $B$, then a check is made to see if $(0.5 * (value_A - value_B))^2 >
    1772 rej^2 * (variance_A + variance_B + (sys * value_A)^2 + (sys *
    1773 value_B)^2)$, where $rej$ is the number of sigmas deviant a point needs
    1774 to be to be excluded, set to 4.0 for the PV3 processing, and $sys$ is
    1775 an estimate of the systematic error, taken to be 0.1.
     2005$B$, then a check is made to see if $(0.5 * (\mathrm{value}_A -
     2006\mathrm{value}_B))^2 > 16 * (\sigma^2_A + \sigma^2_B
     2007+ (0.1 * \mathrm{value}_A)^2 + (0.1 * \mathrm{value}_B)^2)$, such that
     2008the deviation of the inputs from their mean position is greater than
     2009four times the sum of their measured uncertainties and a 10\%
     2010systematic error term.  If this is the case, neither input is trusted,
     2011and both are flagged for rejection
    17762012
    17772013If the number of inputs is larger than 6, then a Gaussian mixture
     
    17872023input values are passed to an Olympic weighted mean calculation.  We
    17882024reject $20\%$ of the number of inputs through this process.  The
    1789 number of bad inputs is set to $N_{bad} = 0.2 * N_{input} + 0.5$, with
    1790 the 0.5 term ensuring at least one input is rejected.  This number is
    1791 further separated into the number of low values to exclude $N_{low} =
    1792 N_{bad} / 2$, which will default to zero if there are few inputs, and
    1793 $N_{high} = N_{input} + N_{low} - N_{bad}$.  After sorting the input
    1794 values to determine which values fall into the low and high groups,
    1795 the remaining input values are used in a weighted mean using the image
    1796 weights above.
     2025number of bad inputs is set to $N_\mathrm{bad} = 0.2 *
     2026N_\mathrm{input} + 0.5$, with the 0.5 term ensuring at least one input
     2027is rejected.  This number is further separated into the number of low
     2028values to exclude $N_\mathrm{low} = N_\mathrm{bad} / 2$, which will
     2029default to zero if there are few inputs, and $N_\mathrm{high} =
     2030N_\mathrm{input} + N_\mathrm{low} - N_\mathrm{bad}$.  After sorting
     2031the input values to determine which values fall into the low and high
     2032groups, the remaining input values are used in a weighted mean using
     2033the image weights above.
    17972034
    17982035A systematic variance term is necessary to correctly scale how
     
    18042041
    18052042\begin{eqnarray}
    1806   limit_{mixture model} &=& 4^2 * (variance_i + \sigma_{MM}^2) \\
    1807   limit_{default} &=& 4^2 * (variance_i + (0.1 * value_i)^2)
     2043  \mathrm{limit}_\mathrm{mixture model} &=& 4^2 * (\sigma^2_\mathrm{input} + \sigma_\mathrm{mixture model}^2) \\
     2044  \mathrm{limit}_\mathrm{default} &=& 4^2 * (\sigma^2_\mathrm{input} + (0.1 * \mathrm{value}_\mathrm{input})^2)
    18082045\end{eqnarray}
    18092046
    18102047Each input pixel is then compared against this limit, and the most
    1811 discrepant pixel that has $(value_i - mean)^2$ exceeding this limit is
    1812 identified.  If there are suspect pixels in the set those pixels are
    1813 marked for rejection, otherwise this worst pixel is marked for
    1814 rejection.  Following this, the combine and test loop is repeated for
    1815 until no more pixels are rejected, up to a maximum number of
    1816 iterations equal to $50\%$ of the number of inputs.
     2048discrepant pixel that has $(\mathrm{value}_\mathrm{input} -
     2049\mathrm{mean})^2$ exceeding this limit is identified.  If there are
     2050suspect pixels in the set, those pixels are marked for rejection,
     2051otherwise this worst pixel is marked for rejection.  Following this,
     2052the combine and test loop is repeated for until no more pixels are
     2053rejected, up to a maximum number of iterations equal to $50\%$ of the
     2054number of inputs.
    18172055
    18182056% combineTest
     
    18482086
    18492087With the initial list of rejected pixels generated, a rejection mask
    1850 is made by constructing an empty image that has the rejected pixels
    1851 set to a value of 1.0.  This image is then convolved with a 5 pixel
    1852 FWHM zeroth-order ISIS kernel.  Any pixels that are above the threshold of
    1853 0.5 after this mask convolution are marked as bad and will be rejected in the final combination.
    1854 If more than 10\% of all pixels from an input image are rejected, then
    1855 that entire image is rejected as well.
     2088is made for the input warp by constructing an empty image that has the
     2089rejected pixels from that input set to a value of 1.0.  This image is
     2090then convolved with a 5 pixel FWHM zeroth-order ISIS kernel.  Any
     2091pixels that are above the threshold of 0.5 after this mask convolution
     2092are marked as bad and will be rejected in the final combination.  If
     2093more than 10\% of all pixels from an input image are rejected, then
     2094the entire image is rejected as it likely has some systematic issue.
    18562095
    18572096% PIXEL REJECTION
     
    18622101
    18632102
    1864 \czwdraft{I'm not entirely sure why we do what appears to be a similar
    1865   operation twice.  It also seems odd that this is in the CombineFinal
    1866   step, and not in the Reject step.}  Finally, the rejected pixels are
    1867 allowed to grow to include pixels that are neighbors to many rejected
    1868 pixels.  The ISIS kernel used in the previous step is used to
     2103Finally, a second pass at rejecting pixelsis conducted, by growing the
     2104current list to include pixels that are neighbors to many rejected
     2105pixels.  The ISIS kernel used in the previous step is again used to
    18692106determine the largest square box that contains under the limit of
    1870 $0.25 * \sum_{x,y} kernel^2$.  This box is then convolved with the
    1871 rejected pixel mask to reject the neighboring pixels.  This final list of
    1872 rejected pixels is passed to the final combination, which creates the
    1873 final stack values from the weighted mean of the non-rejected pixels.
    1874 Six total images are constructed for this final stack: the image, its
    1875 variance, a mask, a map of the exposure time per pixel, that exposure
    1876 time map weighted by the input image weight, and a map of the number
    1877 of inputs per pixel.
     2107$0.25 * \sum_{x,y} kernel^2$.  This square box is then convolved with
     2108the rejected pixel mask to reject the neighboring pixels.  This final
     2109list of rejected pixels is passed to the final combination, which
     2110creates the final stack values from the weighted mean of the
     2111non-rejected pixels.  Six total images are constructed for this final
     2112stack: the image, its variance, a mask, a map of the exposure time per
     2113pixel, that exposure time map weighted by the input image weight, and
     2114a map of the number of inputs per pixel.
    18782115
    18792116% FINAL COMBINE
     
    19452182such that: $L = \mathrm{BOFFSET} + \mathrm{BSOFTEN} \cdot \left(\exp(C
    19462183/ \alpha) - \exp(-C / \alpha)\right)$.
     2184
     2185\begin{figure}
     2186  \centering
     2187  \includegraphics[width=0.9\hsize,angle=0,clip]{images/stack_3775944_sci.jpg}
     2188  \caption{Example of the stack image for skycell skycell.2047.005
     2189    centered at ($\alpha,\delta$) = (179.763, 32.1899) in the \zps{}
     2190    filter, stack\_id 3775944.  This stack includes 25 input images,
     2191    including o4985g0073o the warp image in Figure \ref{fig:warp
     2192      image}, and has a combined exposure time of 870s.  Combining
     2193    such a large number of input images removes the inter-cell and
     2194    inter-chip gaps, providing a fully populated image.  In addition,
     2195    the combined signal allows many more faint objects to be found
     2196    than were visible on the single frame warp image.}
     2197
     2198  \label{fig:stack image}
     2199\end{figure}
     2200
     2201\begin{figure}
     2202  \centering
     2203  \includegraphics[width=0.9\hsize,angle=0,clip]{images/stack_3775944_mask.jpg}
     2204  \caption{Example of the stack mask image for skycell
     2205    skycell.2047.005 centered at ($\alpha,\delta$) = (179.763,
     2206    32.1899) in the \zps{} filter, stack\_id 3775944.  The entire
     2207    frame is largely unmasked after combining inputs, with the only
     2208    remaining masks falling on the cores of bright stars, and in small
     2209    regions around the brighest objects where the overlapping of
     2210    diffraction spike masks have removed all inputs.}
     2211
     2212  \label{fig:stack mask image}
     2213\end{figure}
     2214
     2215\begin{figure}
     2216  \centering
     2217  \includegraphics[width=0.9\hsize,angle=0,clip]{images/stack_3775944_wt.jpg}
     2218  \caption{Example of the stack variance image for skycell
     2219    skycell.2047.005 centered at ($\alpha,\delta$) = (179.763,
     2220    32.1899) in the \zps{} filter, stack\_id 3775944.  The variance
     2221    map for this stack is reasonably smooth, with the mottled pattern
     2222    from the inter-chip and inter-cell gaps printing through.  Some
     2223    regions with higher variance are found where the number of inputs
     2224    is lower.}
     2225
     2226  \label{fig:stack wt image}
     2227\end{figure}
     2228
     2229\begin{figure}
     2230  \centering
     2231  \includegraphics[width=0.9\hsize,angle=0,clip]{images/stack_3775944_num.jpg}
     2232  \caption{Example of the stack number image for skycell
     2233    skycell.2047.005 centered at ($\alpha,\delta$) = (179.763,
     2234    32.1899) in the \zps{} filter, stack\_id 3775944.  This map shows
     2235    the number of inputs contributing to each pixel of the output
     2236    stack.  Again, the pattern of the inter-chip and inter-cell gaps
     2237    is visible, along with the mask pattern of regions with CTE
     2238    problems (visible in the upper right corner). }
     2239
     2240  \label{fig:stack num image}
     2241\end{figure}
     2242
     2243\begin{figure}
     2244  \centering
     2245  \includegraphics[width=0.9\hsize,angle=0,clip]{images/stack_3775944_exp.jpg}
     2246  \caption{Example of the stack exposure time image for skycell
     2247    skycell.2047.005 centered at ($\alpha,\delta$) = (179.763,
     2248    32.1899) in the \zps{} filter, stack\_id 3775944.  As all input
     2249    warps had the same 30s exposure time, this map essentially
     2250    recreates the number map, with units of seconds of exposure
     2251    instead of number of inputs contributing to a given pixel.}
     2252
     2253  \label{fig:stack exp image}
     2254\end{figure}
     2255
     2256\begin{figure}
     2257  \centering
     2258  \includegraphics[width=0.9\hsize,angle=0,clip]{images/stack_3775944_expwt.jpg}
     2259  \caption{Example of the stack weighted exposure image for skycell
     2260    skycell.2047.005 centered at ($\alpha,\delta$) = (179.763,
     2261    32.1899) in the \zps{} filter, stack\_id 3775944.  This map shows
     2262    the weighted average exposure time, as described in the text.  It
     2263    is similar to the simple exposure time map, but shows how some
     2264    input exposures have their contributions weighted down due to the
     2265    observed larger image variances.}
     2266
     2267
     2268  \label{fig:stack exp wtimage}
     2269\end{figure}
     2270
     2271
     2272
     2273
     2274
     2275
    19472276
    19482277\section{Discussion}
Note: See TracChangeset for help on using the changeset viewer.