%\input /pros/doc/scidoc/skeleton.tex
\def\version{\it Rev. 1.1 --- 4/1/86}
\def\chapter{\it Timing Analysis: Light Curves}
%\chapterhead{Science Specifications for the PROS}
%\chapterhead{Timing Analysis: Light Curves}
\chapterhead{I.~Light Curves}

\@{Overview}

\noindent
{\it Science Contact}:  Jeff McClintock

In this memo on plotting ROSAT data,
some notation is introduced,  and a few simple algorithms for
computing statistical uncertainties are given. The task of
generating plots of timing data is broken into three parts:
\item{(i)}Selection of
source and background regions
\item{(ii)}Specification of a start time, an
end time, and a binning interval
\item{(iii)}Computation of the plot/list
files.
Several examples of plots we will surely want to be
able to generate are given.  It is assumed throughout that the exposure is
uniform across the two-dimensional image ({\it i.e.}, there is no
vignetting, no ribs, etc.).

\@{Make a Light Curve --- Bin Data}

\**Select source and background regions

{\list

Select one source region and one or more background regions using
the imaging data.

For each region specify an extraction aperture and
a PHA range.  A single (source or background) region can be specified
by an array of numbers, and labeled by an observer's comment:

}

$$D ( m, IN, X, Y, k, A, \Delta E) + {\rm~ Comment}$$

\itemitem{1.}$m$ = 0~~~Source region ({\it i.e.}, source + background)

\itemitem{\phantom{1.}}\phantom{$m$ = }1~~~Background region no. 1
\itemitem{\phantom{1.}}\phantom{$m$ = }2~~~Background region no. 2
\itemitem{\phantom{1.}}\phantom{$m$ = }{\it etc.}
\itemitem{2.}$IN$:  Image number
\itemitem{3.}$X,Y$:  Pixel location of aperture center
\itemitem{4.}$k$ = 1~~~circular aperture
\itemitem{\phantom{4.}}\phantom{$k$ = }2~~~square aperture
\itemitem{\phantom{4.}}\phantom{$k$ = }3~~~user-specified aperture
\itemitem{5.}$A$:  Area of aperture in square pixels
\itemitem{6.}$\Delta E$:  Energy channel or range of pulse heights.


\**Specify plot parameters

\itemitem{1.}$T_1$: start time
\itemitem{2.}$T_2$: end time
\itemitem{3.}$\Delta T$: binning interval (or alternatively, specify the
total number of time bins, $N={T_2 -T_1 \over \Delta T}$).
\itemitem{4.}$SF_x$,$SF_y$: plot scale factors ({\it e.g.}, specify seconds
per cm or counts per cm, or default to an autoscaling mode.

\**Compute files

{\list

Given the observer's inputs in steps 1 and 2 above, extract the
counts and statistical error for each binning interval from the
time-tagged event data.  Compute the count rate ($CR$) and its
uncertainty by dividing the number of counts in a given bin by the net
``live'' exposure time ($\Delta T_L$) for that bin ({\it i.e.},
$\Delta T_L = \Delta T$ - time lost to data gaps and dropouts).  The
resultant time-ordered list of count rates and associated errors is
the ``plot/list'' file. Several examples are given below.

}

\@{Some Specific Examples of Plot/List Files}


\**{Simplest case:  counting rate from a single region with no
background subtraction.}

$$ D (0, IN, X, Y, k, A, \Delta E)$$

{\list

Let $S+B$ be the counts in intervals of time $\Delta T$ that are detected
inside the aperture $A$ and in the energy range $\Delta E$.  The desired
plot/list file will contain a header (specified by the observer's
inputs given in \S 2.1 and \S 2.2 above) and the following data.

}

\vskip 12pt
\halign{\indent#&#\hfil\quad&#\hfil\quad&#\hfil\quad&#\hfil\quad&\hfil#\hfil\quad&#\hfil
\cr
&Start time of bin:&$T_1$&$T_1 +\Delta T$&$T_1 + 2 \Delta
T$&$\ldots$&$T_2 - \Delta T$ \cr
&&&&&& \cr
&Total counts:&$(S+B)_1$&$(S+B)_2$&$S+B)_3$&$\ldots$&$(S+B)_n$ \cr
&&&&&& \cr
&Statistical
error:&$(S+B)_1^{1/2}$&$(S+B)_2^{1/2}$&$(S+B)_3^{1/2}$&$\ldots$&$(S+B)_n^{1/2}$
\cr
&&&&&& \cr
&Count
rate:&$(CR\pm \Delta CR)_1$&$(CR\pm \Delta CR)_2$&$(CR\pm \Delta
CR)_3$&$\ldots$&$(CR\pm \Delta CR)_n$ \cr }

{\list

Note: $(CR\pm \Delta CR)_i = [(S+B)_i \pm (S+B)_i^{1/2}]/(\Delta T_L)_i$

}

\**{Important case:  background-subtracted source intensities
(one source aperture and one background aperture).}

$$D(0, IN, X_s, Y_s, k_s, A_s, \Delta E)$$
$$D(1, IN, X_b, Y_b, k_b, A_b, \Delta E)$$
$$S+B_s: {\rm~counts~in~} A_s {\rm~in~} \Delta T {\rm~and~} \Delta E$$
$$B_b: {\rm~counts~in~} A_b {\rm~in~} \Delta T {\rm~and~} \Delta E$$

{\list

($\Delta E$, $\Delta T$ and $IN$ are the same for both apertures.)

The plot/list file has an appropriate header and contains the
following data:

}

\vskip 12pt
\halign{\qquad\qquad\indent#&#\hfil\quad&#\hfil\quad&\hfil#\quad&\hfil#\hfil \cr
&Start time of bin:&$T_1$&$T_1 +\Delta T$& $\ldots$ \cr
&&&& \cr
&Net source counts:&$Z_1$&$Z_2$& $\ldots$ \cr
&&&& \cr
&Statistical error:&$\Delta Z_1$&$\Delta Z_2$& $\ldots$ \cr }

$$Z_i = [(S+B_s) - B_b A_s /A_b]_i$$
$$\Delta Z_i = [(S+B_s) + B_b (A_s/A_b)^2]_i^{1/2}$$

{\list

The count rate in bin $i$ is $(CR\pm \Delta CR)_i =
(Z_i \pm \Delta Z_i)/(\Delta T_L)_i$

}

\**{Generalization of case 2 (above): sum several background regions.}

$$D(0, IN, X_o, Y_o, k_s, A_s, \Delta E)$$
$$D(1, IN, X_1, Y_1, k_{b1}, A_{b1}, \Delta E)$$
$$D(2, IN, X_2, Y_2, k_{b2}, A_{b2}, \Delta E)$$
$$\ldots$$
$$\ldots$$
$$\ldots$$
$$D(n, IN, X_n, Y_n, k_{bn}, A_{bn}, \Delta E)$$

{\list

($\Delta E$, $\Delta T$ and $IN$ are the same throughout.)

}

$$S+B_s:  {\rm~counts~in~} A_s {\rm~in~} \Delta T$$
$$B_{b1}:  {\rm~counts~in~} A_{b1} {\rm~in~} \Delta T$$
$$B_{b2}:  {\rm~counts~in~} A_{b2} {\rm~in~} \Delta T$$
$$\ldots$$
$$\ldots$$
$$\ldots$$
$$B_{bn}:  {\rm~counts~in~} A_{bn} {\rm~in~} \Delta T$$

{\list

In this case the $Z_i$ and $\Delta Z_i$ (see case 2) have the
form:

}

$$\eqalign{Z_i &=\left[ (S+B_s) - A_s {\sum_{k=1}^n B_{bk}\over
\sum_{k=1}^n A_{bk}}\right]_i \cr
\Delta Z_i &= \left[(S+B_s) +A_s^2 {\sum_{k=1}^n B_{bk} \over
\left(\sum_{k=1}^n A_{bk}\right)^2}\right]_i^{1/2} \cr }$$

{\list

The count rate in bin $i$ is $(Z_i \pm \Delta Z_i)/(\Delta T_L)_i$

}

\**{Hardness ratio plot:}

$$CR(\Delta E_1)/CR(\Delta E_2) ~vs {\rm~time~} (CR= {\rm~count~rate})$$

{\list

For a single source region and for zero, one, or more background
regions, compute two appropriate plot/list files as described
\S 3.1-\S 3.3 above.  These files can then be used to compute a
hardness-ratio plot/list file of the form:

}

\vskip 12pt
\halign{\qquad\qquad\indent#&#\hfil\quad&\hfil#\quad&\hfil#\hfil \cr
&$T_1$&$T_1 + \Delta T$& $\ldots$ \cr
&&& \cr
&$R_1$&$R_2$& $\ldots$ \cr
&&& \cr
&$\Delta R_1$&$\Delta R_2$& $\ldots$ \cr
}

{\list

In this case, 

}

$$\eqalign{R_i =& \left[{Z(\Delta E_1) \over Z(\Delta E_2)}\right]_i \cr
\left({\Delta R\over R}\right)^2_i =&
\left({\Delta Z\over Z} \right)^2_{i\mid \Delta E_1} +
\left({\Delta Z\over Z} \right)^2_{i\mid \Delta E_2} \cr }$$

\centerline{(assuming uncorrelated data)}

{\list

Note:  If $Z(\Delta E_1)$ or $Z(\Delta E_2) \leq 0$, then $R$ and
$\Delta R/R$ are not defined.

}

\@{Notes:}

\item{}Ultimately we will want to be able to plot almost any quantity against
any other quantity.  We need a wide range of capabilities including
the following:  

\item{(1).}display several or more background/source count
rates on a single plot
\item{(2).}present count-rate data taken from
different times in the mission on one plot
\item{(3).}generate 3-D plots
\item{(4).}plot a hardness ratio against a hardness ratio
\item{(5).}plot
source/background count-rate data and engineering data ({\it e.g.},
anticoincidence count rate) on the same plot
\item{(6).}display error bars
when requested by the user, {\it etc.}

In short, we require a versatile and well thought-out plotting package.

\vfill\eject



