% Time-stamp: <1999-12-17 11:19:38 dsd> 
% MIT Directory: ~dsd/CXC/specs/ICD/
% CfA Directory: /dev/null
% File: ICD_1DLIB.tex
% Author: D. Davis
%
% (this header is ~dph/libidl/time-stamp-template.el)
% to auto-update the stamp in emacs, put this in your .emacs file:
%      (add-hook 'write-file-hooks 'time-stamp)
%====================================================================

\documentclass[twoside]{article}
%\documentstyle[11pt]{article}
\input epsf.sty
\usepackage[outerbars,dvips]{changebar}

%\usepackage[dvips]{graphics}
%\usepackage{epsf}
\textwidth=6.5in
\textheight=8.9in
\topmargin=-0.5in
\oddsidemargin=0in
\evensidemargin=0in

\newcommand{\putdraft}{\special{!userdict begin /bop-hook{gsave 200 30
translate 65 rotate /Times-Roman findfont 216 scalefont setfont 0 0
moveto 0.9 setgray (DRAFT) show grestore}def end}}
 

\newcommand{\Remark}[1]{\marginpar
   {\fbox{\parbox{1.7in}{\raggedright\scriptsize#1}}}}

\newcommand{\Putline}{
%  \advance\textwidth-26pt
  \rule{\the\textwidth}{1pt}
%  \advance\textwidth+26pt
  }

\newcommand{\Note}[1]{
\begin{changemargin}{0.25in}{0in}
\advance\textwidth-26pt
\parbox{\textwidth}{      % testing...
\hfill\Putline\newline
%\parbox{\textwidth}{\small\sf#1}\\
{\small\sf#1}\\            % testing...
\Putline\newline
}       % testing...
\advance\textwidth+26pt
\end{changemargin}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \putstring{x}{y}{angle}{scale}{gray}{string}
% gray: 0=black, 1=white

\newcommand{\putstring}[6]{
\special{!userdict begin /bop-hook{gsave #1 #2 translate
#3 rotate /Times-Roman findfont #4 scalefont setfont
0 0 moveto #5 setgray (#6) show grestore}def end}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    To change the margins of a document within the document,
%    modifying the parameters listed on page 163 will not work. They
%    can only be changed in the preamble of the document, i.e, before
%    the \begin{document} statement. To adjust the margins within a
%    document we define an environment which does it:
      \newenvironment{changemargin}[2]{\begin{list}{}{
         \setlength{\topsep}{0pt}\setlength{\leftmargin}{0pt}
         \setlength{\rightmargin}{0pt}
         \setlength{\listparindent}{\parindent}
         \setlength{\itemindent}{\parindent}
         \setlength{\parsep}{0pt plus 1pt}
         \addtolength{\leftmargin}{#1}\addtolength{\rightmargin}{#2}
         }\item }{\end{list}}
%    This environment takes two arguments, and will indent the left
%    and right margins by their values, respectively. Negative values
%    will cause the margins to be widened, so
%    \begin{changemargin}{-1cm}{-1cm} widens the left and right margins
%    by 1cm.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\Header}[2]{
\pagestyle{myheadings}                   %%%%%%%%%%
\markboth{\bf \qquad #1 \hfill #2 \qquad}%%%%%%%%%%
         {\bf \qquad #1 \hfill #2 \qquad}%%%%%%%%%%
}

%%%%%%%%%%%%%%%%%%%%%% END dph useful macros %%%%%%%%%%--------------


%%%
%%% Look for occurrences of five pound characters: #####, to locate places
%%% where updates are necessary
%%%

%%%
%%% revision info
%%%
\newcommand{\Revision}{\mbox{\em%
%%%
%%% ##### Update the revision information
%%%
%Revision 0.0---11 Mar 1998 % my first draft, uncirculated
Revision 1.2.0   15 Dec 1999 % Comments incorperated
%Revision 1.0---02 Feb 1998 % reviewed, updated.
}}



\hyphenation{pipe-line}
\hyphenation{pipe-lines}

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

\Header{Data Product Interface Document: /}{\Revision}
\begin{document}


%\putstring{x}{y}{angle}{scale}{gray}{string}
% gray: 0=black, 1=white
%\putstring{70}{40}{90}{40}{0.90}{D R A F T -DRAFT- D R A F T}
%%% ##### comment the following line out for actual releases
%\putdraft

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
%%% title stuff, no need to change anything
%%%

\begin{titlepage}

\begin{changemargin}{-1in}{-1in}

  \begin{center}
    {\huge\bf AXAF Science Center}

    \vspace*{0.1in}
%    \leavevmode{\scalebox{0.17}{\includegraphics{asc_logo.eps}}}
    {\epsfxsize=3.2cm \leavevmode\epsfbox{asc_logo.eps}}
    \vspace*{0.1in}

    {\LARGE\bf Grating PSF Library:}

    \vspace*{0.1in}
    {\LARGE\bf Data Product Interface Document:}
    \vspace*{0.2in}

    \Revision

  \end{center}

  \vfill

  \begin{tabular}{lll}
    Submitted: & \rule{3.5in}{0.01in} & \rule{0.75in}{0.01in} \\
    & David S. Davis & Date   \\
    & Grating Scientist, CXC Science Data Systems & \\[0.25in]
    Concurred: & \rule{3.5in}{0.01in} & \rule{0.75in}{0.01in} \\
    & David Huenemoerder & Date   \\
    & Grating Scientist, CXC Science Data Sytems & \\[0.25in]
    Concurred: & \rule{3.5in}{0.01in} & \rule{0.75in}{0.01in} \\
    & Arnold Rots & Date   \\
    & Archive Scientist, CXC Archives & \\[0.25in]
    Concurred: & \rule{3.5in}{0.01in} & \rule{0.75in}{0.01in} \\
\cbstart
    & Jonathan McDowell & Date \\
    & Scientist, CXC Data Systems & \\[0.25in]
    Concurred: & \rule{3.5in}{0.01in} & \rule{0.75in}{0.01in} \\
\cbend
    & Kenny Glotfelty & Date   \\
    & CXC Data Systems Group Leader & \\[0.25in]
    Concurred: & \rule{3.5in}{0.01in} & \rule{0.75in}{0.01in} \\
    & Janet De Ponte & Date   \\
    & Manager, CXC Data Systems & \\[0.25in]
    Concurred: & \rule{3.5in}{0.01in} & \rule{0.75in}{0.01in} \\
    & Martin Elvis & Date   \\
    & Manager, CXC Science Data Systems & \\[0.25in]
    Approved:  & \rule{3.5in}{0.01in} & \rule{0.75in}{0.01in} \\
    & Harvey Tananbaum & Date   \\
    & Director, CXC & \\
  \end{tabular}

\end{changemargin}

\end{titlepage}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
%%% update info
%%%
\pagenumbering{roman}\setcounter{page}{2}

%%%
%%% ##### update as necessary
%%%

\begin{center}
\begin{tabular}{|c|c|c|p{2.5in}|} \hline
\multicolumn{4}{|c|}{}\\[1mm]
\multicolumn{4}{|c|}{\bf Document and Change Control Log}\\[3mm]\hline
{\bf Date} & {\bf Version} & {\bf Section} & {\bf Status} \\ \hline
11 Mar 90& 0.1.0& all&Initial Draft \\\hline
04 Feb 99& 1.1.0& all&Revived as a separate document \\\hline
30 Apr 99& 1.1.1& 4.1&Added enumerated axis or radial coord\\\hline
30 Apr 99& 1.1.1& 4.1&changed TTYPE names\\\hline
14 Jun 99& 1.2.0& all&Revised document using comments from DPH,KJG,AR 
and JCM\\\hline
%
\hline
%
\end{tabular}
\end{center}

\section*{Unresolved Issues}

The following is a list of unresolved, un-reviewed, or un-implemented
items: 

\begin{enumerate}

\item CBD keywords are not valid for the whole dataset (eg large
values of $\phi$ are not allowed for all $\theta$). 

\item The CDB keywords do not distinguish between HEG and MEG.

\item Normalization of the cross dispersion profiles for small
extraction regions needs to be more explicit. 


\end{enumerate}

\clearpage


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
%%% table of contents, list of tables
%%%

\tableofcontents
\clearpage
\listoftables
\clearpage

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

\pagenumbering{arabic}
\section{Introduction}

This document describes the interface to be employed in accessing 
the PSF Library products, according to the requirements stipulated in 
Applicable Document~\ref{appdoc:se03}.%
%

\subsection{Purpose}

The purpose of this document is to define the Point Spread Function 
(generically referring to PSF) Library to be used in Level 2
processing for the grating products, as described in PSF Tool ICD.
This consists of reading the task specific calibration data file and
returning the user specified product (e.g. PSF image, characteristic
size, psf fraction). 
%

\subsection{Scope}

This interface shall apply to all Grating specific PSF and LSF (Line
Spread Function) data products that need
the PSF Library and distributed to the CXC Data
Archive (see Applicable Documents TBD) during the course of
the AXAF mission.

\subsection{Applicable Documents}
The Applicable Documents required for background and detail on
grating Level 1.5 products are as follows:
\begin{enumerate}
%
\item\label{appdoc:data-prod} 
  AXAF Data Products Guide\newline
  {\tt http://hea-www.harvard.edu/asclocal/sds/CDR2/dp.ps}
%
\item\label{appdoc:coord}
 AXAF Coordinate Systems\newline
    {\tt http://hea-www.harvard.edu/~jcm/asc/coords}
%
\item\label{appdoc:se03}
 ASC AMO-2400 (SE03) \newline
 ASC Data System Requirements (ASC.302.93.0008)
%
\item\label{appdoc:ds01}
 ASC AMO-2401 (DS01) \newline
 ASC Data System Software Design (ASC.500.93.0006)
%
%\item\label{appdoc:fitsdef}
% NOST 100-1.1, Definition of the Flexible Image Transport System
%                    (FITS)\newline
%                    {\tt http://www.cv.nrao.edu/fits/}
%
\item\label{appdoc:fitsstd}
 HEASARC FITS Standards:\newline
{\tt http://legacy.gsfc.nasa.gov/docs/heasarc/ofwg/}\newline
{\tt docs/summary/ogip\_93\_001\_summary.html}

\item\label{appdoc:ascfits}
  ASC FITS File Designers' Guide\newline
  {\tt http:// http://hea-www.harvard.edu/$\sim$arots/asc/fits/ascfits.ps}
%
\end{enumerate}

% synopsis for editing purposes...
%
%   1 appdoc:data-prod AXAF Data Products Guide
%   2 appdoc:coord     AXAF Coordinate Systems
%   3 appdoc:se03      ASC AMO-2400 (SE03)
%   4 appdoc:ds01      ASC AMO-2401 (DS01)
%   7 appdoc:ascfits   ASC FITS Designers' Guide
%   5 appdoc:fitsdef   NOST 100-1.1, Definition of the FITS
%
%   6 appdoc:fitsstd   HEASARC FITS Standards:
%   8 appdoc:hrcicd    HRC Data Products Guide:
%   9 appdoc:acisicd   ACIS Data Products Guide:


\subsection{Functional Description}

\subsubsection{Data Content Summary}

All Grating PSF Library files shall
consist of data files conforming to the FITS format (Applicable
Document~\ref{appdoc:ascfits}). These files
contain header keyword entries and binary table (BINTABLE) extensions.

\subsubsection{Source and Transfer Method}

PSF Library shall be created by TBD as
described in Applicable Document~\ref{appdoc:se03}.

\subsubsection{Recipients and Utilization}

The primary recipients, via distribution from the archive, of the PSF
Library are AXAF observers, who will utilize these data products for
scientific data analysis. The CXC may also make use of specific PSF
Library data products for instrument calibration, instrument and/or
spacecraft monitoring and trends analysis, and validation and
verification of the Level 0, Level 1, and Level 1.5 software and of
the data products themselves.

\subsubsection{Pertinent Relationships with Other Interfaces}

Changes to the definition of CXC FITS, as described in Applicable
Documents~\ref{appdoc:ascfits}, may affect the format of the PSF data
products described in the current document.

\subsection{Assumptions and Constraints}

Besides the position of the primary HDU the order of the 
extensions arbitrary. The column order for any binary table appended
to the data file is also arbitrary. The primary HDU should have the 
PSF spatial dimension as the first axis, the others may occur
in any order. 

\subsection{Products Not Covered}

PSF products that are used for maintenance and diagnostic purposes
(those that are not supplied to the user for scientific data
analysis), or which are generic AXAF Level 2 products, are not
currently included within the interface defined by this document.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\clearpage
\section{Access}
\subsection{Access Tools; Input/Output Protocol}

Since PSF Library products obey the formatting rules described in
Applicable Documents~\ref{appdoc:ascfits},
they may be accessed by any software that conforms to those standards,
including all versions of the FITSIO libraries that support the
BINTABLE extension. In addition, since they adhere to HEASARC
standards (Applicable Document~\ref{appdoc:fitsstd}), PSF data product
files are compatible with the input/output routines that constitute
the CXC data interface.

%\subsection{Timing and Sequencing Characteristics}

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

\clearpage
\section{Detailed Interface Specifications}

\subsection{Labeling and Identification}

The data files in the PSF Library shall be
assigned external names as shown in Table~\ref{tab:dataproductfiles}.
The names obey the convention described in 
{\tt http://hea-www.harvard.edu/~arots/asc/fits/content.txt}.
%
\cbstart
\begin{table}[h]
\begin{center}
\begin{tabular}{|ll|}\hline
  \multicolumn{1}{|l}{\bf Title}  & \multicolumn{1}{l|}{\bf File name}\\
  1-d lsf data  & {\tt INST\_GRAT\_Dyyyy-mm-ddtypeNXXXX.fits}\\\hline


%
\end{tabular}
\caption{PSF Data Product Files}
\label{tab:dataproductfiles}
\end{center}
\end{table}
Where {\tt INST} is HETG or LETG. {\tt GRAT} is a string indicating
the grating type with allowed values of heg, meg, or leg. 
The PSF library file can
contain either Encircled Energy ({\tt type}=reef) data or the Line
Spread Function ({\tt type}=lsf).  Each type of data can also be
from the dispersion {\tt type}=lsf or cross-dispersion data and is
denoted by  {\tt type}= xdsf. NXXXX gives the version number with XXXX
being  a four digit integer. This file will contain the PSF's
for that position and all the energies as a data cube in the primary
HDU (Header Data Units) as described below. {\tt yyyy-mm-dd} is the
effective date. 
\cbend
%


No additional non-instrument-specific data products are output by the PSF
processing pipeline.


\subsection{PSF Library structure Definition}
The primary HDU for the PSF library shall be a hypercube with the 
(n-dimensional images) that extend along the coordinates below. 
For two dimensional data the r coordinate is not required. For LSF
data the l and m coordinate should be omitted. All others are required.
\begin{verbatim}
	l - spatial x-direction of the PSF image
	m - spatial y-direction of the PSF image
	r - spatial radial direction of PSF image
	X - spatial x-direction offset coordinate
	Y - spatial y-direction offset coordinate
	E - energy
	f - focus
	O - order

\end{verbatim}

Each coordinate may be regularly sampled, in which case the sample
points are defined by the usual CTYPEi, etc., keywords; or
irregularly, in which case the sample points are defined in a table
extension {\it in the same file}.
Each coordinate has to have one or more pixels, but one is expressly
allowed.  If there is only one point along any of the required axes,
the axis still needs to be present and its coordinate value shall be
defined in the usual way (CTYPEi, etc.).
A number of coordinate axes (most notably the spatial ones) will have
several aliases defined in the header.
The headers of these images will contain the required CalDB keywords.

The SUMRCTS images should match the PSF hypercubes exactly,
except that the the (l,m) or (r) axes are missing.  The image pixels
indicate the number of counts used for each one dimensional PSF image.
These images should be kept in IMAGE extensions, they should be
numbered by EXTVER, and the value of EXTVER should correspond to the
value of EXTVER in the PSF hypercube that it is associated with.
Obviously, if there is only one hypercube in the file, EXTVER = 1 for
the SUMRCTS image and the association is obvious.

The irregularly sampled coordinate definition tables are defined in
Section 2.2 of Applicable Document~\ref{appdoc:ascfits}.


\subsection{1-D PSF Library Format}
All PSF Library data products shall consist of files in FITS format,
as defined in Applicable Document~\ref{appdoc:ascfits}. The FITS file
is constructed via the description in \S~4.  This is followed by the
error component.  The error file shall have the same dimensions as the
primary data array. The ETERMXX keyword will be added for each
additional error term added. XX shall be the number of the error term
starting at 01 and going to 99. 


\section{1-D File Structure for Grating Data}

This section describes a 1-D PSF Library which is a FITS file with up
to four types of HDU's.  The first HDU will contain the normalized PSF
images (1-d or 2-d) with the coordinate axes defined below. The * in
table 2 or 3 denotes the principal HDU. The PSF images are normalized
to a peak of one. To preserve the original information in the dataset
and to derive accurate statistical errors an
HDU containing the total counts for the data in the PSF is
constructed as an image for the next HDU.  The next four HDUs will
contain an empty primary HDU and a binary table to define the
irregularly sampled coordinate axis.  The final HDU is optional but
can contain an index table to reference additional PSF's not contained
in the current file.  We do not curretly use an index table so it is
not described here (but see the ARD for the Spatial PSF Library
{\tt http://hea-www.harvard.edu/asclocal/sds/development/ICD/index.html}
for a description).

\begin{itemize}
\item Principal Image HDU:
  \begin{itemize}
  \item image mandatory
  \item table coordinates
  \item full configuration control
  \item full timing
  \item full observation
  \end{itemize}
\item SUMRCTS Image Extn HDU:
  \begin{itemize}
  \item image mandatory
  \item table coordinates
  \item short CC
  \item short timing
  \end{itemize}
\item Coordinate Tables
  \begin{itemize}
	\item bintable mandatory
	\item short CC
	\item short timing
	\item short Observation
  \end{itemize}
\end{itemize}
The description of the required keywords (eg. image mandatory) can be
found in  Applicable Document~\ref{appdoc:ascfits}. 

\clearpage

\begin{table}[h]
{\footnotesize
\noindent\begin{tabular}{|llcccp{0.5in}cp{1.2in}|}\hline
HDU
& Type
& \sc EXTNAME
& \sc CONTENT
& \sc HDUNAME
& \sc HDUCLAS1
& \sc HDUCLAS3
& Description
\\
\hline
%
0 (*)
& IMAGE
& \sc HETG\_REEF
& \sc CDB\_HETG\_REEF
& \sc AXAF\_REEF
& \sc RESPONSE
& \sc REEF
&  1-d PSF data
\\
%
1 
& IMAGE
& SUMRCTS
& \sc HETG\_REEF\_CTS
& \sc AXAF\_REEF\_CTS
& RESPONSE
& SUMRCTS
& Normalization
\\
%
2 
& BINTABLE
& GROUPING
&
& 
& N/A
& N/A
& Optional table containing grouping information if the PSF spans multiple
HDU's
\\
%
3 
& BINTABLE
& RADIUS
&
& 
& COORD
& N/A
& Contains radial coordinate information
\\
%
4 
& BINTABLE
& WAVELENGTH
&
& 
& COORD
& N/A
& Contains energy coordinate information
\\
%
5 
& BINTABLE
& THETA
&
& 
& COORD
& N/A
& Contains theta coordinate information
\\
%
6 
& BINTABLE
& PHI
&
& 
& COORD
& N/A
& Contains phi coordinate information
\\
%
7 
& BINTABLE
& ORDER
&
& 
& COORD
& N/A
& Contains order coordinate information
\\
%
8 
& BINTABLE
& DEFOCUS
&
& 
& COORD
& N/A
& Contains order focus information
\\
%
%
\hline
\end{tabular}
\label{tab: 1dREEFhdu}
\caption{Table describing the REEF file structure}
}
\end{table}

\begin{table}[h]
{\footnotesize
\noindent\begin{tabular}{|llcccp{0.6in}cp{1.2in}|}\hline
HDU
& Type
& EXTNAME
& CONTENT
& HDUNAME
& HDUCLAS1
& HDUCLAS3
& Description
\\
\hline
%
0 (*)
& IMAGE
& AXAF\_LSF
& CDB\_HETG\_LSF
& AXAF\_LSF
& RESPONSE
& LSF
& 1-d PSF data
\\
%
1 
& IMAGE
& SUMRCTS
& HETG\_RPSF\_CTS
& AXAF\_LSF\_CTS
& RESPONSE
& SUMRCTS
& Normalization
\\
2 
& BINTABLE
& GROUPING
&
& 
& N/A
& N/A
& Optional table containing grouping information if the PSF spans multiple
HDU's
\\
%
3 
& BINTABLE
& RADIUS
&
& 
& COORD
& N/A
& Contains radial coordinate information
\\
%
4 
& BINTABLE
& WAVELENGTH
&
& 
& COORD
& N/A
& Contains energy coordinate information
\\
%
5 
& BINTABLE
& THETA
&
& 
& COORD
& N/A
& Contains theta coordinate information
\\
%
6 
& BINTABLE
& PHI
&
& 
& COORD
& N/A
& Contains phi coordinate information
\\
%
7 
& BINTABLE
& ORDER
& 
&
& COORD
& N/A
& Contains order coordinate information
\\
%
8 
& BINTABLE
& DEFOCUS
& 
&
& COORD
& N/A
& Contains defocus coordinate information
\\
%
\hline
\end{tabular}
\label{tab: 1dRPSFhdu}
\caption{Table describing the RPSF file structure for in the
dispersion direction}
}
\end{table}
\begin{table}[h]
{\footnotesize
\noindent\begin{tabular}{|llcccp{0.6in}cp{1.2in}|}\hline
HDU
& Type
& EXTNAME
& CONTENT
& HDUNAME
& HDUCLAS1
& HDUCLAS3
& Description
\\
\hline
%
0 (*)
& IMAGE
& AXAF\_XPSF
& CDB\_HETG\_XDSF
& AXAF\_XPSF
& RESPONSE
& XPSF
& 1-d PSF data
\\
%
1 
& IMAGE
& SUMRCTS
& CDB\_SUMRCTS
& AXAF\_XPSF\_CTS
& RESPONSE
& SUMRCTS
& Normalization
\\
2 
& BINTABLE
& GROUPING
&
& 
& N/A
& N/A
& Optional table containing grouping information if the PSF spans multiple
HDU's
\\
%
3 
& BINTABLE
& RADIUS
&
& 
& COORD
& N/A
& Contains radial coordinate information
\\
%
4 
& BINTABLE
& WAVELENGTH
&
& 
& COORD
& N/A
& Contains wavelength coordinate information
\\
%
5 
& BINTABLE
& THETA
&
& 
& COORD
& N/A
& Contains theta coordinate information
\\
%
6 
& BINTABLE
& PHI
&
& 
& COORD
& N/A
& Contains phi coordinate information
\\
%
7 
& BINTABLE
& ORDER
&
& 
& COORD
& N/A
& Contains order coordinate information
\\
%
8 
& BINTABLE
& DEFOCUS
&
& 
& COORD
& N/A
& Contains defocus coordinate information
\\
%
\hline
\end{tabular}
\label{tab: 1dRXPSFhdu}
\caption{Table describing the RPSF file structure for the
cross-dispersion direction}
}
\end{table}



\subsection{Enumerated Axis Definitions}
These tables list the binary tables which give the coordinate
information for each enumerated axis and are defined in 
applicable document~\ref{appdoc:ascfits}. The radial coordinate
will specify the angle from the center of the image with respect to
the grating node (see Applicable Document~\ref{appdoc:coord} \S 3). 

\begin{table}[h]
\begin{center}
{\small
\begin{tabular}{|c|c|c|c|c|c|p{1.8in}|}
\hline
 & & & & & & \\
 \#
 & TTYPE
 & TUNIT
 & TFORM 
 & TLMIN
 & TLMAX
 & \multicolumn{1}{|c|}{Comment}\\
 & & & & & & \\\hline
%
 1
 & RADIUS\_AXIS
 & 
 & 1I
 & 1
 & \sc TBD
 & Radius Bin \\\hline
%
 2
 & RAD\_LO
 & degrees
 & 1D
 & $0.0$
 & \sc TBD
 & Low radius of the bin\\\hline
%
 3
 & RAD\_HI
 & degrees
 & 1D
 & $0.0$
 & \sc TBD
 & Hi radius of the bin\\\hline
%
%
\end{tabular}
}% close \small
\caption{FITS Enumerated Axis binary table contents for the radial axis }
\label{tab:radialaxis}
\end{center}
\end{table}%
%
\begin{table}[h]
\begin{center}
{\small
\begin{tabular}{|c|c|c|c|c|c|p{1.8in}|}
\hline
 & & & & & & \\
 \#
 & TTYPE
 & TUNIT
 & TFORM 
 & TLMIN
 & TLMAX
 & \multicolumn{1}{|c|}{Comment}\\
 & & & & & & \\\hline
%
 1
 & WAVELENGTH\_AXIS
 & 
 & 1I
 & 1
 & \sc TBD
 & Wavelength Bin \\\hline
%
 2
 & WAVE\_LO
 & Angstroms
 & 1D
 & $0.0$
 & $10.0$
 & Low wavelength of the bin\\\hline
%
 3
 & WAVE\_HI
 & Angstroms
 & 1D
 & $0.0$
 & $10.0$
 & Hi wavelength of the bin\\\hline
%
%
\end{tabular}
}% close \small
\caption{FITS Enumerated Axis binary table contents for the energy axis }
\label{tab:energycontents}
\end{center}
\end{table}%
%
\begin{table}[ht]
\begin{center}
{\small
\begin{tabular}{|c|c|c|c|c|c|p{1.8in}|}
\hline
 & & & & & & \\
 \#
 & TTYPE
 & TUNIT
 & TFORM 
 & TLMIN
 & TLMAX
 & \multicolumn{1}{|c|}{Comment}\\
 & & & & & & \\\hline
%
 1
 & THETA\_AXIS
 & 
 & 1I
 & 1
 & \sc TBD
 & THETA Bin \\\hline
%
 2
 & THETA
 & deg
 & 1D
 & $0.0$
 & $360.0$
 & The Angle at the center of the bin\\\hline
%
%
\end{tabular}
}% close \small
\caption{FITS Enumerated Axis binary table contents for the $\theta$ axis }
\label{tab:thetacontents}
\end{center}
\end{table}%
%
\begin{table}[ht]
\begin{center}
{\small
\begin{tabular}{|c|c|c|c|c|c|p{1.8in}|}
\hline
 & & & & & & \\
 \#
 & TTYPE
 & TUNIT
 & TFORM 
 & TLMIN
 & TLMAX
 & \multicolumn{1}{|c|}{Comment}\\
 & & & & & & \\\hline
%
 1
 & PHI\_AXIS
 & 
 & 1I
 & 1
 & \sc TBD
 & PHI Bin \\\hline
%
 2
 & PHI
 & deg
 & 1D
 & $0.0$
 & $360.0$
 & Angle at the center of the bin\\\hline
%
%
\end{tabular}
}% close \small
\caption{FITS Enumerated Axis binary table contents for the $\phi$ axis }
\label{tab:ordercontents}
\end{center}
\end{table}
%
\begin{table}[ht]
\begin{center}
{\small
\begin{tabular}{|c|c|c|c|c|c|p{1.8in}|}
\hline
 & & & & & & \\
 \#
 & TTYPE
 & TUNIT
 & TFORM 
 & TLMIN
 & TLMAX
 & \multicolumn{1}{|c|}{Comment}\\
 & & & & & & \\\hline
%
 1
 & ORDER\_AXIS 
 & 
 & 1I
 & 1
 & \sc TBD
 & ORDER Bin \\\hline
%
 2
 & ORDER
 & 
 & 1D
 & $-30.0$
 & $30.0$
 & Dispersion order of the data\\\hline
%
\end{tabular}
}% close \small
\caption{FITS Enumerated Axis binary table contents for the Order axis }
\label{tab:ordercontents}
\end{center}
\end{table}
\begin{table}[ht]
\begin{center}
{\small
\begin{tabular}{|c|c|c|c|c|c|p{1.8in}|}
\hline
 & & & & & & \\
 \#
 & TTYPE
 & TUNIT
 & TFORM 
 & TLMIN
 & TLMAX
 & \multicolumn{1}{|c|}{Comment}\\
 & & & & & & \\\hline
%
 1
 & DEFOCUS\_AXIS 
 & 
 & 1I
 & 1
 & \sc TBD
 & DEFOCUS Bin \\\hline
%
 2
 & DEFOCUS
 & 
 & 1D
 & $-30.0$
 & $30.0$
 & Amount of Defocus um\\\hline
%
\end{tabular}
}% close \small
\caption{FITS Enumerated Axis binary table contents for the DEFOCUS axis }
\label{tab:focuscontents}
\end{center}
\end{table}
\clearpage



\subsection{Image Hypercube coordinate Definitions}
These tables list the coordinate information for each axis for the
primary HDU and the HDU containing the total count information.  Table
\ref{tab:SHDUcontents} defines the coordinate axes for an image which
contains the total number of counts for the data in the primary HDU
(table \ref{tab:PHDUcontents}). The pixels of the image will contain
the number of counts in the original image and each pixel will
correspond to one PSF dataset in the primary HDU.  The off-axis angle
is specified by $\theta_{HR}$ (see Applicable
Document~\ref{appdoc:coord} for the definition of the coordinate
system AXAF-HSC-1.2) and the rotation about the aim point is
$\phi_{HR}$. for the zero order image.


\begin{table}[htb]\label{pg:NULLi}
\begin{center}
{\small
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline
 & & & & & & &\\
   \sc n
 & \sc CTYPEn
 & \sc CDELTn
 & \sc CUNITn
 & \sc CRPIXn
 & \sc CRVALn
 & \sc CEXTNn
 & \multicolumn{1}{|c|}{Comments}\\
 & & & & & & &\\\hline
%
  1 
& PSF\_R
& 
& deg
& 1
& 0.
& \sc n/a
&\\
\hline
%
  2 
& WAVELENGTH\_AXIS
& 1
& Angstroms
& 1
& 1
& WAVELENGTH
&Enumerated axis\\
\hline
%
  3 
& THETA\_AXIS
& 1
& deg
& 1
& 1
& THETA
&Enumerated axis\\
\hline
%
  4
& PHI\_AXIS
& 1
& deg
& 1
& 1
& PHI
&Enumerated axis\\
\hline
%
  5
& ORDER\_AXIS
& 1
& 
& 1
& 1
& ORDER
&Enumerated axis\\
\hline
%
  6
& DEFOCUS\_AXIS
& 
& um
& 
& 
& DEFOCUS
&Focus Position\\
\hline
\end{tabular}
\caption{The principal HDU for the the PSF containing the 1-dimensional PSF
data for the gratings. }
\label{tab:PHDUcontents}
}\end{center}
\end{table}
%
\begin{table}[htb]\label{pg:NULLj}
\begin{center}
{\small
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline
 & & & & & & &\\
   \sc n
 & \sc CTYPEn
 & \sc CDELTn
 & \sc CUNITn
 & \sc CRPIXn
 & \sc CRVALn
 & \sc CEXTNn
 & \multicolumn{1}{|c|}{Comments}\\
 & & & & & & &\\\hline
%
%
  1 
& WAVELENGTH\_AXIS
& 1
& Angstroms
& 1
& 1
& WAVELENGTH
&Enumerated axis\\
\hline
%
  2 
& THETA\_AXIS
& 1
& deg
& 1
& 1
& THETA
&Enumerated axis\\
\hline
%
  3
& PHI\_AXIS
& 1
& deg
& 1
& 1
& PHI
&Enumerated axis\\
\hline
%
  4
& ORDER\_AXIS
& 1
& 
& 1
& 1
& ORDER
&Enumerated axis\\
\hline
%
  5
& DEFOCUS\_AXIS
& 
& um
& 
& 
& DEFOCUS
&Focus Position\\
\hline
\end{tabular}
\caption{The SUMRCTS HDU for the the PSF containing the total counts
in the 1-dimensional PSF data for the gratings. }
\label{tab:SHDUcontents}
}\end{center}
\end{table}

Table \ref{tab:PHDUcontents} is the primary HDU and contains the one
dimensional data for the grating PSF's. This data can be the 
Encircled Energy (REEF) or the Line Spread Function (LSF). 


%

\subsection{Column and Axis Descriptions} % Describe the primary axis
                                 % bintable here. 

The axes of the SUMRCTS and primary image are listed below:

\begin{description}
\item[PSF\_R: ] the radial coordinate measured in degrees
\item[WAVELENGTH: ] the wavelength, measured in angstroms.
\item[THETA: ] the off-axis angle measured in degrees,
\item[PHI: ] the azimuthal angle, measured in degrees, and
\item[ORDER: ] the diffraction order for the grating image
\item[DEFOCUS:] the defocus amount in $\mu$m
\end{description}

%
\subsection{Additional Required Keywords}
These additional Keywords need to be set in the primary HDU. 
\Note{All these keywords must be set by the software that generates
the PSF library and the values given below are examples only.}
{\tt
\begin{verbatim}
GRATING = 'HETG    '           /HETG, LETG, or NONE allowed
GRATTYPE= 'HEG     '           /HEG, MEG, LEG or NONE allowed
CDTP0001= 'DATA    '           /Virtual data set
CVSD0001= '1999-05-20T00:00:00 /Date and Time dataset is valid
CCLS0001= 'BCF     '           /Basic Calibration file
CCNM0001= '1D_PSF  '           /This is a 1-d file
CDES0001= 'Radial PSF dataset' /
CBD10001= 'Energy(0.07-20)keV' /Energy range for PSF
CBD20001= 'THETA(0-xx)arcmin'  /Distance from optical axis for PSF
CBD30001= 'PHI(0.0-xx.x)deg'   /Azimuthal angle for PSF
CBD40001= 'DEFOCUS(-100-100um)   /Focus Range
CCLS0000= 'CPF'
CDTP0000= 'DATA'
CCNM0000= 'LSF'
RAYMETH = 'MARX v2.2'          /Ray Generator
\end{verbatim}}

\subsection{Coordinate Keywords}
\cbstart
{\tt 
\begin{verbatim}
CUNIT1P = 'mm      '
CTYPE1P = 'PSF_R_PHYS'
CDELT1P =                    1
CRPIX1P =                    1
CRVAL1P =                    0
CUNIT1  = 'deg      '
CTYPE1  = 'PSF_R   '
CDELT1  =                    1
CRPIX1  =  1
CDELT1  =  0
CUNIT2  = 'mm      '
CTYPE2  = 'DEFOCUS_BIN'
CDELT2  =                    1
CRPIX2  =                    1
CRVAL2  =                    1
CEXTN2  = 'DEFOCUS   '
CNAME3  = 'DEFOCUS   '
CUNIT3  = 'Anstroms  '
CTYPE3  = 'WAVELENGTH_BIN'
CDELT3  =                    1
CRPIX3  =                    1
CRVAL3  =                    1
CEXTN3  = 'WAVELENGTH'
CNAME3  = 'WAVELENGTH'
CUNIT4  = 'deg  '
CTYPE4 = 'THETA_BIN'
CDELT4 =                    1
CRPIX4 =                    1
CRVAL4 =                    1
CEXTN4 = 'THETA   '
CNAME4 = 'THETA'
CUNIT5 = 'deg  '
CTYPE5 = 'PHI_BIN '
CDELT5 =                    1
CRPIX5 =                    1
CRVAL5 =                    1
CEXTN5 = 'PHI     '
CNAME5 = 'PHI     '
CDELT6  =                    1
CRPIX6  =                    1
CRVAL6  =                    1
CEXTN6  = 'ORDER   '
CNAME6  = 'ORDER   '
MTYPE1  = 'MSC_BIN   '
MFORM1  = 'THETA_BIN,PHI_BIN'
MTYPE2  = 'MSC'
MFORM2  = 'THETA,PHI'

\end{verbatim}}
\cbend


\clearpage




\end{document}
