%+
% Name:
%   memo_bpix_status_bits_1.9.tex
%
% Usage:
%   latex memo_bpix_status_bits_1.9.tex
%
% Description:
%   This document describes the meaning of the STATUS bits of an ACIS bpix1
%   file.
%
% Input:
%
% Output:
%
% Notes:
%
% History:
%   10 Sep 02, created, Glenn E. Allen
%   30 Jun 04, updated bits 7, 14, and 15 (v1.3), GEA
%   15 Oct 04, added bit 16 (v1.4), GEA 
%   27 Oct 04, added bit 17 (v1.5), GEA
%   15 Dec 04, removed bit 17 (v1.6), GEA
%   20 May 05, some STATUS bits are obsolete (v1.7), GEA
%   23 Aug 05, added Table 2 (v1.8), GEA
%-

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

% 1. Declarations

\documentclass{article}

\usepackage{changebar}
\usepackage{cxo-memo-logo,gea}
\usepackage[dvips]{graphics}

\begin{document}

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

% 2. Header

\memobasic{
   Martin Elvis, SDS Group Leader }{
   Glenn E.\ Allen, SDS ACIS Scientist }{
   ACIS Bad-pixel STATUS Bits }{
   1.9 }{
   http://space.mit.edu/CXC/docs/docs.html\#bpixbits }{
   /nfs/cxc/h2/gea/sds/docs/memos/memo\_bpix\_status\_bits\_1.9.tex }

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

% 3. Body

\vspace*{0.3in} The thirty-two bits of the column STATUS of an ACIS
bad-pixel file (\eg\ *\_bpix1.fits) are used to describe why a pixel or
column is designated as ``bad.'' Events that occur on a bad pixel have a
STATUS bit set to one in the Level 1 event data file and are excluded from
the Level 2 event data file.  Since a bad-pixel file for an observation is
the union of pixels and columns identified as bad for many observations in a
bad-pixel ARD file and pixels that are identified as bad for the observation
(\eg\ are identified as such by acis\_find\_hotpix and
acis\_classify\_hotpix), the Level 1 bad-pixel file (not the bad-pixel ARD
file in the CALDB) should be used to produce an instrument map and an
imaging or grating ARF for the observation.

Unless otherwise indicated, the descriptions in the table below apply to
TIMED mode observations.  For continuous-clocking mode observations, bad
pixels (and columns) are considered bad columns.

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

% 4. STATUS bits

\section{STATUS bits}

\begin{table}[h]
\begin{center}
\begin{tabular}{|c|c|l|}
\multicolumn{3}{c}{Table 1} \\
\hline
STATUS
   & Integer
   & 
   \\
Bit
   & Representation$^{\dag}$
   & \hfil Condition(s) for which the STATUS bit is set to one \hfil
   \\
\hline
\
   & 
   &
   \\
0
   & 1
   & \parbox[t]{4.47in}{
     The pixel is identified as bad in the CALDB bad-pixel ARD file.
     \\
     }
   \\
1
   & 2
   & \parbox[t]{4.47in}{
     Part or all of the column is identified as bad in the CALDB bad-pixel
     ARD file. 
     \\
     }
   \\
2
   & 4
   & \parbox[t]{4.47in}{
     A bias-parity error occurred for the pixel.
     \\
     }
   \\
3
   & 8
   & \parbox[t]{4.47in}{
     The bias value for the pixel is 4095.  This condition indicates that
     the pixel is identified as bad in the onboard bad-pixel list or is
     outside the region for which events can be reported.
     \\
     }
   \\
\hline
\end{tabular}
\end{center}

$^{\dag}$ This integer representation is appropriate for machines that use the
``big-endian'' convention for byte strings, where the first byte of the string
is assumed to contain the highest-order bits.

\end{table}

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

\newpage

\begin{table}[t]
\begin{center}
\begin{tabular}{|c|c|l|}
\multicolumn{3}{c}{Table 1 cont.} \\
\hline
STATUS
   & Integer
   & 
   \\
Bit
   & Representation$^{\dag}$
   & \hfil Condition(s) for which the STATUS bit is set to one \hfil
   \\
\hline
\
   & 
   &
   \\
4
   & 16
   & \parbox[t]{4.47in}{
     The bias value for the pixel is 4094, which indicates that a
     bias-parity error occurred for the pixel.
     \\
     }
   \\
5
   & 32
   & \parbox[t]{4.47in}{
     This bit is used to identify the columns along the outer edge of a CCD
     at CHIPX = 1 and 1024.  No events can be reported for these columns.
     See Table~2.
     \\
     }
   \\
6
   & 64
   & \parbox[t]{4.47in}{
     For TIMED mode observations, this bit is used to identify the rows
     along the outer edge of a CCD at CHIPY = 1 and 1024.  No events can be
     reported for these rows.  See Table~2.
     \\
     }
   \\
7
   & 128
   & \parbox[t]{4.47in}{
     This bit is reserved for users to identify pixels that they want
     to exclude.
     \\
     }
   \\
8
   & 256
   & \parbox[t]{4.47in}{
     For TIMED FAINT, TIMED VFAINT, and continuous clocking mode
     observations, this bit is used to identify the eight pixels that
     surround a bad pixel (and a pixel in a bad column).  See Table~2.
     \\
     }
   \\
9
   & 512
   & \parbox[t]{4.47in}{
     For TIMED VFAINT mode observations, this bit is used to identify the
     rows and columns that are immediately adjacent to the outer edge of a
     CCD. (\ie\ CHIPX = 2 and 1023 and CHIPY = 2 and 1023).  See Table~2.
     \\
     }
   \\
10
   & 1024
   & \parbox[t]{4.47in}{
     This bit is used only for TIMED VFAINT mode observations.  It is used
     in a similar fashion as bit 8.  For a bad pixel (or a pixel in a bad
     column), this bit is set to one for the sixteen pixels that surround
     the eight pixels for which bit 8 is set to one.  See Table~2.
     \\
     }
   \\
11
   & 2048
   & \parbox[t]{4.47in}{
     This bit is used to identify the columns at the mid-chip node boundary
     (\ie\ CHIPX = 512 and 513).  The events reported for these columns are
     often produced by cosmic rays instead of X rays.
     \\
     }
   \\
12 
   & 4096
   & \parbox[t]{4.47in}{
     This bit is used to identify the columns at the quarter-chip node
     boundaries (\ie\ CHIPX = 256, 257, 768, and 769).  The events reported
     for these columns are often produced by cosmic rays instead of X rays.
     \\
     }
   \\
13
   & 8192
   & \parbox[t]{4.47in}{
     This bit is used to identify the region (if any) affected by the
     ``FEP0'' problem. 
     \\
     }
   \\
14
   & 16384
   & \parbox[t]{4.47in}{
     This bit is used to identify pixels that are found to be ``hot'' for the
     entire duration of an observation.
     \\
     }
   \\
15
   & 32768
   & \parbox[t]{4.47in}{
     This bit is used to identify pixels that are unusable for part of an
     observation because the pixel had a cosmic-ray ``afterglow.'' The start
     and stop times of the afterglow are recorded in the bad-pixel file.
     \\
     }
   \\
16
   & 65536
   & \parbox[t]{4.47in}{
     \vspace*{-0.6\baselineskip}
     This bit is used to identify a pixel which the tool acis\_build\_badpix
     found to have a bias value that is either too low or too high compared
     to the median bias value of the column in which the pixel is located.
     \\
     }
   \\
17--31
   & {\ldots}
   & \parbox[t]{4.47in}{ 
     \vspace*{-0.6\baselineskip}
     Unused.
     \\
     }
   \\
\hline
\end{tabular}
\end{center}

$^{\dag}$ This integer representation is appropriate for machines that use the
``big-endian'' convention for byte strings, where the first byte of the string
is assumed to contain the highest-order bits.

\end{table}

\begin{table}[t]
\begin{center}
\begin{tabular}{|c|c|l|}
\multicolumn{3}{c}{Table 2} \\
\hline
STATUS
   & Integer
   & 
   \\
Bit
   & Representation$^{\dag}$
   & \hfil Additional condition(s) for which the STATUS bit is set to 
     one$^\ddag$ \hfil
   \\
\hline
\
   & 
   &
   \\
0
   & 1
   & \parbox[t]{4.47in}{
     None.
     \\
     }
   \\
1
   & 2
   & \parbox[t]{4.47in}{
     None.
     \\
     }
   \\
2
   & 4
   & \parbox[t]{4.47in}{
     None.
     \\
     }
   \\
3
   & 8
   & \parbox[t]{4.47in}{
     None.
     \\
     }
   \\
4
   & 16
   & \parbox[t]{4.47in}{
     None.
     \\
     }
   \\
5
   & 32
   & \parbox[t]{4.47in}{
     Obsolete.  Do not use.
     \\
     }
   \\
6
   & 64
   & \parbox[t]{4.47in}{
     Obsolete.  Do not use.
     \\
     }
   \\
7
   & 128
   & \parbox[t]{4.47in}{
     None.
     \\
     }
   \\
8
   & 256
   & \parbox[t]{4.47in}{
     Only set the STATUS bit to one if one or more of the STATUS bits 0--4,
     7, and 14--16 are set to one.
     \\
     }
   \\
9
   & 512
   & \parbox[t]{4.47in}{
     Obsolete.  Do not use.
     \\
     }
   \\
10
   & 1024
   & \parbox[t]{4.47in}{
     Obsolete.  Do not use.
     \\
     }
   \\
11
   & 2048
   & \parbox[t]{4.47in}{
     None.
     \\
     }
   \\
12
   & 4096
   & \parbox[t]{4.47in}{
     None.
     \\
     }
   \\
13
   & 8192
   & \parbox[t]{4.47in}{
     None.
     \\
     }
   \\
14
   & 16384
   & \parbox[t]{4.47in}{
     None.
     \\
     }
   \\
15
   & 32768
   & \parbox[t]{4.47in}{
     None.
     \\
     }
   \\
16
   & 65536
   & \parbox[t]{4.47in}{
     None.
     \\
     }
   \\
17--31
   & {\ldots} 
   & \parbox[t]{4.47in}{
     {\ldots} 
     \\
     }
   \\
\hline
\end{tabular}
\end{center}

$^{\dag}$ This integer representation is appropriate for machines that use the
``big-endian'' convention for byte strings, where the first byte of the string
is assumed to contain the highest-order bits.

$^{\ddag}$ If no additional conditions are specified, then set this STATUS
bit to one if the condition(s) in Table~1 are satisfied.  Otherwise, the
conditions in both Tables~1 and 2 must be satisfied before the STATUS bit is
set to one.

\end{table}

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

% 5. Finish

\end{document}
