%+
% Name:
%   memo_check_vf_pha_1.1.tex
%
% History:
%   29 Apr 06, created (v1.0), Glenn E. Allen
%   29 Apr 06, unset the bits on input or when check_vf_pha=no (v1.1), GEA
%-

\documentclass{article}

\usepackage{changebar}
\usepackage{cxo-memo-logo}
\usepackage{epsfig}
\usepackage{gea}

\begin{document}

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

% 1. Header

\memobasic{
   Jonathan McDowell, SDS Group Leader }{
   Glenn E.\ Allen, SDS }{
   Identifying Potential Cosmic-Ray Background Events for VFAINT Mode
     Observations }{
   1.1 }{
   http://space.mit.edu/CXC/docs/docs.html\#check\_vf }{
   /nfs/cxc/h2/gea/sds/docs/memos/memo\_check\_vf\_pha\_1.1.tex }

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

% 2. Introduction

\vspace*{0.3in}
%
In ACIS TIMED VFAINT mode observations the pulse-height information in the
outer sixteen pixels of a 5~pixel $\times$ 5~pixel event island is not used
to compute the summed pulse height.  The pulse-height information in these
pixels can be helpful in trying to identify events associated with cosmic
rays.  This specification describes an algorithm that can be used to search
for such background events.  Since the algorithm has not been optimized to
prevent real source events from being flagged as potentially bad, some care
is required when using the algorithm.

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

% 3. Changes to acis_process_events

\section{Changes to acis\_process\_events}

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

\subsection{Additional Parameters}

\begin{enumerate}

\item
check\_vf\_pha,b,h,``no'',,,``Search VFAINT mode data for potential
background events?'' 

\item
trail,r,h,0.027,0,1,``Fraction of charge trailed''

\end{enumerate}

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

\subsection{Additional Input}

If the parameter badpixfile is used to specify an input bad-pixel file, then
known bad pixels are excluded from the search.

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

\subsection{Additional Output}

If an event is identified as a potential cosmic-ray event, then STATUS bit
23 (of 0--31) is set to one in the output event-data file.

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

\subsection{Processing}

If the parameter ${\rm check\_vf\_pha}=``{\rm yes}$,'' then the algorithm
described hereafter is used to identify potential background events.  If the
parameter ${\rm check\_vf\_pha}=``{\rm no}$,'' then 
\begin{changebar} set
the value of STATUS bit 23 to zero for all events in the output event-data
file 
\end{changebar} 
and do not perform the following search.

\begin{figure}
\hfil
\hbox{\psfig{file=memo_check_vf_pha_fig2_1.0.eps}}
\hfil
%
\caption{The relative CHIPX and CHIPY coordinates of the twenty five
elements PHAS[$i,j$] of a 5~pixel $\times$ 5~pixel event island with ${\rm
(CHIPX,CHIPY)} = (x,y)$.
%
\label{fig01}}
\end{figure}

\begin{enumerate}

\item
  Exit with an error message if
  \begin{itemize}
    \item
    The output file exists and ${\rm clobber}={\rm ``no}$.''
    \item
    The input file does not exist.
    % \item
    % The value of the parameter ${\rm trail} < 0$ or $> 1$.
  \end{itemize}
  \begin{changebar}
  If the input data file does not have the keyword ${\rm DATAMODE} = {\rm
  `VFAINT'}$, then change check\_vf\_pha to ``no'' and produce a warning
  message. 
  \end{changebar}

\begin{changebar}
\item
  Set the value of STATUS bit 23 to zero for all of the events in the input
  event-data file.
\end{changebar}

\item
  For each event in the input event-data file, examine the pulse heights
  PHAS[$i,j$]\footnote{If the parameter ${\rm apply\_cti} = {\rm ``yes}$,''
  then use PHAS\_ADJ instead of PHAS in the following.} of the outer sixteen
  pixels of the 5~pixel $\times$ 5~pixel event island.  If
  \begin{itemize}
    \item
    the coordinates of the pixel associated with PHAS[$i,j$]$^{1}$ (see
    Fig.~1) are not the coordinates of a pixel listed as bad in the input
    bad-pixel file (if any),
    \item
    the coordinates of the pixel associated with PHAS[$i,j$]$^{1}$ are
    greater than or equal to 1 and less than or equal to 1024 and
    \item
    the pulse height PHAS[$i,j$]$^{1}$ satisfies the condition shown in
    Figure~2, 
  \end{itemize}
then set STATUS bit 23 (of 0--31) to one in the output event-data file for
the event.

\item
  Write the output to the output event-data file.

\end{enumerate}

\begin{changebar}
\begin{figure}
\hfil
\hbox{\psfig{file=memo_check_vf_pha_fig1_2.0.eps,width=6.50in}}
\hfil
%
\caption{The pulse-height conditions for each one of the outer sixteen
pixels of a 5~pixel $\times$ 5~pixels.  If one or more of the pulse heights
PHAS[$i,j$]$^{1}$ satisfies these conditions, then the event may have been
caused by a cosmic ray instead of an X ray.  Here, $s$ is the split
threshold and $t$ is the value specified by the parameter trail.
%
\label{fig02}}
\end{figure}
\end{changebar}

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

% 4. Finish

\end{document}
