 %%% $Id: ippSRS.tex,v 1.13 2004-11-30 23:16:03 eugene Exp $
\documentclass[panstarrs,spec]{panstarrs}

% basic document variables
\title{Pan-STARRS PS-1 Image Processing Pipeline}
\subtitle{Software Requirements Specification}
\shorttitle{IPP SRS}
\author{Eugene A. Magnier, Paul A. Price, Josh Hoblitt}
\audience{Pan-STARRS PMO}
\group{Pan-STARRS Algorithm Group}
\project{Pan-STARRS Image Processing Pipeline}
\organization{Institute for Astronomy}
\version{01}
\docnumber{PSDC-430-005}

\newcommand\FRM[2]{\parbox[t]{#1}{\raggedright #2}}
\newcommand\FRA{100pt}
\newcommand\FRB{260pt}
\newcommand\FRC{40pt}
\newcommand\FRD{80pt}
\newcommand\FRN[1]{\FRM{50pt}{#1}}
\newcommand\FRS[1]{\FRM{190pt}{#1}}
\newcommand\VER[2]{\\ {\scriptsize QUALIFICATION METHOD: #1, TRACE: #2}}
\newcommand\TASK{\\ {\scriptsize TASK}}
\newcommand\grizy{$grizy$}

% allow paragraphs to be listed in TOC for now 
\setcounter{tocdepth}{3}

\begin{document}
\maketitle

% -- Revision History --
\RevisionsStart
% version     Date         Description
% DR.01 & 2004.01.01 & First draft  \\ \hline
% DR.02 & 2004.03.10 & Second draft \\ \hline
% DR.03 & 2004.04.13 & Most paragraphs fleshed out \\ \hline
% DR.04 & 2004.04.27 & Basic text frozen for internal review \\ \hline
% DR.05 & 2004.05.24 & Incorporating comments from internal review \\ \hline
00      & 2004.08.06 & Revisions in prep of SRR \\ \hline
01      & 2004.10.29 & Revisions based on SRR \\ \hline
\RevisionsEnd

\inserttbd

\inserttbr
\pagebreak 

\tableofcontents
\pagebreak 

\listoffigures
\pagebreak
\pagenumbering{arabic}

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

\section{Scope}

\subsection{Identification}

This document is the Software Requirements Specification (SRS) for the
Panoramic Survey Telescope and Rapid Response System (Pan-STARRS)
Image Processing Pipeline (IPP) for the prototype telescope PS-1, and
is a System-level controlled specification/design description document
in the official Pan-STARRS engineering specification tree.

\subsection{System Overview}

The Institute for Astronomy at the University of Hawaii is developing
a large optical synoptic survey telescope system, the Panoramic Survey
Telescope and Rapid Response System (Pan-STARRS). The science goals,
priorities, top-level concept of operations with associated
operational requirements, and system performance drivers with
associated system performance requirements are described in the
Pan-STARRS Science Goals Statement (SGS).  As described in this
document, The system conceptual design for Pan-STARRS utilizes an
array of four 1.8m telescopes each with a 7 degree$^2$ field of view,
giving the system an \'etendue larger than all existing survey
instruments combined (defined as the product of the collecting area
$A$ multiplied by the field-of-view solid angle $\Omega$).  Each
telescope will be equipped with a 1 billion pixel CCD camera with low
noise and rapid read-out, and the data will be reduced in near real
time to produce both cumulative static sky and difference images from
which transient, moving, and variable objects can be
detected. Pan-STARRS will be able to survey up to $\approx 6,000$
degree$^{2}$ per night to a detection limit of approximately 24$^{th}$
magnitude.  This unique combination of sensitivity and sky coverage
will open up many new possibilities in time domain astronomy including
a major goal of surveying the Potentially Hazardous Object (PHO)
population down to a diameter of $\approx 300$ meters.  In addition,
the Pan-STARRS data will be used to investigate a broad range of
astronomical problems of extreme current interest concerning the Solar
System, the Galaxy, and the Cosmos at large.  A prototype single
telescope system, PS-1, is being developed as a preliminary step
before construction of the complete four telescope system.

\begin{tabular}{ll}
Project sponsor:&	AFRL, United States Air Force \\
Acquirer:       &	University of Hawaii Institute for Astronomy \\
User: 		&	Astronomical community \\
Developer:      &	University of Hawaii Institute for Astronomy, participating \\
                &       institutions, and associated subcontractors	
\end{tabular}

\subsection{Document Overview}

The Pan-STARRS IPP Software Requirements Specification contains the
complete system requirements of the Pan-STARRS PS-1 IPP in order to
achieve the top-level performance and operational requirements
specified by the SCD.  The requirements flow begun in the SGS and
continued in the SCD is further developed in this SRS to provide
additional derived system and subsystem requirements.

\subsection{Requirements Definitions}

The Pan-STARRS document naming scheme is PSDC-NNN-MMM-VV, where the VV
entry specifies the document version number.  Where documents are
identified without the version number, the latest official version in
that series is implied.  

Open issues (TBDs) in this document are marked {\bf \color{red} in
bold red}.

Quantities which should be reviewed (TBRs) are marked {\bf
\color{blue} in bold blue}.

\subsubsection{``Shall''}  When used in this specification, the word
``shall'' refers to an explicit requirement of a system component or
the complete system.  

\subsubsection{``Should''}  When used in this specification, the word
``should'' refers to a desired characteristic of a system component or
the complete system.

\subsubsection{``Will''}  When used in this specification, the word
``will'' provides information about a characteristic of a related
system component or a complete related system.

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

\DocumentsInternalSection
PSDC-230-001  &   PS-1 Design Reference Mission \\ \hline
PSDC-230-002  &   PS-1 System Concept Definition \\ \hline
PSDC-400-006  &   The Pan-STARRS IPP Computational Challenge \\ \hline
PSDC-430-004  &   Pan-STARRS PS-1 IPP C Code Conventions \\ \hline
PSDC-430-006  &   Pan-STARRS PS-1 IPP Algorithm Design Document \\ \hline
PSDC-430-007  &   Pan-STARRS PS-1 IPP PSLib Supplementary Design Requirements Specification \\ \hline
PSDC-430-010  &   Pan-STARRS PS-1 IPP Perl Code Conventions \\ \hline
PSDC-430-011  &   Pan-STARRS PS-1 IPP System/Subsystem Design Description \\ \hline
PSDC-430-012  &   Pan-STARRS PS-1 IPP Modules Supplementary Design Requirements Specification \\ \hline
\DocumentsExternalSection
Posix Standard & Open Group Based Specifications Issue 6, IEEE Std 1003.1, 2003 \\
\DocumentsEnd

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

\section{Requirements} 

\begin{table}
\begin{center}
\caption{Valid Moon Conditions for the 6 PS filters\label{moonconditions}}
\begin{tabular}{lrrrr}
\hline
\hline
filter & phase (days) & min. distance (degrees) \\
\hline
g &  6 & 60 \\
r &  5 & 40 \\
i &  4 & 30 \\
z &  2 & 20 \\
y &  1 & 10 \\
w &  5 & 50 \\
\hline
\end{tabular}
\end{center}
\end{table}

\subsection{Top-Level Requirements}
\label{req:system-capabilities}

The Pan-STARRS System Concept Definition (SCD) specifies the derived
top-level requirements for the IPP, which we reproduce here (with
numbering consistent within this document):

\begin{enumerate}
\item For images obtained in photometric weather with normal detector
  characteristics and providing appropriate flat-field images and
  correction data have been obtained, the IPP shall produce reduced
  science images for each full camera exposure with relative
  photometric zero-point scatter less than 1\% ($1 \sigma$) across the
  full field. \VER{ANALYSIS}{SCD:3.2.2.5}
  \label{TLR:1}

\item For images of reference fields calibrated for the IPP filter set
  and obtained in photometric weather with normal detector
  characteristics and providing appropriate flat-field images and
  correction data have been obtained, the IPP shall determine and
  track zero-points for these exposures with a 1$\sigma$ accuracy of
  1\%.\VER{ANALYSIS}{SCD:3.2.2.5}
  \label{TLR:2}

\item For images obtained under normal seeing conditions and optical
  distortion, the IPP shall produce reduced science images for each
  full camera exposure with an astrometric calibration providing $<
  30$ milliarcsecond scatter (1$\sigma$) for sequential images of the
  same location.\VER{ANALYSIS}{SCD:3.2.2.7}
  \label{TLR:4}

\item For images obtained under normal seeing conditions and optical
  distortion, the IPP shall produce reduced science images for each
  full camera exposure with an astrometric calibration providing $<
  100$ milliarcsecond scatter (1$\sigma$) relative to the ICRS
  reference system.\VER{ANALYSIS}{SCD:3.2.2.6}
  \label{TLR:3}

\item In photometric weather and under moon conditions listed in
  Table~\ref{moonconditions}, the IPP shall produce reduced science
  images for each full camera exposure which have background
  variations of less than 1\% in regions free of large ($> 30$ pixels
  diameter) astronomical structures.\VER{ANALYSIS}{SCD:3.5.12}
  \label{TLR:5}

\item In photometric weather, the IPP shall produce reduced science
  images for each full camera exposure which have background
  deviations from the static sky in the same filter of less than 1\%
  for the median in large ($> 30$ pixels diameter)
  regions.\VER{ANALYSIS}{SCD:3.5.12}
  \label{TLR:5a}

\item The IPP shall merge all $g$ filter science images into a static sky image.\VER{TASK}{SCD:3.2.2.10}
  \label{TLR:6}

\item The IPP shall merge all $r$ filter science images into a static sky image.\VER{TASK}{SCD:3.2.2.10}
  \label{TLR:7}

\item The IPP shall merge all $i$ filter science images into a static sky image.\VER{TASK}{SCD:3.2.2.10}
  \label{TLR:8}

\item The IPP shall merge all $z$ filter science images into a static sky image.\VER{TASK}{SCD:3.2.2.10}
  \label{TLR:9}

\item The IPP shall merge all $y$ filter science images into a static sky image.\VER{TASK}{SCD:3.2.2.10}
  \label{TLR:10}

\item The IPP shall merge all $w$ filter science images into a static sky image.\VER{TASK}{SCD:3.2.2.10}
  \label{TLR:11}

\item The IPP shall detect and classify objects on the individual processed science
  images.\VER{TASK}{SCD:3.2.2.16}
  \label{TLR:12}

\item The IPP shall detect and classify objects on the stacked groups
  of science images.\VER{TASK}{SCD:3.2.2.16}
  \label{TLR:13}

\item The IPP shall detect and classify objects on the static sky
  image.\VER{TASK}{SCD:3.2.2.16}
  \label{TLR:14}

\item The IPP shall detect transients with significance $>3\sigma$ in
  the individual science images relative to the static sky
  image.\VER{ANALYSIS}{SCD:3.2.2.16}
  \label{TLR:15}

\item The IPP shall degrade the stacked image by no more than 150
  milliarcseconds (FWHM added in quadrature) over the theoretical
  limit for the stack under infinite
  sampling.\VER{ANALYSIS}{SCD:3.5.2}
  \label{TLR:16}

\item The IPP shall perform the processing of science images to the
  level of transient detection and static sky inclusion at a rate such
  that exposures taken at an average cadence of 40 seconds do not
  accumulate in the processing buffer (average throughput
  requirement).\VER{TEST}{SCD:3.2.2.3}
  \label{TLR:17}

\item The IPP shall limit the false alarm rate (FAR) to less than 5\%
  for transient detections $> 5\sigma$ sent to the preferred client
  science pipelines.\footnote{note difference with PS-4: 1\%}
  \VER{ANALYSIS}{SCD:3.2.2.13}
 \label{TLR:18}

\item The IPP shall perform transient detection to a completeness of
  99\% at the completeness for transient detections with a significance
  $> 5\sigma$.\VER{ANALYSIS}{SCD:xxx}

\item The IPP shall publish the static sky images to the Pan-STARRS
  Published Science Products Subsystem (PSPS) at a rate so the full
  sky is transmitted once per year.\VER{TASK}{SCD:3.2.2.18}
  \label{TLR:19}

\item The IPP shall publish the detected objects to the Pan-STARRS
  Published Science Products Subsystem (PSPS) at a rate such that the
  objects from the full sky are transmitted once per
  year.\VER{TASK}{SCD:3.2.2.18}
  \label{TLR:20}

\item The IPP shall send the IPP metadata and received OTIS metadata
  to the Pan-STARRS Published Science Products Subsystem (PSPS)
  weekly.\VER{TASK}{SCD:3.2.2.18}
  \label{TLR:21}

\item The IPP shall provide access to preferred Pan-STARRS science
  clients to the detected transient objects within 15 minutes with at
  least 85\% reliability.\VER{TEST}{SCD:3.5.10}
  \label{TLR:22}

\item The IPP shall provide sufficent storage volume for raw images from the AP and
  IVP Surveys and the \grizy\ Static Sky.\footnote{note difference with
  PS-4: 1 month of raw images} \VER{INSPECT}{allocated}
  \label{TLR:23}

\item The IPP shall provide sufficient storage volume for all detections from the
  AP, IVP, and MVP Surveys.\footnote{note difference with PS-4: 1 year
  of detections}\VER{INSPECT}{allocated}
  \label{TLR:24}

\item The IPP shall provide sufficient storage volume for 2 years of
 metadata.\footnote{note difference with PS-4: 10 years of
 metadata}\VER{INSPECT}{allocated}
  \label{TLR:25}
\end{enumerate}

\subsection{Required States}

The IPP has 3 operating states: active, paused, and interactive.  In active state, the IPP:

\begin{itemize}
\item Accepts images and metadata from the external sources (i.e., the summit)

\item Automatically performs the complete set of image processing
  tasks, including both calibration and science image
  processing.

\item Responds to requests for data from client science pipelines,
possibly pre-registered classes of data requests.

\item Responds to analysis priority requests issued by the IPP operators.
\end{itemize}

In paused state, the IPP refuses incoming data and metadata and data
requests from the client science pipelines.

The interactive state is intermediate between these two.  In
interactive state, the IPP:

\begin{itemize}
\item Accepts incoming data and metadata from the external sources.
\item Does {\em not} automatically process the data.
\item Responds to user commands to perform portions of the data analysis.
\end{itemize} 

\subsection{Software Coding Requirements}

\subsubsection{Languages}
\label{req:languages}

\begin{enumerate}
\item Source code shall be in C. \VER{INSPECT}{allocated}
\item All source code shall be tested with `gcc' version v2.95 or higher. \VER{INSPECT}{allocated}
\item The tested compiler version shall be defined for the delivered software product. \VER{INSPECT}{allocated}
\item Scripting language shall be Perl. \VER{INSPECT}{allocated}
\end{enumerate}

\subsubsection{Interfaces}
\begin{enumerate}
\item Access to low-level Library functions shall be provided via C APIs consisting of the function calls and the defined data structures and other data types. \VER{INSPECT}{allocated}
\item Access to high-level functions shall be provided via C APIs. \VER{INSPECT}{allocated}
\item Access to specified C functions in higher level languages shall employ SWIG. \VER{INSPECT}{allocated}
\item Access to processing jobs shall be available via the UNIX shell. \VER{INSPECT}{allocated}
\end{enumerate}

\subsubsection{Coding Standards} 

\begin{enumerate}
\item The C code shall comply with ANSI Standard C99.   \VER{INSPECT}{allocated}
\item Because the delivered code is required to run on UNIX machines, the delivered code shall be in compliance with the language-independent UNIX operating system standard POSIX (Open Group Based Specifications Issue 6, IEEE Std 1003.1, 2004).\VER{INSPECT}{allocated}
\item Source code files shall use the UNIX line-break convention (line-feed only).  \VER{INSPECT}{allocated}
\item C coding style shall adhere to the standard defined in the document `Pan-STARRS IPP C-coding standard' (PSDC-430-004).  \VER{INSPECT}{allocated}
\item Perl coding shall follow the standard defined in the document `Pan-STARRS IPP Perl-coding standard' (PSDC-430-010).\VER{INSPECT}{allocated}
\end{enumerate}

\subsubsection{Naming Conventions}

\begin{enumerate}
\item Header files shall have names starting \code{ps} or \code{p_ps}
for private interface definitions. The latter shall appear in a
subdirectory \code{private} of whichever directory is being searched
for the public header files.\VER{INSPECT}{allocated}

\item Functions visible at global scope that are part of the public
API shall have names beginning with \code{ps} and follow the naming
conventions in the coding standard. \VER{INSPECT}{allocated} 

\item Functions visible at global scope but which are not part of the
public interface shall have names beginning with \code{p_ps}.\VER{INSPECT}{allocated}
 
\item Functions that are local to a file shall \textit{not} start with
\code{ps} or \code{p_ps}.\VER{INSPECT}{allocated}
 
\item Variables visible at global scope which are part of the public
API shall have names beginning with \code{ps}, and follow the naming
conventions in the coding standard.  \VER{INSPECT}{allocated}

\item Variables that are visible at global scope but which are not
part of the public interface shall have names beginning with
\code{p_ps}.\VER{INSPECT}{allocated}

\item Variables that are local to a file shall \textit{not} start with
\code{ps} (or \code{p_ps}).\VER{INSPECT}{allocated}

\item The names of all enumerated types and C-preprocessor symbols
(but not variables declared \code{const}) shall start with \code{PS_},
in the case of public symbols, or \code{P_PS_}, for private symbols.
The rest of the name shall be uppercase with words separated by
underscores (\code{_}). An exception is the case of system utilities
implemented as macros, in which case the names shall conform to the
convention for function names.\VER{INSPECT}{allocated}

\item When defining a function to convert from one type to another,
the name shall be of the form \code{psOldToNew},
e.g.\code{psEquatorialToEcliptic} (\emph{not}
\code{psEquatorial2Ecliptic}).\VER{INSPECT}{allocated}
\end{enumerate}

\subsubsection{C Programming Guidelines}

\begin{enumerate}
\item Functions that assign to a variable shall list that argument
\textit{first}, following the pattern of \code{strcpy}. \VER{INSPECT}{allocated}

Type definitions should always be accompanied by prototypes for their
constructors.  Corresponding destructors are private functions
registered with the PSLib memory management system.

\item The constructor name shall consist of the type name followed by
\code{Alloc}; e.g. a type \code{psImage} would be created by a
function \code{psImage *psImageAlloc();}.\VER{INSPECT}{allocated}
  
\item The constructor shall never return \code{NULL}, so code calling
the constructor should not check the return value.\VER{INSPECT}{allocated}
  
\item The destructor shall not return a value.\VER{INSPECT}{allocated}
  
\item Constructors and Destructors shall use the memory reference
  counter facilities of the PSLib memory management system.\VER{INSPECT}{allocated}
\end{enumerate}

\subsubsection{Commenting and Documentation}

\begin{enumerate}
\item Commenting of delivered C code shall follow the C coding
  standards and provide tags for Doxygen interpretation of the
  comments and program structures.\VER{INSPECT}{allocated}

\item Commenting of delivered Perl code shall follow the Perl
  coding standards.\VER{INSPECT}{allocated}

\item Source code documentation shall be generated with Doxygen from
  the in-line comments and shall be provided as HTML, Latex, and man
  pages.  \VER{INSPECT}{allocated}

\item User documentation includes the API usage for the modules and
  library functions as well as user interface description for the
  higher-level architectural systems.  User documentation shall be
  delivered as PDF documents.\VER{INSPECT}{allocated}
\end{enumerate}

\subsubsection{Version Control}

Source code version control shall be implemented with CVS.  \VER{INSPECT}{allocated}

\subsubsection{CSCI Deliverable}

All final source code generated for the IPP shall be delivered via CVS,
including the test code.  CVS revision history shall be included and
made available via CVS.\VER{INSPECT}{allocated}

\subsubsection{Platform architectures and operating systems}

Makefiles shall be provided with appropriate flags set so that all
code compiles without warnings under `gcc -Wall' for the following
platform architectures and operating systems:\VER{INSPECT}{allocated}

\begin{itemize}
\item x86/Linux
\item PPC/OS-X
\end{itemize}

The requirement of compiling without warnings includes the allowance
that the output may be filtered to exclude known, specified warnings,
such as those caused by lex-generated code.  

Although the code shall compile successfully under both listed
operating systems, unit testing should only be performed for the
x86/Linux combination.

\subsubsection{Timing measurements}

Timing requirements specified in this document shall be achieved on the
deployed Pan-STARRS analysis computers.\VER{INSPECT}{allocated}

\subsubsection{Software Configuration}

The IPP software configuration management system shall follow the
processes outlined by the Pan-STARRS IPP Software Configuration
Management Place (PSDC-430-003).\VER{INSPECT}{allocated}

\subsection{Architectural Components}

\begin{figure}
\begin{center}
\resizebox{6in}{!}{\includegraphics{pics/IPPoverview.ps}}
\caption{ \label{overview} IPP System Overview}
\end{center}
\end{figure}

As discussed in the Pan-STARRS System Concept Definition
(PSDC-230-002), the IPP is organized into a number of clearly-defined
software elements.  The SCD provides a detailed description of these
subsystems.  In brief, the IPP consists of: a collection of science
analysis programs which perform the stages of the data analysis; a set
of architectural components which provide the infrastructure needed to
run the analysis programs; and a collection of hardware on which all
of the software elements exist and operate.

The architectural components consist of:

\begin{itemize}

\item {\bf IPP Image Server:} This component is a large data store for all
 images used by the IPP, including the raw images from the telescope,
 the master calibration images, the reference static-sky images, and
 any temporary image data products produced by the IPP.  The Image
 Server may also store large data files which do not contain imaging
 data.  The Image Server accepts the incoming data and stores it until
 it is no longer needed by other portions of the IPP.

\item {\bf IPP Metadata Database:} This component is used to store all
 other data which are neither image files nor astronomical object
 data.  The Metadata Database is the authoritative source for all
 metadata data, including metadata which may be duplicated elsewhere,
 such as in the headers of images in the image database.

\item {\bf Astrometry \& Photometry Database (AP):} This component is
 used to store and manipulate astronomical objects detected in images
 processed by the IPP, including individual measurements of objects on
 the images, the summary information about those objects, and
 reference object data.  It includes descriptive information about the
 images, filter, cameras, telescopes, and other aspects of the system
 needed to interpret the object data.

\item {\bf IPP Controller:} In order to perform the analysis stages
 required by the IPP, it is necessary to use distributed computing
 processes on a large number of computers.  The Controller is required
 to manage the collection of analysis stages performed on these
 machines.

\item {\bf IPP Scheduler:} This component is a decision-making mechanism
 required to guide the operation of the IPP: to evaluate the currently
 available collection of data, to identify the necessary analysis, and
 to assign the analysis tasks to the Controller.

\end{itemize}

The relationship between these software elements is shown in
Figure~\ref{overview}.  This figure also shows the interactions
between the IPP and other Pan-STARRS systems.  The following sections
identify requirements of these five software elements.

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

\subsubsection{Image Server}

%% IPP Image Server Requirements

IPP Image Server has the following requirements:

\begin{enumerate}
\item The IPP Image Server shall accept raw images from the summit at
 a sustained rate of 1 exposure (2~GB) per 40 seconds.
 \VER{TEST}{TLR:17, TLR:23}

\item The IPP Image Server nodes shall not be offline for more than 12 hours
  consecutively or 36 hours per year.\VER{ANALYSIS}{TLR:17}

\item The IPP Image Server shall provide a seekable, unix file-system
  reference to the specified image.\VER{TEST}{allocated}

\item The IPP Image Server shall provide a total data capacity of 400
  TB after the first year of PS-1 operations and 750 TB after the
  second year of operations.\VER{INSPECT}{}

\item The IPP Image Server shall provide storage for a total of $2
  \times 10^8$ data objects by the end of the second year of PS-1
  operations.

\end{enumerate}

\subsubsection{Metadata Database}

%% Metadata DB Requirements

The Metadata Database has the following requirements:

\begin{enumerate}
\item The IPP Metadata Database shall accept metadata from the summit
   at a nightly average rate of 1 MB per 40 second.\VER{TEST}{TLR:17,
   TLR:21, TLR:25}

\item The Metadata Database queries shall have a latency of $< 0.1$
  seconds.\VER{TEST}{TLR:17}

\item The Metadata Database shall be capable of at least 100 queries
  per second.\VER{TEST}{TLR:17}

\item The Metadata Database shall be capable of accepting a total data
  volume after 2 years of operation of 280 GB. \VER{INSPECT}{TLR:25}

\item The Metadata Database shall restrict write access of the
  scientific parameters to a different group from the software and
  hardware configuration parameters.\VER{TEST}{allocated}
\end{enumerate}

%% Table: Metadata data classes
\begin{table}
\begin{center}
\caption{Metadata Classes\label{metadata}}
\begin{tabular}{l}
\hline
\hline
raw images \\
pending images \\
master detrend images \\
processed images \\
static sky images \\
detrend residuals \\
object detection statistics \\
master detrend creation statistics \\
astrometry residuals \\
warping statistics \\
processing timing \\
software installation information \\
software configuration information \\
\hline
\end{tabular}
\end{center}
\end{table}

\subsubsection{AP Database}

%% IPP AP DB Requirements
The IPP AP Database has the following performance requirements:

\begin{enumerate}
\item The AP Database shall accept new detections at the rate
  generated by the telescope from the Phase 2 and Phase 4 analysis.
  Except within 10 degrees of the galactic plane, the AP Database
  shall keep up with the incoming rates.  The expected rates are
  listed in Table~\ref{APrates}, along with the total data volume
  required for storage space over the PS-1 lifetime.\VER{TEST}{TLR:2,
  TLR:3, TLR:22}

\item The AP Database shall provide access to external Pan-STARRS
  clients to the detected transient objects within 15 minutes after
  the image is obtained with an 85\% reliability.\VER{TEST}{TLR:22}
  \label{IPP:DeReq:29c}
\end{enumerate}

%%% Table: AP DB parameters 
\begin{table}[hb]
\begin{center}
\caption{AP Detection Classes \& Object Parameters\label{APdetections}}
\begin{tabular}{lrrrr}
\hline
\hline
Object Parameter & P2 & P4$\Sigma$ & P4$\Delta$ & SS \\ 
\hline
PSF x,y, covar, $\alpha,\delta$               & + & + & + & + \\
PSF mag, $\sigma_{\rm mag}$                   & + & + & + & + \\
star/gal sep                                  & + & + & + & + \\
$\sigma_x$, $\sigma_y$, $\theta$              & + & + & + & + \\
local sky data                                & + & + & + & + \\
Petrosian R, M, $R_{50}$, $R_{90}$            & - & + & - & + \\
S\'ersic R, M, AB, $\phi$, $\nu$              & - & + & - & + \\
W.L. $\gamma_1$, $\gamma_2$, pol. terms       & - & - & - & + \\
exp. spaced aps., Poisson noise, variance     & - & - & - & + \\
\hline
\end{tabular}
\end{center}
\end{table}

%%% Table: AP DB Throughput 
\begin{table}
\begin{center}
\caption{AP Data Volume and Throughput Requirements\label{APrates}}
\begin{tabular}{lrrr}
\hline
\hline
Quantity                    & P2                & P4$\Sigma$        & P4$\Delta$        \\
\hline
detection limit             & $20 \sigma$       & $5 \sigma$        & $3 \sigma$        \\
depth (r')                  & 21.8              & 24.0              & 24.5              \\
bytes star$^{-1}$           & 64                & 100               & 64                \\
stars deg$^{-2}$ ($|b|>10$) & $2.0 \times 10^5$ & $8.0 \times 10^5$ & $2.0 \times 10^5$ \\
stars FPA$^{-1}$ ($|b|>10$) & $1.4 \times 10^6$ & $5.6 \times 10^6$ & $1.4 \times 10^6$ \\
stars sec$^{-1}$ ($|b|>10$) & $3.5 \times 10^4$ & $3.5 \times 10^4$ & $8.8 \times 10^3$ \\
MB sec$^{-1}$               & 2.3               & 3.5               & 0.6               \\
AP total TB                 & 7.7               & -                 & -                 \\               
IVP total TB                & 13                & 20                & 3                 \\               
MOPS total TB               & 4                 & 6                 & 1                 \\               
PS-1 total TB               & 25                & 26                & 4                 \\
\hline
\end{tabular}
\end{center}
\end{table}

\subsubsection{Controller}

%% IPP Controller Requirements

IPP Controller requirements:

\begin{enumerate}

\item The IPP Controller shall manage tasks on a cluster of up to 128
  computers.\VER{TEST}{TLR:17}

\item The IPP Controller shall limit command latency to $< 0.1$ seconds.\VER{TEST}{TLR:17}

\item The IPP Controller shall be capable of performing up to 10 tasks per second.\VER{TEST}{TLR:17}

\item The IPP Controller shall be capable of buffering up to a total of 64 MB of messages.\VER{TEST}{TLR:17}

\item The IPP Controller shall be capable of executing up to 6 million tasks per month.\VER{TEST}{TLR:17}

\item The IPP Controller shall be capable of interacting with up to 256 client processes.\VER{TEST}{TLR:17}

\item The IPP Controller shall be capable of accepting up to 2 non-client (external) requests per second.\VER{TEST}{TLR:17}
\end{enumerate}

\subsubsection{Scheduler}

%% IPP Scheduler Requirements

The IPP Scheduler requirements:

\begin{enumerate}
\item The IPP Scheduler shall publish the static sky images to the
  Pan-STARRS PSPS at a rate so that the full sky is transmitted once
  per year.\VER{TEST}{TLR:19}

\item The IPP Scheduler shall query the Databases on a regular basis
  to check for new input information.  These queries shall take place
  at least once every second.\VER{TEST}{TLR:17}

\item The IPP Scheduler shall accept new User input in real-time:
  within 0.1 seconds of the request.\VER{TEST}{TLR:17}

\item The IPP Scheduler shall publish the detected objects to the
  Pan-STARRS PSPS at a rate so that the objects from the full sky are
  transmitted once per year.\VER{TEST}{TLR:20}

\item The IPP Scheduler shall publish the IPP and OTIS metadata to the
  Pan-STARRS PSPS on a time-scale of 1 week.\VER{TEST}{TLR:21}

\item The IPP Scheduler shall send the detected single-occurance
  transient objects to the MOPS subsystem within 5 minutes of the
  image exposure time.\VER{TEST}{TLR:22}

\item The IPP Scheduler shall send the metadata appropriate to the
  images from which single-occurance transient objects were detected
  to the MOPS subsystem within 5 minutes of the image exposure
  time.\VER{TEST}{TLR:22}
\end{enumerate}

%%%%%% Analysis Stages

%%%% Science Image Analysis Stages

\subsection{Science Image Analysis Stages}

We now consider the requirements of the science image analysis tasks
which are performed by the IPP.  These tasks represent the core of the
required IPP functionality; the architectural components discussed
above can be viewed as primarily supporting infrastructure to enable
the analysis tasks to be executed on the appropriate data and to store
the results.

The Science Image analysis stages together represent the basic data
analysis required by the IPP.  Integral to our operational concept for
the IPP is the division of the science image analysis into four
phases, each of which represents a complete analysis on a particular
unit of data.  The tasks and functions of these separate stages are
discussed below.

\subsubsection{General Science Image Analysis Requirements}
There are several requirements which shall be met by the collection of
science image analysis stages as a group.

\begin{enumerate}
\item The IPP Science Analysis shall pre-process the science images
 with the master calibration images at a nightly average rate of 1
 exposure (2~GB) per 40 seconds.\VER{TEST}{TLR:17}

\item The IPP Science Analysis shall merge multiple pre-processed
 science images into stacked images with corresponding signal-to-noise
 maps at a nightly average rate of 1 exposure (2~GB) per 40
 seconds.\VER{TEST}{TLR:17}

\item The IPP Science Analysis shall excise pixels from the input
 images which are outliers for the ensemble of corresponding pixels
 with an efficiency of $> 99$\%.\VER{ANALYSIS}{TLR:18}

\item The IPP Science Analysis shall merge the cleaned images into the
 static sky image, and update the corresponding exposure (S/N) maps,
 at a nightly average rate of 1 exposure (2~GB) per 40
 seconds.\VER{TEST}{TLR:17}

\item The maximum latency between the acquisition of an image and the
  completion of the science image analysis is set by the science
  requirements of the fast transient recovery programs.  The science
  image analysis shall process images to the detection of transients
  within 15 min of their acquisition with an 85\%
  reliability.\VER{TEST}{TLR:22}

\item The science image analysis stages shall processes up to 1000
  science images per night.\VER{TEST}{TLR:17}

\end{enumerate}

%% Phase 1
\subsubsection{Phase 1 : image processing preparation}

The Phase 1 analysis stage is performed on each science exposure (each
complete FPA image) to calculate basic astrometric data needed by the
later stages.  The Phase 1 requirements are:

\begin{enumerate}
\item the Phase 1 analysis shall execute within 2 seconds for a
  complete FPA image.\VER{TEST}{TLR:17, allocated}

\item The Phase 1 analysis stage shall determine the astrometric
  solution of the complete camera (FPA image) with an accuracy of 1
  arcsec peak-to-peak deviation.\VER{TEST}{TLR:3}

\item Bright-star extraction from the image data shall be performed in
  less than 1 second.\VER{TEST}{TLR:17}
  
\item In order for blind astrometry of an image to succeed, it is
  necessary that approximate image coordinates be known.  The Phase 1
  analysis shall succeed despite initial coordinate errors as large as
  20\arcsec.\VER{TEST}{TLR:3}
  
\end{enumerate}

%% Phase 2
\subsubsection{Phase 2 : image reduction}
  
Phase 2 is the detrend stage, in which each detector is separately
processed to remove instrumental signatures.  The result of Phase 2 is
an image with high-quality astrometric and photometric calibrations, a
collection of objects detected in the image and characterized in a
rudimentary way (star / non-stellar), and a measurement of the PSF
across the detector.  The Phase 2 requirements are:

\begin{enumerate}
\item The complete Phase~2 analysis shall be performed in $< 38$
  seconds for up to 4 complete FPA images at one
  time. \VER{TEST}{TLR:17}

\item The bias subtraction shall leave no residuals greater than 1 DN
  peak-to-peak for images within the normal range of bias
  variations.\VER{TEST}{TLR:1}

\item The Phase 2 flat-field correction shall handle zero-valued
  pixels in the flat-field image without raising floating point
  exceptions, setting the corresponding bit value in the
  mask.\VER{TEST}{TLR:1}

\item The flat-fielded image shall have a consistent photometric
  zero-point across the chip, and across the full FPA, with scatter $<
  0.2\%$ and peak-to-peak deviations of $< 0.5\%$.\VER{ANALYSIS}{TLR:1}

\item The residual after the background subtraction shall have an
  average offset of 0 counts, excluding the signal from astronomical
  features.\VER{ANALYSIS}{TLR:5}

\item The background residuals shall have peak-to-peak variations of
  less than 1\% of the input background
  amplitude.\VER{ANALYSIS}{TLR:5}

\item The background residuals shall have a scatter of less than 1\%
  of the input background amplitude for apertures of less than 10
  arcsec.\VER{ANALYSIS}{TLR:1}

\item The Phase 2 analysis shall detect cosmic rays with flux $> 5\sigma$ by
  morphology in single images with an efficiency of $> 95$\% for
  images which are not undersampled.  \VER{TEST}{TLR:18}

\end{enumerate}

%% Phase 3
\subsubsection{Phase 3 : exposure analysis}

The Phase 3 analysis uses the objects detected in Phase 2 and external
reference catalogs to determine improved photometric and astrometric
calibrations for the FPA as a whole, and to improve the measurement of
the PSF and sky variations across the field.  The Phase 3 requirements
are:

\begin{enumerate}

\item The complete Phase~3 analysis shall be performed in $< 2$
seconds for up to 4 complete FPA images at one time. \VER{TEST}{TLR:17}

\item For images obtained under normal observing conditions, the
  resulting astrometric solution shall have a residual scatter of $<
  30$ milliarcseconds when calibrated with the AP Survey reference
  catalog and $< 200$ milliarcseconds when calibrated with the USNO-B
  catalog.\VER{ANALYSIS}{TLR:4}

\item For images obtained under normal observing conditions, the
  resulting astrometric solution shall have systematic errors relative
  to ICRS of $< 100 milliarcseconds$.\VER{ANALYSIS}{TLR:3}

\item For images obtained under photometric conditions or minimal
  cirrus conditions ($< 0.1$ mag total extinction), the resulting
  photometric calibration shall have a relative accuracy of 5
  millimagnitudes.\VER{ANALYSIS}{TLR:1}

\item For images obtained under photometric conditions or minimal
  cirrus conditions ($< 0.1$ mag total extinction), the resulting
  photometric calibration shall have an absolution photometric
  accuracy of 10 millimagnitudes when calibrated relative to the AP
  Survey reference catalog.\VER{ANALYSIS}{TLR:1}

\item For images obtained under photometric conditions or minimal
  cirrus conditions ($< 0.1$ mag total extinction) and under the moon
  conditions listed in Table~\ref{moonconditions}, the resulting sky
  background subtraction shall leave behind peak-to-peak residuals $<
  1$\% of the input sky flux.\VER{ANALYSIS}{TLR:1}

\end{enumerate}

%% Phase 4
\subsubsection{Phase 4 : image combination}

Phase 4 is the image combination stage, in which multiple images of
the same portion of the sky are merged and confronted with the static
sky image.  The Phase 4 requirements are:

\begin{enumerate}
\item The Phase 4 analysis shall not miss any pixels in this match, and
  it shall read no more than 20\% more pixels than necessary from the
  input images.\VER{TEST}{TLR:17}

\item The warped images shall maintain photometric consistency with
  the input image to within 0.2\%.\VER{TEST}{TLR:1}

\item The sky representation shall degrade the image quality by less
  than 150 milliarcseconds added in quadrature to the input image
  quality.\VER{TEST}{TLR:1}

\item The complete Phase~4 analysis shall be performed in $< 38$
  seconds for up to 4 complete FPA images at one
  time. \VER{TEST}{TLR:17}

\item The Phase 4 analysis shall have a transient detection
  completeness of 99\% for detections with a significance $> 5\sigma$.

\item The Phase 4 analysis shall have a false detection rate of $<
  5\%$ for transients detections with a significance $> 5\sigma$.

\end{enumerate}

\subsection{Calibration Stages}
\label{mkcal}

\subsubsection{General Calibration Construction Requirements}

The Calibration analysis stages construct the various types of
calibration frames needed by the IPP.  Requirements for the
calibration processing include the following:

\begin{enumerate}
\item The IPP Calibration Analysis shall produce master calibration
  images from the raw calibration images in less 2
  hours.\VER{TEST}{TLR:17, TLR:22}

\item Master calibration images shall not introduce systematic
 uncertainties in the photometry greater than 0.2\%.\VER{TEST}{TLR:1}

\end{enumerate}

The calibrations consist of the following types of data:

\begin{itemize}
\item Mask
\item Bias 
\item Dark
\item Flat-field
\item Fringe Pattern
\item Low-spatial-frequency sky model 
\item Flat-field correction image
\item Non-linearity correction
\item Telescope astrometry model
\item Zero-point corrections
\end{itemize}

\subsection{Modules}

In order to encapsulate functionality, the analysis stages are
constructed of a sequence of steps.  The analysis stages consist of a
high-level script which executes a sequence of C-level functions.  The
C-level functions executed by the script are called {\em modules} and
represent basic data analysis operations.

The required set of Pan-STARRS modules and their functionality is
specified in the document `Pan-STARRS Image Processing Pipeline Modules
Supplementary Design Requirements' (PSDC-430-012), and details of
specific algorithms are specified in the document `Pan-STARRS Image
Processing Pipeline Algorithm Design Document' (PSDC-430-006).

\subsection{Pan-STARRS IPP Library}

In order to facilitate testing and development, and to encourage
flexibility, the IPP will be built in a layered fashion.  The lowest
level functions will be written in C and collected together into a
Pan-STARRS library, \code{PSLib}.  

The Pan-STARRS Data Library will consist of C structures describing
the basic data types needed by the IPP and C functions which perform
the basic data manipulation operations.  The library is organized into
four topics: System Utilities, Basic Data Collections, Data
Manipulation, and Astronomy-Specific Functions.

The required functionality of the Pan-STARRS Data Library is specified
by the document `Pan-STARRS Image Processing Pipeline Library,
Supplementary Design Requirements' (PSDC-430-007), and details of
specified algorithms are specified in the document `Pan-STARRS Image
Processing Pipeline Algorithm Design Document' (the ADD;
PSDC-430-006).

\subsection{Data Sources and Formats}

\subsubsection{Image Formats}

\begin{enumerate}
\item Certain IPP programs shall be able to read and write standard
  FITS images.\VER{TEST}{allocated}

\item Certain IPP programs shall be able to read and write files in
  modified FITS format with Pan-STARRS definitions for non-square
  pixel arrays.\VER{TEST}{allocated}
\end{enumerate}

\subsubsection{Table Formats}

Certain IPP programs shall be able to read and write FITS tables.\VER{TEST}{allocated}

\subsubsection{Other Data Formats}

Certain IPP program shall be able to read and write XML files.\VER{TEST}{allocated}

\subsubsection{External Catalogs}

\begin{table}
\begin{center}
\caption{Astrometric Reference Catalogs\label{AstroRefs}}
\begin{tabular}{lrrrrl}
\hline
\hline
Name       & scatter limit   & proper   & depth      & Nstars     & filters \\
           & (milliarcsec)   & motion   &(mag)       & (millions) &         \\
\hline
Hipparcos  &   1             & 2        &  7.3       &    0.1     & {\em V}       \\ 
Tycho2	   &  10             & 1        & 11.5       &    2.5     & {\em B,V}     \\ 
UCAC-2     &  20             & 1        & 16.0       &   48.0     & {\em R}       \\ 
USNO-A2.0  & 250             & N/A      & 19.0       &  526.2     & {\em B,R}     \\ 
USNO-B1.0  & 200             & 20       & 21.0       & 1042.6     & {\em B,R}     \\ 
2MASS	   &  70             & N/A      & 16.0       &  470.0     & {\em J,H,K}   \\ 
\hline
\end{tabular}
\end{center}
\end{table}

\begin{table}
\begin{center}
\caption{Photometric Reference Catalogs\label{PhotoRefs}}
\begin{tabular}{lrrr}
\hline
\hline
Name       & scatter  & depth & filters \\
           & mmag     & mag   &         \\
\hline
SDSS       & 15       & 16    & {\em u,g,r,i,z} \\
CFHT-LS    & 10       & 18    & {\em u,g,r,i,z} \\
Landolt    & 10-20    & 15    & {\em U,B,V,R,I} \\
\hline
\end{tabular}
\end{center}
\end{table}

The IPP AP Database shall be able to interact with the externally
provided reference catalogs listed in Table~\ref{AstroRefs} and
Table~\ref{PhotoRefs}.\VER{TEST}{TLR:1, TLR:3}

\subsubsection{Static Sky Pixel Size}

The IPP static sky shall have a pixel scale of
0.2\arcsec.\VER{ANALYSIS}{TLR:16}

\subsection{External Interfaces}

The IPP shall interact with several Pan-STARRS systems and with the
Client Science Pipelines, but it has no requirements to interact with
external systems which are not associated with the Pan-STARRS project. 

\begin{enumerate}

\item The IPP shall receive Metadata data from OTIS.\TASK

\item The IPP shall send image quality assessments to OTIS.\TASK

\item The IPP shall receive raw images from the Camera System.\TASK

\item The IPP shall send 3$\sigma$ transient non-orphaned detections
  to MOPS.\TASK

\item The IPP shall send all 3$\sigma$ transient detections to
  Transient Science Client.\TASK

\item The IPP shall send static sky images to Science Database after
  they are released for publication.\TASK

\item The IPP shall send object detections from Phase 2, Phase 4 (Sum
  and Difference detections) and the static sky images to the
  Published Science Products System after they are release for
  publication.\TASK
\end{enumerate}

\subsection{Internal Interfaces}

The IPP has internal interfaces between several of the architectural
components and between the architectural components and the analysis
stages.  

\begin{enumerate}

\item IPP Scheduler - IPP Controller.  The IPP Scheduler shall send to
the IPP Controller information about the tasks to be performed and
shall receive from the IPP Controller descriptions of the success or
failure of these tasks.\TASK

\item IPP Scheduler - Metadata DB.  The IPP Scheduler shall query the
Metadata DB to determine an appropriate course of action.  The IPP
Scheduler shall send result and status information to the Metadata
DB.\TASK

\item IPP Controller - Analysis Tasks.  The IPP Controller shall
 initiate the Analysis Tasks and monitor their output and exit
status.\TASK

\item Analysis Tasks - Metadata DB.  The Analysis Tasks shall be able
to query the Metadata DB as needed to extract metadata needed for a
given task.  The Analysis Tasks shall be able to send results and
updates to the Metadata DB.\TASK

\item Analysis Tasks - Image Server.  The Analysis Tasks shall be able
to extract relevant images from the Image Server.  The Analysis Tasks
shall be able to send output images to the Image Server.\TASK

\item Analysis Tasks - AP DB.  The Analysis Tasks shall be able to
extract information related to specific objects from the Astrometric
and Photometric Database.  The Analysis Tasks shall be able to send
result detections to the AP Database.\TASK
\end{enumerate}

\subsection{Internal Data Requirements}

The internal data requirements of the IPP are left as detailed design
decisions, and are specified within the IPP Supplementary Design
Requirements Documents for the IPP Modules and Library.

\subsection{Computer Hardware}

\subsubsection{Overview}

This section discusses the IPP PS-1 hardware requirements.  The
hardware requirements addressed in this section consist of:

\begin{itemize}
\item Total Disk Volume
\item Total Processing Power
\item Sustained Switch Bandwidth
\item Sustained Node Network I/O
\item Sustained Disk I/O
\item Availabilty
\end{itemize}

The report, `The Pan-STARRS Image Processing Pipeline Computational
Challenge' (PSDC-400-006) discusses the assumptions and measurements
made to determine the IPP computing requirements, for both the PS-1
configuration and the PS-4 configuration, under multiple assumptions
regarding the data volume.  The requirements in this section are
derived from that report, and follow the minimal data volume
assumptions for PS-1.

\begin{table}[b]
\begin{center}
\caption{Data Storage Requirements \label{storage}}
\begin{tabular}{lr}
\hline
\hline
Raw data           & 400 TB \\ 
static sky         & 350 TB \\
calibration frames & 2.8 TB \\
metadata db        & 0.3 TB \\
AP db              &  55 TB \\
\hline
total              & 810 TB \\
\hline
\end{tabular}
\end{center}
\end{table}

\subsubsection{Data Storage Requirements}

The Pan-STARRS IPP data storage requirements may be divided into five
principal areas: raw image data, static sky image data, master
calibration images, the metadata database, and the object database.
Table~\ref{storage} summarizes the data storage requirements for these
types of data.  

\begin{enumerate}
\item The IPP shall store all raw images from the first year from the
  AP and IVP surveys.  This corresponds to 180,000 images, or 360 TB,
  assuming 2 GB per image.  The IPP will require space for 400 TB of
  raw imagery to store the data from these two survey components along
  with raw calibration, test, and short-term storage of other raw
  images not in the AP and IVP surveys.\VER{INSPECT}{TLR:23}

\item The IPP shall store a single copy of the complete static sky in
  all 6 filters.  With the assumed image sampling of 0.2 arcsec per
  pixel, this corresponds to 9.7 Tpix per filter, or a total of 350 TB
  for the 6 filters, with 4 bytes for the image pixels and 2 bytes for
  the noise map pixesl.\VER{INSPECT}{TLR:6, TLR:11}

\item The IPP shall store all detections from the AP, IVP, and MVP
  Surveys.  These detections make up a total of 55 terabytes (see
  Table~\ref{APrates}). \VER{INSPECT}{TLR:24}

\item The IPP shall store all metadata and master calibration images
  from two years of PS-1 operation.  The metadata is a fraction of a
  terabyte, while the calibration frames (all master detrend frames)
  represent at most 2 terabytes.  \VER{INSPECT}{TLR:25}

\item The IPP shall have storage capacity for a total of 810 TB of
  data by the end of PS-1.
\end{enumerate}

\subsubsection{CPU Requirements}

\begin{enumerate}
\item The IPP shall provide sufficient computing resources to process
images obtained at a cadence of 1 image per 40 seconds.\VER{TEST}{TLR:17}

\item The IPP shall perform the Phase 1 and Phase 2 analyses within an
average time of 40 seconds per single Gigapixel camera image.  The
Phase 2 analysis has been measured to require 3200 GHz-sec on a
Pentium-4 machine.\VER{TEST}{TLR:17}

\item The IPP shall perform the Phase 3 and Phase 4 analyses on a set
of 4 input frames within an average time of 180 seconds.  The Phase 4
analysis has been measured to require a total of 7800 GHz-sec on a
Pentium-4 machine for a major frame of 4 input Gigapixel camera
images.\VER{TEST}{TLR:17}
\end{enumerate}

\subsubsection{Network I/O Requirements}

The switch I/O requirements are defined by the total number of bytes
per second serviced by the network switch.  In the assumption that all
Phase 2 processing is performed locally on the nodes which store the
raw images and the corresponding detrend images, and that all Phase 4
processing requires complete network distribution of both the initial
and updated static sky images, the total I/O for a 160 second
major-frame period is:
\begin{itemize}
\item 8 GB from summit to Phase 2 (4 images @ 2 GB each)
\item 18 GB from Phase 2 to Phase 4 (3 bytes per pixel for image +
  mask, 50\% image overhead)
\item 9 GB from Static Sky to Phase 4 (2.25 static-sky pixels per
  input image pixel, 4 bytes per pixel).
\item 9 GB from Phase 4 to Static Sky 
\end{itemize}
for a total of 44 GB, of which 26 GB are used by the Phase 2 nodes and
36 are used by the Phase 4 nodes.  The IPP shall be capable of
sustaining this network load.\VER{TEST}{TLR:17}

\paragraph{Phase 2 Disk I/O Requirements}

For each major frame processed, the total I/O to and from disk for
Phase 2 is:
\begin{itemize}
\item 8 GB raw image from summit to Phase 2 nodes (4 images @ 2 GB each)
\item 8 GB raw image from Phase 2 disk to memory
\item 40 GB detrend image from Phase 2 disk to memory
\item 12 GB processed image from memory to Phase 2 disk (2 bytes image
  + 1 byte mask).
\item 18 GB processed image from Phase 2 disk to Phase 4
\end{itemize}
for a total of 86 GB Disk I/O for Phase 2 for a complete major frame.\VER{TEST}{TLR:17}

\paragraph{Phase 4 Disk I/O Requirements}
For each major frame processed, the total I/O to and from disk for
Phase 4 is:
\begin{itemize}
\item  9 GB static image from Phase 4 disk to memory
\item  9 GB static image from memory to Phase 4 disk
\end{itemize}
for a total of 18 GB I/O for Phase 4 for a complete major frame.\VER{TEST}{TLR:17}

\subsubsection{Total Node Requirements}

The I/O and CPU requirements above may be confronted with reasonable
assumptions of bandwidth and CPU speeds to estimate the number of
nodes required for the IPP.  Each CPU is matched with one network
adapter and one disk array.  
\begin{enumerate}
\item The IPP requires at least 40 Phase 2 Nodes (OTA Nodes)\VER{TEST}{TLR:17}
\item The IPP requires at least 5 TB for each Phase 2 node\VER{TEST}{TLR:17}
\item The IPP requires at least 25 Phase 4 Nodes (Static Sky Nodes)\VER{TEST}{TLR:17}
\item The IPP requires at least 14 TB for each Phase 4 node\VER{TEST}{TLR:17}
\item The IPP requires at least 10 AP DB Nodes\VER{TEST}{TLR:17}
\end{enumerate}

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

\section{Test Verification}

A testing regime shall be implemented to demonstrate the working state
of the provided software.  Certain tests as specified shall be
performed by MHPCC, with code release contingent on success.  Other
specified tests will be performed by IfA to verify the validity of the
implemented algorithms.  The tests include: software configuration
tests, software integrity tests, basic unit tests, and detailed
functional analysis.

\subsection{Software Configuration Tests}

MHPCC shall test the validity of the software configuration,
specifically to check that the code can be compiled on the specified
platforms and that the compilation produces no errors or warnings,
except as noted and allowed.

\subsection{Software Integrity Tests}
\begin{enumerate}

\item MHPCC shall test that the code does not produce memory leaks.

\item MHPCC shall test that the code does not produce segmentation faults.
\end{enumerate}

\subsection{Basic Unit Tests}

MHPCC shall perform basic unit tests with sample input data and known
output results, including invalid input data to test error handling.
These tests shall exercise the complete range of module options.

\subsection{Detailed Functional Analysis}

IfA shall perform detailed tests with a wide range of input data and
compare the results with existing software system.

\subsection{Test Verification Matrix}

Test Verification Matrix information is supplied with each identified
requirement in this document.

\subsection{Trace Matrix}
\input{ippSRStrace.tex}

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

\clearpage
\appendix

\bibliographystyle{plain}
\bibliography{panstarrs}
\end{document}
