IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 810


Ignore:
Timestamp:
May 28, 2004, 2:56:14 PM (22 years ago)
Author:
eugene
Message:

substantial changes to SRS: split into SRS & SCD

Location:
trunk/doc/design
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/design

    • Property svn:ignore
      •  

        old new  
        66*.out
        77*.lof
        8 design.pdf
        9 specs.pdf
         8ippSCD.pdf
         9ippSRS.pdf
         10ippSDRS.pdf
         11hardware.pdf
         12notes
         13old
         14.mana
         15.status
  • trunk/doc/design/.cvsignore

    r744 r810  
    11*.log *.dvi *.aux *.toc *.log *.out *.lof
    2 design.pdf specs.pdf
     2ippSCD.pdf
     3ippSRS.pdf
     4ippSDRS.pdf
     5hardware.pdf
     6notes
     7old
     8.mana
     9.status
  • trunk/doc/design/Makefile

    r772 r810  
    1 # $Id: Makefile,v 1.3 2004-05-25 00:42:57 eugene Exp $
     1# $Id: Makefile,v 1.4 2004-05-29 00:56:14 eugene Exp $
    22
    33PDFLATEX = pdflatex
     
    1313
    1414clean :
    15         $(RM) *.log *.dvi *.aux *.toc *.log *.out *~ core
     15        $(RM) *.log *.dvi *.aux *.toc *.lof *.out *~ core
    1616
    1717empty : clean
  • trunk/doc/design/ippSDRS.tex

    r771 r810  
    1 %%% $Id: ippSDRS.tex,v 1.1 2004-05-25 00:38:56 eugene Exp $
     1%%% $Id: ippSDRS.tex,v 1.2 2004-05-29 00:56:14 eugene Exp $
    22\documentclass[panstarrs]{panstarrs}
    33
     
    16641664\subparagraph{Convolve de-trend images}
    16651665
     1666\tbd{Must this be a formal convolution with the analytical OT kernel,
     1667or can it be a convolution with a decomposed kernel?}
     1668
     1669\tbd{what is the source of the OT kernel?  pixel server?}
     1670
    16661671This module convolves the de-trend images with the OT convolution kernel
    16671672so that they can be used to de-trend the object image.  The inputs
  • trunk/doc/design/ippSRS.tex

    r771 r810  
    1 %%% $Id: ippSRS.tex,v 1.1 2004-05-25 00:38:56 eugene Exp $
     1%%% $Id: ippSRS.tex,v 1.2 2004-05-29 00:56:14 eugene Exp $
    22\documentclass[panstarrs]{panstarrs}
    33
     
    2525DR.02 & 2003.03.10 & Second draft \\ \hline
    2626DR.03 & 2003.04.13 & Most paragraphs fleshed out \\ \hline
     27DR.04 & 2003.04.27 & Basic text frozen for internal review \\ \hline
     28DR.05 & 2003.05.24 & Incorporating comments from internal review \\ \hline
    2729\RevisionsEnd
     30
     31\tableofcontents
     32\pagebreak
    2833
    2934\listoffigures
    3035\pagebreak
    31 
    32 \tableofcontents
    33 \pagebreak
    3436\pagenumbering{arabic}
    3537
     
    4042\subsection{Identification}
    4143
    42 This document establishes the system requirements for the Pan-STARRS
     44This document establishes the software requirements for the Pan-STARRS
    4345Image Processing Pipeline (IPP) as applied to Pan-STARRS 1 (PS-1), the
    4446initial demonstration telescope to be constructed on Haleakala by Jan
     
    5658that series is implied. 
    5759
    58 Open Issues and TBDs in this document are marked \tbd{in bold, red
    59 with surrounding square brackets}.
    60 
    61 All timing measurements are to execution time as measured on a
    62 \tbd{Reference Pan-Starrs Computation Node} and assumed to be not
    63 limited by network bandwidth.
    64 
    65 \subsubsection{Definitions}
     60Open issues (TBDs) in this document are marked \tbd{in bold, red with
     61surrounding square brackets}.
     62
     63Quantities which should be reviewed (TBRs) are marked \tbr{in bold,
     64blue with surrounding square brackets}.
     65
     66\subsubsection{Requirements Definitions}
    6667
    6768\paragraph{``Must''}  When used in this specification, the word
    6869``must'' refers to an explicit requirement of a system component or
    69 the complete system.
     70the complete system.  In this document, the use of the word ``must''
     71replaces, and is equivalent to, use of the word ``shall'' found in
     72many requirements documents.
    7073
    7174\paragraph{``Should''}  When used in this specification, the word
     
    8083
    8184\DocumentsInternalSection
    82 PSDC-430-xxx  &   PS-1 Design Reference Mission \\ \hline
     85PSDC-130-001  &   PS-1 Design Reference Mission \\ \hline
    8386PSDC-430-004  &   Pan-STARRS IPP C Code Conventions \\ \hline
    8487PSDC-430-006  &   Pan-STARRS IPP ADD \\ \hline
    85 PSDC-430-007  &   Pan-STARRS IPP PSLib SDR \\ \hline
     88PSDC-430-007  &   Pan-STARRS IPP PSLib SDRS \\ \hline
    8689\DocumentsExternalSection
    8790Posix Standard & Open Group Based Specifications Issue 6, IEEE Std 1003.1, 2003 \\
     
    9295\section{Requirements}
    9396
    94 \subsection{Required States}
    95 
    96 The IPP must have 3 states: active, paused, and interactive.
    97 
    98 \subsubsection{Active State}
    99 \label{req:active-state}
    100 
    101 In active state, the IPP must accept images and metadata from OATS and
    102 automatically perform the complete set of image processing tasks,
    103 including both calibration and science image processing.  The IPP must
    104 respond to requests for data from the client science pipelines
    105 \tbd{and IPP monitoring team}.
    106 
    107 \subsubsection{Paused State}
    108 \label{req:paused-state}
    109 
    110 In paused state, the IPP must refuse data and metadata from OATS and
    111 data requests from the client science pipelines.
    112 
    113 \subsubsection{Interactive State}
    114 \label{req:interactive-state}
    115 
    116 In interactive state, the IPP must accept data and metadata from OATS,
    117 but must not automatically process the data.  The IPP must respond to
    118 user commands to initiate portions of the data analysis.
    119 
    120 \subsection{System Capability Requirements}
     97\subsection{Science Requirements}
    12198\label{req:system-capabilities}
     99
     100\tbd{distinguish data products in commissioning, during PA survey,
     101after PA survey}
    122102
    123103The IPP must perform the following tasks:
     
    186166\end{enumerate}
    187167
    188 \subsubsection{Software Coding Requirements}
    189 
    190 \paragraph{Languages}
     168\subsection{Required States}
     169
     170The IPP must have 3 states: active, paused, and interactive.
     171
     172\subsubsection{Active State}
     173\label{req:active-state}
     174
     175In active state, the IPP must accept images and metadata from the
     176external sources (i.e., the summit) and automatically perform the
     177complete set of image processing tasks, including both calibration and
     178science image processing.  The IPP must respond to requests for data
     179from client science pipelines.
     180
     181\subsubsection{Paused State}
     182\label{req:paused-state}
     183
     184In paused state, the IPP must refuse incoming data and metadata and
     185data requests from the client science pipelines.
     186
     187\subsubsection{Interactive State}
     188\label{req:interactive-state}
     189
     190In interactive state, the IPP must accept imcoming data and metadata,
     191but must not automatically process the data.  The IPP must respond to
     192user commands to initiate portions of the data analysis.
     193
     194\subsection{Software Coding Requirements}
     195
     196\subsubsection{Languages}
    191197\label{req:languages}
    192198
     
    196202Scripting language must be \tbd{Python, version TBD}.
    197203
    198 \paragraph{Interfaces}
    199 \label{req:interfaces}
    200 
    201 Access to low-level Library functions must be provided via C APIs
    202 consisting of the function calls and the defined data structures and
    203 other data types.  Access to high-level functions must be provided
    204 via C APIs as well as SWIG interfaces, where specified.  Access to
    205 processing jobs must be available via the UNIX shell.
    206 
    207 \paragraph{Coding Standards}
    208 
    209 The C code must comply with ANSI Standard C99.  Because the delivered
    210 code is required to run on UNIX machines, the delivered code must be
    211 in compliance with the language-independent UNIX operating system
    212 standard POSIX (Open Group Based Specifications Issue 6, IEEE Std
    213 1003.1, 2003).  Source code files must use the UNIX line-break
    214 convention (line-feed only).  C coding style must adhere to the
    215 standard defined in the document 'Pan-STARRS C-coding standard'
    216 (PSDC-430-004).  \tbd{Python coding must follow the Python standard
    217 defined in the document TBD}.
    218 
    219 \paragraph{Naming Conventions}
     204\subsubsection{Interfaces}
     205We require the following types of interfaces:
     206\begin{enumerate}
     207\item Access to low-level Library functions must be provided via C
     208APIs consisting of the function calls and the defined data structures
     209and other data types.
     210\item Access to high-level functions must be provided via C APIs as
     211well as SWIG interfaces, where specified. 
     212\item Access to processing jobs must be available via the UNIX shell.
     213\end{enumerate}
     214
     215\subsubsection{Coding Standards}
     216
     217\begin{enumerate}
     218\item The C code must comply with ANSI Standard C99. 
     219\item Because the delivered code is required to run on UNIX machines,
     220the delivered code must be in compliance with the language-independent
     221UNIX operating system standard POSIX (Open Group Based Specifications
     222Issue 6, IEEE Std 1003.1, 2003).
     223\item Source code files must use the UNIX line-break
     224convention (line-feed only). 
     225\item C coding style must adhere to the standard defined in the
     226document 'Pan-STARRS C-coding standard' (PSDC-430-004). 
     227\item \tbd{Python} coding must follow the standard defined in the
     228document \tbd{TBD}.
     229\end{enumerate}
     230
     231\subsubsection{Naming Conventions}
    220232
    221233Header files must have names starting \code{ps} or \code{p_ps} for
     
    224236for the public header files.
    225237
    226 Functions visible at global scope which are part of the public API
    227 must have names begining with \code{ps}, and follow the naming
    228 conventions in the coding standard.  Functions that are visible at
    229 global scope but which are not part of the public interface must have
    230 names begining with \code{p_ps}.  Functions that are local to a file
    231 must \textit{not} start \code{ps} (or \code{p_ps}).
     238Functions visible at global scope that are part of the public API must
     239have names begining with \code{ps} and follow the naming conventions
     240in the coding standard.  Functions visible at global scope but which
     241are not part of the public interface must have names begining with
     242\code{p_ps}.  Functions that are local to a file must \textit{not}
     243start \code{ps} (or \code{p_ps}).
    232244 
    233245Variables visible at global scope which are part of the public API
     
    251263\code{psEquatorial2Ecliptic}).
    252264
    253 \paragraph{C Programming Guidelines}
     265\subsubsection{C Programming Guidelines}
    254266
    255267Functions that assign to a variable must list that argument
     
    290302\end{itemize}
    291303
    292 \paragraph{Commenting and Documentation}
     304\subsubsection{Commenting and Documentation}
    293305
    294306Commenting of delivered C and Python code must follow the C and
     
    304316documentation must be delivered as PDF documents.
    305317
    306 \paragraph{Version Control}
     318\subsubsection{Version Control}
    307319
    308320Source code version control must be implemented with CVS. 
    309321
    310 \paragraph{CSCI Deliverable}
     322\subsubsection{CSCI Deliverable}
    311323
    312324All final source code generated for the IPP is to be delivered via
     
    314326and made available via CVS.
    315327
    316 \paragraph{Platform architectures and operating systems}
     328\subsubsection{Platform architectures and operating systems}
    317329
    318330Makefiles must be provided with appropriate flags set so that all
     
    333345x86/Linux combination.
    334346
    335 \paragraph{Software Configuration}
     347All timing measurements are to execution time as measured on a
     348\tbd{Reference Pan-Starrs Computation Node} and assumed to be not
     349limited by network bandwidth.
     350
     351\subsubsection{Software Configuration}
    336352
    337353\tbd{deferred}
    338354
    339 \subsubsection{Architectural Components}
    340 
    341 In order to achieve the required functionality, it is necessary to
    342 divide the IPP into a number of clearly-defined software elements,
    343 listed as follows:
     355\subsection{Architectural Components}
     356
     357As discussed in the Pan-STARRS System Concept Definition, the IPP is
     358organized into a number of clearly-defined software elements.  The SCD
     359provides a detailed description of the roles and responsibilities of
     360these subsystems.  In brief, the IPP consists of a collection of
     361science analysis stages, a set of architectural components which
     362provide the infrastructure needed to run the analysis programs, and a
     363collection of hardware on which all of the software elements exist.
     364
     365The architectural components consist of:
    344366
    345367\begin{enumerate}
    346368
    347 \item {\bf Pixel Server:} This component is a large data store for all
     369\item {\bf Image Server:} This component is a large data store for all
    348370 images used by the IPP, including the raw images from the telescope,
    349371 the master calibration images, the reference static-sky images, and
    350  any temporary image data products produced by the IPP.  The Pixel
     372 any temporary image data products produced by the IPP.  The Image
    351373 Server is required to meet all of the image storage needs identified
    352  in the top-level requirements above.  The Pixel Server must accept
     374 in the top-level requirements above.  The Image Server must accept
    353375 the incoming data and store it until it is no longer needed by other
    354376 portions of the IPP.
     
    364386  as needed to perform the analysis specified above.
    365387
    366 \item {\bf Analysis Stages:} Specific programs are required to perform
    367   the processing steps listed above.  These can be divided into
    368   well-defined analysis stages, each of which operates on a particular
    369   unit of data, such as a single OTA image or a collection of
    370   astronomical objets.
    371 
    372388\item {\bf Controller:} In order to perform the analysis stages
    373389  required by the IPP, it is necessary to use distributed computing
     
    389405\begin{figure}
    390406\begin{center}
    391 \resizebox{8cm}{!}{\includegraphics{pics/overview.ps}}
     407\resizebox{8cm}{!}{\includegraphics{pics/overview}}
    392408\caption{ \label{overview} IPP System Overview}
    393409\end{center}
     
    396412%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    397413
    398 \paragraph{Pixel Server}
    399 
    400 The IPP Pixel Server \tbd{rename as Image Server?} is a large data
    401 store for all images used by the IPP.  The Pixel Server is required to
    402 store all of the images needed by the IPP for the length of time they
    403 are required; total data volume is specified in detail in the hardware
    404 summary, but is in the vicinity of \tbd{700 TB}.
    405 
    406 The IPP Pixel Server must maintain a record of all images currently
    407 available in the repository \tbd{and all no longer available}.  This
    408 record must include the image name, location (which machine), the
    409 state of the image (available, deleted), the image size, the image
    410 type, and the existence and location of secondary copies of the image.
    411 This information need not include other metadata such as the image
    412 summary statistics or the state of the image processing for the image,
    413 as these aspects are included in the Metadata DB.
    414 
    415 The IPP Pixel Server must store images as FITS files on disk.  Raw
    416 images from the telescope must be stored as individual OTA images for
    417 each file, with multiple Cell images per file as well as video
    418 sequences from the guide stars.  Images of the Static Sky must be
    419 stored in the form of \tbd{triangular segments} to minimize the total
    420 data volume and pixel overlap.
    421 
    422 The IPP Pixel Server must distribute images across a cluster of
    423 machines.  The IPP Pixel Server must be capable of honoring requests
    424 to store an image on a specific machine.  If such a request cannot be
    425 honored, the IPP Pixel Server must select an appropriate machine and
    426 notify the requesting agent of the new locations.  The IPP Pixel
    427 Server must provide a mechanism to maintain multiple (at least two)
    428 copies of each image.
    429 
    430 The IPP Pixel Server must interface with other subsystems of the IPP.
    431 It must provide an interface to other IPP subsystems to identify the
    432 image location (the computer on which it resides).  It must provide a
    433 mechanism to serve a specified image to another IPP or Pan-STARRS
    434 subsystem.  It must provide a mechanism for deletion of images in the
    435 Pixel Server.  It must have a mechanism to accept or retrieve an image
    436 from another Pan-STARRS subsystem, in particular OATS.  Communication
    437 of messages between the IPP Pixel Server and other subsystem must be
    438 via \tbd{XML messages} passed via \tbd{some transport}.
    439 
    440 The IPP Pixel Server must accept images at the telescope maximum rate
    441 of 1 full-camera image every 30 seconds.  The IPP Pixel Server must
    442 therefore accept notifications and process retrievals at a rate of 64
    443 raw OTAs in 30 seconds.
    444 
    445 \tbd{O/S, language, SQL, ODBC requirements?}
    446 
    447 \tbd{hardware requirements?}
    448 
    449 \tbd{communication protocols?}
    450 
    451 \paragraph{P\&A Database}
    452 
    453 The IPP requires a mechanism to store data related to astronomical
    454 objects derived from various sources with a variety of associations.
    455 The PnA (Photometry and Astrometry) Database serves this function.
    456 The PnA Database deals with two related concepts: {\em objects} and
    457 {\em detections}.  The objects are descriptions of astronomical
    458 objects while the detections are the specific measurements of those
    459 objects on an image.  A collection of {\em detections} may be used to
    460 derive average quantities which describe a particular {\em object}.
    461 
    462 The PnA Database must store the collections of detections which were
    463 derived from specific images from any of the analysis stages.  It must
    464 be possible to determine and locate (perhaps via interactions with the
    465 pixel server) the image from which a specific detection was derived.
    466 It must also be possible to extract all detections derived from a
    467 specific image.  These associations must include descriptive
    468 information including the coordinates of the detection on the image.
    469 
    470 The PnA Database must provide a mechanism to associate together
    471 multiple detections of a specific object.  Several major classes of
    472 objects will be present, each of which must be handled correctly.
    473 
    474 First, the most distant stars, compact galaxies, and QSOs will have
    475 nearly fixed locations relative to other nearby stars, with only small
    476 deviations for individual measurements.  The association between
    477 multiple detections of such objects must be made on the basis of their
    478 coincident positions.  The PnA Database must be able to determine the
    479 average position of the object and the deviations of the individual
    480 detections from that average.
    481 
    482 Second, solar system objects do not have a fixed location and
    483 detections of such objects must associated on the basis of their
    484 coincidence with the orbit of the objects.  The PnA Database must be
    485 able to associate detections with the orbits of known objects.  The
    486 determination of this association is the responsibility of the MOPS
    487 and must be communicated to the IPP PnA Database on \tbd{some
    488 timescale}.  The PnD Database must be able to retrieve the detections
    489 associated with the object and to provide the object associated with
    490 the specific detections.  This association must include descriptive
    491 information such as the offset of the detection from the predicted
    492 location of the detection based on the orbit.  This functionality is
    493 required to allow the PnA Database to ignore known moving object
    494 detections from other types of queries.
    495 
    496 Third, stars in the general vicinity of the solar system fall in
    497 between these first two classes of objects.  Their proper motion and
    498 parallax response is significant enough ($>1$ arcsec in 10 years) that
    499 they are not well-described by an average location and a collection of
    500 offsets.  These objects must be described by a distance and a proper
    501 motion vector.  The PnA Database must be able to find and associate
    502 detections of objects for which either of the parallax or the proper
    503 motion are substantial.
    504 
    505 Fourth, many detections, especially in their initial states, will not
    506 be associated with a specific astronomical object of any of the above
    507 classes and should be treated as orphans.  Some of these will be
    508 suprious (not represent real objects), some will be from solar system
    509 objects for which orbits are not yet determined, some will be from
    510 faint stars near the detection limits, some will be from short-term
    511 transients which have only been detected once.  The PnA Database must
    512 be able to carry these detections until they have been associated with
    513 one of the objects above.  It must be possible to migrate individual
    514 detections associated with an astronomical object back to the orphan
    515 state. 
    516 
    517 For every object, and all orphaned detections, it must be possible to
    518 determine the images for which the coordinates were included but for
    519 which no detection was made.  The minimum set of information which
    520 must be carried for these non-detections is the image and the
    521 associated object or orphan.
    522 
    523 The PnA Database must store the relationships between various
    524 photometric systems and, in some cases, the evolution of that
    525 relationship.  It must be possible, given a determined set of
    526 calibrations, to convert between the measured instrumental magnitude
    527 of a detection with a specific filter, detector, and telescope, and at
    528 particular time and the implied magnitude in the average Pan-STARRS
    529 magnitude systems.  It must also be possible, given the magnitudes of
    530 an object in one system to convert those to the magnitudes in another
    531 system; an example of such a conversion is between the average
    532 Pan-STARRS filter systems and the various reference systems
    533 appropriate for those filters.
    534 
    535 The PnA Database must provide interfaces to extract lists of objects
    536 and detections based on various query parameters.  It must be possible
    537 to extract all detections associated with a specific object, all
    538 non-detections of that object (or orphan) and summary statistics from
    539 these collections.  It must be possible to extract all objects or
    540 detections within specified spatial regions including regions bounded
    541 by great circles (RA,DEC; GLAT,GLON; ELAT,ELON) and regions described
    542 by a location and a search radius.  It must be possible to extract the
    543 image parameters associated with a specific detection including image
    544 coordinates of the detection, exposure time, time and date of the
    545 detection, etc.
    546 
    547 \tbd{volume requirements}
    548 
    549 \tbd{speed / access requirements}
    550 
    551 \paragraph{Metadata Database}
     414\subsubsection{Image Server}
     415
     416The IPP Image Server must store images on a distributed collection of
     417computer disks.  Individual instinces of a file are only required to
     418be stored on a single machine (striping across computers is not a
     419requirement). 
     420
     421The IPP Image Server must be capable of honoring requests to store an
     422image on a specific machine.  If such a request cannot be honored (ie,
     423the machine is down), the IPP Image Server must select an appropriate
     424machine and notify the requesting agent of the new locations. 
     425
     426The IPP Image Server be able to maintain multiple copies of each
     427image, as specified by the user.
     428
     429The IPP Image Server must maintain a record of all image copies
     430currently available in the repository.  This record must include the
     431image name, location (which machine), the image size, and the state of
     432the image. 
     433
     434The IPP Image Server must lock images in the repository on request.
     435Both read (shared) and write (exclusive) locks must be provided.  A
     436read lock must prevent write access to the file; a write lock must
     437prevent both read and write access.
     438
     439The IPP Image Server must return the image location (the computer on
     440which it resides) upon request.
     441
     442The IPP Image Server must return a specified image upon request.
     443
     444The IPP Image Server must delete images in the repository on request.
     445
     446The IPP Image Server must accept images from the summit at the maximum
     447rate of 1 full-camera image every 30 seconds.  The IPP Image Server
     448must therefore accept new images into the repository at a rate of 64
     449raw OTAs in 30 seconds and a total input data volume rate of 75
     450MB/sec.
     451
     452\subsubsection{PA Database}
     453
     454\begin{table}
     455\begin{center}
     456\caption{PA Detection Classes \& Object Parameters\label{PAdetections}}
     457\begin{tabular}{lrrrr}
     458\hline
     459\hline
     460Object Parameter & P2 & P4S & P4D & SS \\
     461\hline
     462PSF x,y, M, $\sigma_{\rm M}$                & + & + & + & + \\
     463$\sigma_x$, $\sigma_y$, covar.              & + & + & + & + \\
     464exp. spaced aps., Poisson noise, variance   & - & - & - & + \\
     465streak L, $\phi$, $\sigma_L$, $\sigma_\phi$ & - & - & + & + \\
     466$x_g$, $y_g$, flag                          & + & + & - & + \\
     467local sky data                              & + & + & + & + \\
     468Petrosian R, M, $R_{50}$, $R_{90}$          & - & + & - & + \\
     469S\'ersic R, M, AB, $\phi$, $\nu$            & - & + & - & + \\
     470W.L. $\gamma_1$, $\gamma_2$, pol. terms     & - & - & - & + \\
     471star/gal sep, star/streak sep.              & - & + & + & + \\
     472\hline
     473deVeucaleur R, M, AB, $\phi$                & - & + & - & + \\
     474exponential R, M, AB, $\phi$                & - & + & - & + \\
     475\hline
     476\end{tabular}
     477\end{center}
     478\end{table}
     479
     480The PA Database must accept and store individual detections and
     481collections of detections along with information about the image which
     482provided the detections.
     483
     484Detections must be saved as one of several detection classes (P2, P4S,
     485P4D, SS) and the PA Database must store the appropriate parameters,
     486listed in Table~\ref{PAdetections}, for each class.
     487
     488The PA Database must identify the image which provided the detection,
     489or in the case of external references, an identifier specific to the
     490reference source.
     491
     492The PA Database must group detections into objects and measure average
     493parameters of those objects. 
     494
     495The PA Database must store parallax and proper motion parameters for a
     496subset of the average objects.
     497
     498The PA Database must store image and filter calibration information
     499necessary to convert between instrumental magnitudes and calibrated
     500magnitudes in standard systems.
     501
     502The PA Database must perform at least the follow queries, with
     503constraints on the output based on at least time ranges, magnitude
     504limits, error limits:
     505\begin{enumerate}
     506\item given (RA,DEC) and a Radius, return all objects and/or
     507detections in the region.
     508
     509\item given (RA,DEC)_0 - (RA,DEC)_1, return all objects and/or
     510  detections in the region.
     511
     512\item given (RA,DEC), return closest object.
     513
     514\item given object ID, return all detections
     515
     516\item given detection, return source image data.
     517
     518\item given (RA,DEC), return all images overlapping coordinate.
     519
     520\item given (RA,DEC) and a Radius, return all images overlapping region.
     521
     522\item given (RA,DEC)_0 - (RA,DEC)_1, return all images overlapping
     523  region.
     524
     525\item given detection instrumental magnitude, return derived
     526  magnitudes based on calibration information.
     527
     528\item given a collection of detections, determine the object avergae
     529  magnitude.
     530
     531\item given a collection of objects and detections, determine the
     532  individual image zero-points.
     533
     534\item given a region, return all possible combinations of the object
     535  or detection magnitudes (M1 - M2).
     536
     537\item given a list of (RA,DEC) entries, return all nearest objects. 
     538
     539\item given a filter, telescope, or detector, return all calibration
     540  terms and history.
     541
     542\item given a detection, return all non-detections from images which
     543  overlapped the detection coordinates.
     544
     545\end{enumerate}
     546
     547The PA Database must accept detection IDs of moving objects and label
     548the detections with the identified object.
     549
     550\begin{table}
     551\begin{center}
     552\caption{PA Detection Classes \& Object Parameters\label{PAdetections}}
     553\begin{tabular}{lrrrr}
     554\hline
     555\hline
     556Quantity & P2 & P4$\Sigma$ & P4$\Delta$ & SS \\
     557\hline
     558detection limit             & $20 \sigma$       & $5 \sigma$      & $3 \sigma$      & \\
     559depth (r')                  & 20.8              & 23.0            &                 & \\
     560stars deg$^{-2}$ ($|b|>10$) &   $1 \times 10^5$ & $1 \times 10^5$ & $1 \times 10^5$ & $1 \times 10^5$ \\
     561stars FPA$^{-1}$ ($|b|>10$) &   $7 \times 10^5$ & $1 \times 10^5$ & $1 \times 10^5$ & $1 \times 10^5$ \\
     562stars sec$^{-1}$ ($|b|>10$) & $2.3 \times 10^4$ & $1 \times 10^5$ & $1 \times 10^5$ & $1 \times 10^5$ \\
     563bytes star$^{-1}$           & 64                & 100             & 64              &                 \\
     564MB sec$^{-1}$               & 1.4               & 2.2             & 0.7             &                 \\
     565PS-1 total TB               & 8                 & 12              & 4               &                 \\
     566\hline
     567\end{tabular}
     568\end{center}
     569\end{table}
     570
     571The PA Database must accept new detections at the rate generated by
     572the telescope from the Phase 2 and Phase 4 analysis.  Except within 10
     573degrees of the galactic plane, the PA Database must keep up with the
     574incoming rates.  The expected rates are listed in Table~\ref{PArates},
     575along with the total data volume required for storage space over the
     576PS-1 lifetime.  The PA Database must be able to keep up with these
     577rates. 
     578
     579\subsubsection{Metadata Database}
     580
     581\tbd{this section needs to be reviewed and revised}
    552582
    553583The IPP requires a Metadata Database to store and provide access to
     
    568598avoid slowing down the analysis systems.
    569599
     600\tbd{need to extract specific requirements from this}
     601
    570602\tbd{volume requirements}
    571603
    572 \tbd{does the description of images belong in the Metadata database or
    573   in the Pixel / Image Server?}
    574 
    575604\tbd{queries}
    576605
    577 \subparagraph{Configuration Database -- a subset of the metadata database?}
     606{\bf note: description of images belong in the Metadata database,
     607  location of images is in the Image server}
     608
     609\paragraph{Configuration Database}
    578610
    579611The IPP requires a Configuration Database to store and provide access to
     
    581613configuration database include the default parameters for the various
    582614analysis programs, the description of the computing environment, the
    583 process status information, etc. 
    584 
    585 \paragraph{Controller}
    586 
    587 The IPP uses a collection of computers to store and process images and
    588 to manipulate collections of detections.  These computers perform any
    589 of a large number of analysis stages or other processing tasks without
    590 significant interprocess communication.  It is necessary to have a
    591 mechanism which initiates computing tasks on the different computers,
    592 which monitors the tasks as they are executed, which handles the
    593 output and the errors from these tasks, and which reacts to the
    594 failure of any of the computing nodes.  The system responsible for the
    595 tasks in the IPP is the Controller.
    596 
    597 The Controller must interact with the collection of computers under
    598 its management and with other subsystems in the IPP.  The controller
    599 must accept a variety of inputs from other subsystems, described
    600 below, and respond accordingly.  The controller must also provide
    601 information to other subsystems on demand.
    602 
    603 Computers managed by the controller are allowed to be in one of
    604 several states, and the controller must interact with it in an
    605 appropriate way for each of those states.  A computer may be {\tt
    606 alive}, {\tt dead} or {\tt off}.  If the computer is {\tt alive}, it
    607 responds to commands from the controller and may be used for tasks
    608 subject to other constraints.  If it is {\tt dead}, the computer is
    609 not responsive and must not be used for executing tasks.  The
    610 controller must identify computers which have died and occasionally
    611 test them to see if they are {\tt alive} again.  Computers which are
    612 {\tt off} are not available for tests and must not be tested.
    613 Computers may be set to the {\tt off} or {\tt dead} states by external
    614 subsystems; it is the responsibility of the Controller to return a
    615 computer to the {\tt alive} state if possible.
    616 
    617 Computers which are in the {\tt alive} state may be in one of two
    618 modes: {\tt busy} and {\tt free}.  A computer which is {\tt busy}
    619 currently has a task assigned to it.  The controller may only assign
    620 one task to one computer at a time\footnote{A physical piece of
    621 hardware may be defined to the Controller as multiple computers to
    622 allow multi-processor nodes to execute more than one simultaneous
    623 task.}.  Computers which are in the {\tt free} state may have tasks
    624 assigned to it.  The controller must also manage an additional set of
    625 constraint tables for each machine: the allowed tasks.  Each computer
    626 may have a list of allowed tasks which may include {\tt all} tasks,
    627 {\tt none} of the tasks, or specified task names.  The controller must
    628 only execute the allowed tasks on a machine.
    629 
    630 The Controller must accept tasks from other IPP subsystems.  The task
    631 requests must include the specific command to be executed.  The
    632 commands must be in the form of a UNIX command which could be
    633 performed on any of the computing nodes.  Any input or output data
    634 structures in the commands must be a valid resource regardless of the
    635 node on which the task is executed.  Input and output data resources
    636 must be unique where necessary to avoid conflicts.  Tasks must be
    637 given an identifier, which must be returned to the requesting agent,
    638 to be used to control the specific task.
    639 
    640 Task requests may specify a desired node for the task execution.  The
    641 Controller must attempt to honor the request if the node is {\tt
    642 alive}, but must execute on another node if the requested one is {\tt
    643 dead} or {\tt off}.  Even if a node is {\tt alive} the controller must
    644 choose another node if the specified tasks is not allowed on the
    645 requested node.  In all other cases, the controller must wait until
    646 executing processes, and processes with higher priority, are completed
    647 before executing the specified task on the requested node.
    648 
    649 Task requests may specify an urgency level.  The controller determines
    650 the priority of the task by sorting first by priority and next by the
    651 sequence of the request.  An executing task must be completed before
    652 any new task is started, regardless of priority.  Tasks may be
    653 assigned a priority of 0 in which case they are maintained in the
    654 queue and never executed. 
    655 
    656 The controller must monitor the output streams from the executing
    657 tasks and the exit status of the tasks.  \tbd{where do we send the
    658 output logs?}.  The status, including the exit status, of each task
    659 must be maintained for other subsystems to query as needed.  \tbd{how
    660 long?  on disk / database?}
    661 
    662 The controller must accept commands from other IPP subsystems.  These
    663 commands include those which govern the processing of specified tasks,
    664 those which govern the behavior of specific computing nodes, and those
    665 which request information from the controller.  The controller must be
    666 able to halt the execution of a specified task, delete an unexecuted
    667 task from the task list, change the priority of tasks, change the
    668 requested nodes for tasks.  The controller must also be able to stop
    669 the current execution of a task and push it to the end of the queue
    670 and also change its priority.
    671 
    672 The controller must honor requests (normally from the users) to change
    673 the mode of any computing node on demand between {\tt off} and {\tt
    674 dead}.  It must also be able to change the list of allowed tasks as
    675 requested by external commands.
    676 
    677 The controller must respond to informational requests regarding the
    678 collection of machines and their states as well as the collection of
    679 tasks and their states.  The controller must monitor the execution
    680 times of the different tasks and provide summary statistics.  Finally,
    681 the controller must respond to three top-level commands: {\tt finish},
    682 {\tt stop} and {\tt abort}.  When {\tt finish} is requested, no more
    683 new tasks are accepted on the stack of task, and when all tasks in the
    684 stack have completed, the controller must exit.  When {\tt stop} is
    685 requested, the currently executing tasks must be completed at which
    686 point the controller must exit, but tasks remaining in the stack which
    687 have not been started are flushed.  When {\tt abort} is issued, the
    688 controller immediately kills all executing tasks and exits.
    689 
    690 \paragraph{Scheduler}
    691 
    692 The IPP is responsible for a variety of analysis tasks: several stages
    693 of processing of the science images; routine assessment of the detrend
    694 images used in processing the science images; construction of
    695 replacement detrend images when needed; generation of astrometric and
    696 photometric reference catalogs based on the collected dataset; and the
    697 performance of test analysis programs.  At any point, decisions need
    698 to be made about which of these tasks should be performed, based on an
    699 analysis of the contents of the image database tables, the
    700 requirements of the people monitoring the IPP, and the near-term
    701 observing plans.  The IPP Scheduler is a mechanism to manage these
    702 various inputs to guide the decisions and initiate the actions.
    703 
    704 The Scheduler acts as an intermediate between several components of
    705 the IPP and also between the IPP and external agents such as the OATS
    706 system and the users who must monitor the behavior of the IPP. 
    707 
    708 The Scheduler must send commands to the Controller for execution.  It
    709 is the Controller's responsibility to manage the specific analysis
    710 jobs executing on a given processing node.  These analyses may include
    711 the process of copying of moving data from OATS to the pixel server
    712 nodes, or it may involve image processing stages performed on the
    713 science images by the appropriate processing nodes, or it may involve
    714 analysis of the data in the PnA object database.  In order to isolate
    715 and encapsulate the responsibilities of the Scheduler and the
    716 Controller, the Scheduler must initiate the tasks which the controller
    717 manages; in this way, the controller does not need to have any
    718 information about the details of the tasks which it executes.
    719 Communication between the Scheduler and the Controller must be
    720 bi-directional; the Scheduler must send tasks to the Controller which
    721 the Controller must inform the Scheduler of the outcome of those
    722 tasks.  \tbd{it is not specified whether the scheduler and controller
    723 are components of a single software system or interacting but distinct
    724 software components.}
    725 
    726 The Scheduler must take as input the current list of pending images,
    727 both science and calibration, and a description of the current
    728 observing plan or strategy on some time-scale.  The Scheduler must
    729 also take input from humans who manage the IPP. 
    730 
    731 The Scheduler must choose between several types of analysis stages
    732 based on the contents of those lists and on the requirements of the
    733 users.  The list of tasks which the Scheduler must decide between
    734 includes:
    735 \begin{itemize}
    736 \item moving data to and from the pixel server ($\sim 30$ second timescales)
    737 \item running the science analysis stages ($\sim 30$ second timescales)
    738 \item testing the validity of the current detrend images ($\sim$
    739   nightly)
    740 \item constructing new detrend images ($\sim$ weekly)
    741 \item updating and improving the photometric and astrometric reference
    742   catalogs ($\sim$ yearly).
    743 \end{itemize}
    744 
    745 The Scheduler must choose between tasks which are relevant on several
    746 different time-scales.  The time-scale range from 2 times per minute
    747 to once or twice a year, as noted in the list above.  The Scheduler
    748 must also make use of the human input in managing such choices.  The
    749 human users must be able to specify that a particular task or set of
    750 tasks is of higher or lower priority than the norm.
    751 
    752 The Scheduler must maintain a set of rules defining the dependency of
    753 one type of analysis stage on other analysis products.  For example,
    754 the nightly science image processing depends on the existence of valid
    755 detrend images.  The Scheduler must be able to recognize the
    756 dependency and initiate the required analysis needed to perform other
    757 analysis tasks.  The Scheduler must have the ability to decide between
    758 postponing an analysis task until the required data are available or
    759 to initiate the task using a lower-quality or less appropriate
    760 substitute.  For example, in normal circumstances, a science image
    761 must not be processed until the corresponding detrend frame has been
    762 produced.  However, if such a frame is unlikely to appear soon, and
    763 the pressure to process the science image is sufficiently high, then
    764 the frame could be processed with an older detrend frame of known
    765 lower quality.  The Scheduler must have the ability to choose the
    766 best, if not ideal, reference data for a particular circumstance.
    767 
    768 The Scheduler is responsible for setting the operating mode of the
    769 IPP.  When the IPP is in the automatic operating mode, this implies
    770 that the Scheduler is performing the most appropriate tasks at a
    771 particular time.  When the IPP is in the interactive mode, the
    772 Scheduler must perform the requested action regardless of the outcome
    773 of the decision trees.  In addition, the Scheduler must only perform
    774 the requested actions and not attempt to perform the other
    775 normally-required actions.  The only exception to this exclusion is
    776 that, in the interactive mode, data must still be copied from the
    777 summit system.  A human-sent command must be able to change the
    778 Scheduler priorities from the automatic to the interactive modes
    779 \tbd{with a CLI or GUI}.  An additional IPP mode is the {\em paused
    780 mode}, intended for tests or maintenance, in which case the Scheduler
    781 does not perform even the data copy tasks.  Every task is performed on
    782 demand by the user.
    783 
    784 \subsubsection{Analysis Stages}
    785 
    786 \paragraph{Overview}
    787 
    788 We now consider the collection of analysis tasks which must be
     615process status information, etc.  \tbd{part of metadata database?}.
     616
     617\subsubsection{Controller}
     618
     619The IPP Controller must manage tasks on a cluster of up to 128
     620computers. 
     621
     622On startup, the IPP Controller must attempt to establish communication
     623with all of its computers and set their state to be {\tt alive} or
     624{\tt dead} based on the success of the connection.
     625
     626The IPP Controller must detect computers which crash or stop
     627responding.
     628
     629The IPP Controller must attempt to re-establish communication with
     630{\tt dead} computers. 
     631
     632The IPP Controller must accept tasks from external users and systems,
     633which may specify a desired CPU (node) and priority in addition to the
     634task command.
     635
     636The IPP Controller must attempt to run pending tasks on the desired
     637node, if available (not {\tt dead} or {\tt off}).  If the node is
     638unavailable, the IPP Controller must attempt to run the task on
     639another node.  If the node is available, the IPP Controller must
     640attempt to run the next task when the current task is completed.
     641
     642The IPP Controller must monitor the output from the task and write it
     643to an associated log file.
     644
     645The IPP Controller must monitor the execution status of the task and
     646perform the following actions:
     647\begin{enumerate}
     648\item identify the task as successful if it has a valid exit status.
     649\item identify the task as unsuccessful if it has an error exit
     650  status.
     651\item identify the task as unattempted if the computer crashed.
     652\end{enumerate}
     653
     654The IPP Controller must accept and perform the following external
     655commands:
     656\begin{enumerate}
     657\item add a task to the pending task list.
     658\item delete a specific task from the pending task list.
     659\item return the current status of a specific task.
     660\item return a list of all pending and non-pending tasks.
     661\item set a specified computer state to {\tt off} or {\tt dead}.
     662\item restrict a specified CPU to a class of tasks.
     663\item halt execution of a specified task.
     664\item set the IPP Controller state to {\tt finish}, {\tt abort}, or
     665  {\tt stop}.
     666\end{enumerate}
     667
     668\subsubsection{Scheduler}
     669
     670The IPP Scheduler intiates analysis tasks which it must send to the
     671IPP Controller.
     672
     673All analysis tasks sent by the IPP Scheduler must include a complete
     674UNIX command with necessary arguments, the priority of the task, and
     675optionally the desired processing node.
     676
     677The IPP Scheduler must refer to several input data sources to decide
     678what tasks to intiate.  These data sources include the IPP Metadata
     679Database, the Summit Metadata Database, and User requests. 
     680
     681The IPP Scheduler must query the Databases on a regular basis to check
     682for new input information.  These queries must take place at least
     683once every \tbr{5 seconds}.
     684
     685The IPP Scheduler must accept new User input in real-time (within 0.1
     686seconds of the request).
     687
     688The IPP Scheduler must construct new tasks on the basis of the inputs
     689and a task dependency table. 
     690
     691When the IPP Scheduler is placed in the {\em paused state}, it must
     692only intiate User-requested tasks.
     693
     694When the IPP Scheduler is placed in the {\em interactive state}, it
     695must intiate User-requested tasks as well as data transfer tasks.
     696
     697When the IPP Scheduler is placed in the {\em automatic state}, it must
     698intiate the most appropriate task based on the inputs.
     699
     700The IPP Scheduler must receive the exit status of tasks from the IPP
     701Controller.
     702
     703The IPP Scheduler must send the exit status of the analysis tasks to
     704the appropriate destination as defined by the task dependency table.
     705
     706\subsection{Analysis Stages}
     707
     708We now consider the requirements of the analysis tasks which must be
    789709performed by the IPP.  These tasks represent the core of the required
    790710IPP functionality; the architectural components discussed above can be
     
    792712tasks to be executed on the appropriate data and to store the results.
    793713
    794 Depending on the task, the basic data unit may be individual images,
    795 collections of images, or derived data products such as a collection of
    796 detections of astronomical objects.  Because of the granularity of
    797 these data units, many of the analysis tasks can be performed in
    798 parallel because, for example, the intial analysis of an OTA in one
    799 image does not depend on the results from another OTA.  We define the
    800 term `analysis stage' to refer to the largest complete analysis task
    801 which may be performed on a single data item.  The analysis stages are
    802 divided into three categories, and further subdivided as follows:
    803 
    804 \begin{enumerate}
    805  \item {\bf Science Image Analysis} is performed on the night-sky
    806  science images to extract the science data from these images.  The
    807  science image analysis is divided into 4 phases:
    808 
    809  \begin{itemize}
    810   \item {\bf Phase 1:} The image processing preparation phase, in
    811   which basic astrometric analysis of the complete FPA image is
    812   performed.
    813 
    814   \item {\bf Phase 2:} The image reduction phase, in which the
    815   individual detector images (OTAs) are processed as much as possible
    816   without reference to other chips in the same FPA image or other
    817   exposures.
    818 
    819   \item {\bf Phase 3:} The exposure analysis phase, in which the
    820   results of the multiple detectors are combined to improve the
    821   calibrations for the complete FPA images.
    822 
    823   \item {\bf Phase 4:} The image combination phase, in which several
    824   different exposures of the same part of the sky are combined to
    825   produce high-quality difference and summed images.
    826  \end{itemize}
    827 
    828  \item {\bf Calibration Image Analysis} is required to generate the
    829  calibration images used in the science image analysis.  There are
    830  three types of calibration images which are produced. \tbd{make this
    831  consistent with other sections which use the basic / other
    832  calibration distinction}
    833 
    834  \begin{enumerate}
    835   \item {\bf Calibration 1:} The basic master-detrend creation images,
    836   which are constructed from a simple stack of multiple input
    837   calibration images. 
    838 
    839   \item {\bf Calibration 2:} Sky-model \& fringe-model images, which
    840   are constructed by combining a collection of images which require
    841   substantial processing before the combination.
    842 
    843   \item {\bf Calibration 3:} Flat-field correction image, which is
    844   constructed on the basis of photometry observations of objects from
    845   certain science images.
    846 
    847  \end{enumerate}
    848 
    849  \item {\bf Reference Catalog Creation} is required by the IPP to
    850  generate improved astrometric and photometric reference catalogs on
    851  the basis of Pan-STARRS observations.
    852 
    853 \end{enumerate}
    854 
    855 Figure~\ref{stages} shows the flow of data between the various IPP
    856 software systems and the different analysis stages, each managed by
    857 the Controller.  The thick lines represent the flow of pixel data, the
    858 thin lines represent the flow of metadata and object data, and the
    859 grey lines represent the flow of commands.  The hatched systems
    860 represent external PanSTARRS systems (OATS, the Sky Server, the SAIC
    861 Object Database, the Moving/Transient Object Pipeline, and other
    862 Client Science Pipelines.
    863 
    864 The individual analysis stages can be accessed as a UNIX command-line
    865 program.  Each command represents the action of the stage on a single
    866 quantum of data.  These analysis stages are built of lower-level
    867 C-functions wrapped in a higher-level programming language,
    868 \tbd{Python}. 
    869 
    870 The decision to execute a specific analysis stage for a specific
    871 dataset is made by the Scheduler, which sends the infomation to the
    872 Controller.  The Controller executes the analysis stage for the data
    873 on an appropriate machine and monitors the success or failure of the
    874 job.
    875 
    876 \begin{figure}
    877 \begin{center}
    878 \resizebox{8cm}{!}{\includegraphics{pics/stages.ps}}
    879 \caption{ \label{stages} IPP System Overview}
    880 \end{center}
    881 \end{figure}
    882 
    883 \paragraph{Science Image Analysis}
     714\subsubsection{Science Image Analysis}
    884715
    885716The Science Image analysis stages together represent the basic data
    886 analysis required by the IPP.  These analysis stages must process the
    887 images in a timely manner so that the incoming data stream will not
    888 overload the Pixel Server.  The required processing time is derived
    889 from the rate at which science images are obtained by PS-1.  At a
    890 minimum, the Science Image Analysis must keep up with the average
    891 image rate over the course of 1 day.  \tbd{The Science image analysis
    892 is required to process images at the maximum science image rate from
    893 PS-1 of 1 image every 30 seconds -- does this fall out of the science
    894 requirements?}  \tbd{In order to give time for uncertainties in the
    895 Pan-STARRS system as a whole, the Science Image Analysis must be able
    896 to process all images from a night within 12 hours.}
    897 
    898 \tbd{number of images per night, data volume per image, output
    899 products}
    900 
    901 The science image analysis which must be performed by the IPP consists
    902 of:
    903 
    904 \begin{itemize}
    905 \item detrending the images to remove the instrumental signature
    906 
    907 \item astrometric and photometric calibration of the individual images
    908 
    909 \item merging a collection of several images of the same portion of
    910 the sky obtained over a short period of time (to remove image defects
    911 and gaps)
    912 
    913 \item subtracting the appropriate reference static-sky image
    914 
    915 \item cleaning the image of any transients
    916 
    917 \item adding the cleaned image to the static sky
    918 
    919 \item object detection of images at specific stages
    920 \end{itemize}
    921 
    922 These analysis steps can be grouped into four phases, each of which
    923 deals with a single data unit.  We identify and discuss the
    924 requirements of the four phases below.
    925 
    926 \paragraph{Phase 1 : image processing preparation}
    927 
    928 The Phase 1 analysis stage is performed on each science FPA to
    929 calculate basic astrometric \tbd{and photometric} data needed by the
    930 later stages.  Phase 1 must use the static (pre-determined) telescope
    931 distortion model and table of nominal OTA positions and rotations,
    932 combined with the guide star pixel and celestial coordinates, to
    933 determine the correct telescope bore-sight, field rotation and
    934 magnification.  The astrometric accuracy required from this analysis
    935 stage is \tbd{2 arcsec} across the field, sufficient to match the vast
    936 majority of reference stars with their detections.
    937 
    938 In some circumstances, science images may have no guide stars.  This
    939 may occur if the detectors are not run in OTA mode, especially for
    940 short snapshot images of if IPP is being run on non-Pan-STARRS data.
    941 In such a circumstance, the Phase 1 stage must perform extremely basic
    942 object detection, determining the detector coordinates for stars which
    943 are not excessively saturated and which are significantly above the
    944 background level.  The threshold levels for this object detection
    945 stage must be configurable.  The object extraction must be performed
    946 in less than \tbd{3 seconds}.
    947 
    948 In order for astrometry of an image to succeed, it is necessary that
    949 approximate image coordinates be known.  The Phase 1 analysis must be
    950 able to succeed despite initial coordinate errors as large as \tbd{5
    951 times} the field width.  However, the search process must attempt the
    952 near matches first in the assumption that the given coordinates are
    953 accurate.
    954 
    955 A table of the overlaps between the science image to be processed and
    956 the static sky images must be constructed.  This table will be used to
    957 guide the processing of the static sky in Phase 4.  The overlaps must
    958 be generously calculated so that small errors in astrometry at Phase 1
    959 will not cause any valid static sky / science image pairs to be missed
    960 because of the astrometric error at this phase.  It is acceptable for
    961 a small number of invalid overlaps to be identified as these will be
    962 excluded in Phase 4.  Sky cells which do not have sufficient science
    963 image overlap \tbd{$< 10\%$} need not be processed.
     717analysis required by the IPP.  There are several requirements which
     718must be met by the collection of science image analysis stages as a
     719group.
     720
     721The science image analysis stages must perform their analyses quickly
     722enoough to keep up with the incoming data stream.  The required
     723processing time is derived from the rate at which science images are
     724obtained by PS-1.  At a minimum, the Science Image Analysis must keep
     725up with the average image rate over the course of 1 day.  In order to
     726provide a sufficient buffer for variations in the processing speed,
     727the Science Image Analysis must be able to process all images from a
     728night within 12 hours. 
     729
     730The maximum latency between the aquisition of an image and the
     731completion of the science image analysis is set by the science
     732requirements of the fast transient recovery programs.  The science
     733image analysis must process images from these observing programs
     734within \tbr{5 min} of their arrival time in the IPP Image Server.
     735
     736The science image analysis stages must processes up to 1000 science
     737images per night. 
     738
     739\subsubsection{Phase 1 : image processing preparation}
     740
     741The Phase 1 analysis stage must determine the astrometric solution of
     742the complete camera (FPA image) with an accuracy of \tbr{1 arcsec}
     743peak-to-peak deviation. 
     744
     745The Phase 1 analysis stage must load the guide star pixel and
     746celestial coordinates from the \tbd{IPP Metadata Database}\comment{or
     747from the image header?}.
     748
     749If guide stars are not available, the Phase 1 analysis stage must
     750extract bright stars from the image.  This extraction must be done in
     751less than \tbr{1 second}.  The total number of stars and size of the
     752bright-star aquisition box must be a user-configurable parameter.
     753
     754In order for blind astrometry of an image to succeed, it is necessary
     755that approximate image coordinates be known.  The Phase 1 analysis
     756must be able to succeed despite initial coordinate errors as large as
     757\tbr{20\arcsec}.
     758
     759The Phase 1 analysis stage must construct a table of the overlaps
     760between the science image to be processed and the static sky images.
     761
     762The overlaps must overestimated by a small amount so that errors in
     763astrometry at Phase 1 will not cause any valid static sky / science
     764image pairs to be missed.  The amount of overlap must be a
     765user-configurable parameter.
     766
     767Sky cells which do not have sufficient science image overlap \tbd{$<
     7685\%$} must be excluded.
    964769
    965770It is not unusual that an image be obtained with invalid coordinates
     
    967772may make an error and report the wrong time or coordinates.  Or, the
    968773image may be obtained in exceptionally poor conditions with no
    969 detected stars.  Phase 1 must fail gracefully in these conditions,
    970 reporting an appropriate error.  Such images must be identified for
    971 possible human intervention, or future follow-up after metadata
    972 repairs are made.
    973 
    974 \paragraph{Phase 2 : image reduction}
     774detected stars.  Phase 1 must return a descriptive error message in
     775these conditions. 
     776
     777\subsubsection{Phase 2 : image reduction}
    975778
    976779The Phase~2 analysis is the detrend stage, in which the images from
    977 the detector are processed to remove instrumental signatures.  In
    978 addition, basic object detection is performed along with improved
    979 astrometric and photometric calibration.  \tbd{what component selects
    980 the appropriate calibration data?  is it the phase~2 program, the
    981 individual modules, or the scheduler above it?}  In each step of the
    982 analysis process, an image mask and noise map must be carried and
    983 updated when appropriate.  The following operations need to occur
    984 within Phase~2 processing:
    985 
     780the detector are processed to remove instrumental signatures. 
     781
     782Phase 2 must perform the analysis steps only if required by the
     783processing recipe.  The processing recipe must respect exposure time
     784and background flux limits to select certain stages.
     785
     786\paragraph{Detrend Image Convolutions}
     787
     788The Phase 2 analysis stage must determine the OT kernel from the IPP
     789Metadata Database\comment{or image header}.
     790
     791The Phase 2 analysis stage must convolve the flat-field and
     792high-spatial-frequency fringe images with the OT kernel.  If no OT
     793kernel exists, this step must be silently skipped.
     794
     795\paragraph{Flag bad and saturated pixels}
     796
     797The Phase 2 analysis must load the basic bad pixel map appropriate to
     798the detector of interest. 
     799
     800The Phase 2 analysis must use the OT kernel to grow the traps in the
     801raw bad pixel mag. 
     802
     803The Phase 2 analysis must mask saturated pixels and a user-specified
     804number of surrounding pixels.
     805
     806Different bits must be set to identify different reasons for masking
     807the pixels.
     808
     809\paragraph{Bias correction via overscan subtraction}
     810
     811Phase 2 must be perform bias subtraction on the image. 
     812
     813Phase 2 must choose the bias subtraction method and applied statistics
     814based on a user-configured parameter. 
     815
     816The bias correction must be measured from the image overscan region.
     817
     818The overscan region must be determined from the image
     819header\comment{or Metadata DB}.
     820
     821The bias subtraction must apply one of the following bias corrections,
     822depending on the user parameters:
    986823\begin{enumerate}
    987 \item Convolve detrend images with the OT kernel, if available
    988 \item Flag bad and saturated pixels
    989 \item Bias correction via overscan subtraction
    990 \item Trim object image to remove overscan and edges corrupted by OT
    991 \item Correct for non-linearity
    992 \item Flat-field correction
    993 \item Sky subtraction
    994 \item Identify CRs
    995 \item Find objects in the image
    996 \item Make postage stamps of bright objects.
     824\item subtract a single constant from the image. 
     825
     826\item subtract a 1-D bias which varies along the overscan.  The function to be used must include
     827a spline or a chebychev polynomial derived from the data values along
     828the overscan, as specified by the user parameters.
     829
     830\item correct the overscan {\em and} subtract a 2-D bias image which
     831  has been overscan corrected using one of the two methods above.
    997832\end{enumerate}
    998833
    999 \subparagraph{Convolve detrend images with the OT kernel}
    1000 
    1001 Detrend images must be convolved by the OT kernel, so that they
    1002 accurately represent the detrend images appropriate for the object
    1003 images, which have been shifted using OT.  The detrend images which
    1004 must be convolved include: the flat-field and the
    1005 high-spatial-frequency fringe images. \tbd{Must this be a formal
    1006 convolution with the analytical OT kernel, or can it be a convolution
    1007 with a decomposed kernel?} The appropriate kernel for each cell of an
    1008 OTA must be determined from the guide star history.  \tbd{what is the
    1009 source of the OT kernel?  pixel server?}
    1010 
    1011 \subparagraph{Flag bad and saturated pixels}
    1012 
    1013 A static bad pixel mask needs to be used to identify pixels which are
    1014 bad.  Note that bad pixels which are charge traps need to be grown by
    1015 the extent of the OT convolution kernel, while those pixels above a
    1016 charge trap (i.e.\ bad colums) must not be grown, since they were not
    1017 affected by pixel shifting, but only became bad at read-out.
    1018 
    1019 Pixels saturated in the A/D converter must also be masked, and this
    1020 area must be grown by an additional pixel to mask excess charge
    1021 spillover.
    1022 
    1023 The bad pixel mask must be carried with the science images.  Different
    1024 bits must be set to identify different reasons for masking the pixel.
    1025 
    1026 \subparagraph{Bias correction via overscan subtraction}
    1027 
    1028 The image bias must be subtracted. Since different detectors behave in
    1029 different ways, several options for modelling the bias must be
    1030 available.  The bias must be measured from the image overscan region.
    1031 The bias subtraction method must be capable of applying a single
    1032 constant to the complete image, or to represent the bias as a function
    1033 which varies along the overscan.  The function to be used must include
    1034 a spline or a chebychev polynomial derived from the data values along
    1035 the overscan.  The values used to determine both the single constant
    1036 or the inputs to the spline and polynomial fits must be derived from
    1037 groups of pixels on the basis of one of several statistics, including
    1038 the sample and robust mean, median, and modes.  In the case of a
    1039 single constant, all of the overscan pixel values are used in the
    1040 calculation of this statistic.  In the case of the 1D functional
    1041 representation, the input values to the fit must represent the
    1042 coordinate along the overscan, with the statistic derived from the
    1043 pixels in the perpedicular direction at each location.  Sigma-clipping
    1044 on the input data values must be an option.  \tbd{accuracy of the bias
    1045 subtraction?}
    1046 
    1047 \subparagraph{Trim object image}
    1048 
    1049 The image must be trimmed to remove the non-imaging pixels, such as
    1050 the overscan and any pre-scan pixels, along with those pixels near the
    1051 edges that have been compromised due to OT operation.  The definition
    1052 of the imaging area of the detector must be determined from the camera
    1053 configuration data or from the metadata associated with the image,
    1054 with the choice a user-configurable option. 
    1055 
    1056 \subparagraph{Correct for non-linearity}
    1057 
    1058 If required, the object image (after bias correction) must be
    1059 corrected for the effects of non-linearity through a provided
    1060 polynomial fit to the pixel data values.  The choice to apply the
    1061 correction must be set by the user.
    1062 
    1063 \subparagraph{Flat-field correction}
     834The statistic used to calculate the overscan constant or the inputs to
     835the spline and polynomial fits must be derived from groups of pixels
     836on the basis of one of several statistics, as specified by the user
     837parameters.  The choice of statistics must include the sample and
     838robust mean, median, and modes.
     839
     840In the case of a single constant, all of the overscan pixel values are
     841used in the calculation of this statistic.  In the case of the 1D
     842functional representation, the input values to the fit must represent
     843the coordinate along the overscan, with the statistic derived from the
     844pixels in the perpedicular direction at each location. 
     845
     846If specified in the user parameters, sigma-clipping must be performed
     847on the input data values. 
     848
     849The bias subtraction must leave no residuals greater than \tbr{1 DN}
     850peak-to-peak.
     851
     852\paragraph{Trim object image}
     853
     854The Phase 2 analysis must trim the non-imaging pixels from the image.
     855
     856The definition of the imaging area must be determined from the
     857Metadata Database\comment{or image header?}.
     858
     859Phase 2 must trim pixel near the edges that have been compromised due
     860to OT operation.
     861
     862\paragraph{Correct for non-linearity}
     863
     864If required, the science image must be corrected for the effects of
     865non-linearity.  The correction must be a function of chip.
     866
     867\paragraph{Flat-field correction}
    1064868
    1065869The object image (after bias correction and non-linearity correction)
    1066870must be corrected for sensitivity variations as a function of
    1067 position, dividing by a flat-field image.  The flat-field images must
    1068 be appropriately normalized (see section \ref{mkcal}).  The
    1069 flat-fielded image must have a consistent photometric zero-point
    1070 across the chip, and across the full FPA, to within 0.2\%. 
    1071 
    1072 \subparagraph{Sky \& Fringe subtraction}
     871position, dividing by a flat-field image. 
     872
     873The flat-field images must be appropriately normalized (see section
     874\ref{mkcal}).  The flat-fielded image must have a consistent
     875photometric zero-point across the chip, and across the full FPA, to
     876within 0.2\% with peak-to-peak deviations of \tbr{0.5\%}.
     877
     878\paragraph{Sky \& Fringe subtraction}
    1073879
    1074880The flux contribution of the sky (from both continuum emission and the
     
    1087893\tbd{What is allowed power-spectrum of background variations?}
    1088894
    1089 \subparagraph{Identify `cosmic rays'}
     895\paragraph{Identify `cosmic rays'}
    1090896
    1091897Charged particles in the detector frequently cause features which do
     
    1101907Phase~2.}
    1102908
    1103 \subparagraph{Find objects in the image}
     909\paragraph{Find objects in the image}
    1104910
    1105911Objects on the flat-fielded object image must be found, and general
     
    1114920relevant image metadata (\ie filter, exposure time, etc).
    1115921
    1116 \subparagraph{Astrometry}
     922\paragraph{Astrometry}
    1117923
    1118924Objects detected in Phase~2 must be matched with known astrometric
     
    1128934arcsec}.
    1129935
    1130 \subparagraph{Postage Stamps}
     936\paragraph{Postage Stamps}
    1131937
    1132938The IPP must have the capability of extracting regions surrounding a
     
    1136942of a set of rules applied to the object magnitude and position.
    1137943
    1138 \paragraph{Phase 3 : exposure analysis}
     944\subsubsection{Phase 3 : exposure analysis}
    1139945
    1140946The Phase 3 analysis stage works with the results from a complete FPA
     
    1158964limited by the astrometric reference catalog \tbd{30 mas for USNO?}
    1159965
    1160 \paragraph{Phase 4 : image combination}
     966\subsubsection{Phase 4 : image combination}
    1161967
    1162968Phase 4 is the image combination stage, in which multiple images of
     
    1177983into several stages, each of which are discussed in detail below.
    1178984
    1179 \subparagraph{Extract image pixels}
     985\paragraph{Extract image pixels}
    1180986
    1181987For the given sky cell, the corresponding set of image pixels must be
     
    1185991than 20\% more pixels than necessary from the input images.
    1186992
    1187 \subparagraph{Transform pixel coordinates}
     993\paragraph{Transform pixel coordinates}
    1188994
    1189995Pixels which have been extracted from the input images must be mapped
     
    11961002\tbd{interpolation method?}
    11971003
    1198 \subparagraph{Flux matching}
     1004\paragraph{Flux matching}
    11991005
    12001006The multiple input images must have their object fluxes intercompared
     
    12031009photometrically.
    12041010
    1205 \subparagraph{Image outlier pixel rejection}
     1011\paragraph{Image outlier pixel rejection}
    12061012
    12071013Pixels from the group of images which are inconsistent with the
     
    12121018obtained over a wide range of times.
    12131019
    1214 \subparagraph{PSF matching}
     1020\paragraph{PSF matching}
    12151021
    12161022The multiple input images must have their PSF mutually matched to
    12171023allow for proper image subtraction.
    12181024
    1219 \subparagraph{Image Subtraction}
     1025\paragraph{Image Subtraction}
    12201026
    12211027The static sky image must be subtracted from the stacked, cleaned
     
    12241030Object detection at this stage is the same as that used for Phase 2.
    12251031
    1226 \subparagraph{Cleaned Input Image}
     1032\paragraph{Cleaned Input Image}
    12271033
    12281034The flagged pixels must be excluded from the input images and a new,
     
    12301036applied to it.  \tbd{parameters}
    12311037
    1232 \subparagraph{Update static sky}
     1038\paragraph{Update static sky}
    12331039
    12341040The final, cleaned input image must be added to the static sky so that
     
    12361042\tbd{parameters, weight map}
    12371043
    1238 \subparagraph{Products}
     1044\paragraph{Products}
    12391045
    12401046Phase 4 must produce the following data products at a minimum:
     
    12491055\end{enumerate}
    12501056
    1251 \subparagraph{Timing}
     1057\paragraph{Timing}
    12521058
    12531059It is required that the {\em total} processing for each exposure by
     
    12641070second.
    12651071
    1266 \subparagraph{Accuracies}
     1072\paragraph{Accuracies}
    12671073
    12681074Transformations/mappings from detector to sky must preserve both
     
    12751081\end{itemize}
    12761082
    1277 \subparagraph{Robustness}
     1083\paragraph{Robustness}
    12781084
    12791085It is essential that the static sky image (which may have been
     
    12821088to an error upstream in the processing).
    12831089
    1284 \paragraph{Calibration Stages}
     1090\subsubsection{Calibration Stages}
    12851091\label{mkcal}
    12861092
     
    12941100below.
    12951101
    1296 \paragraph{Basic Calibration Stages}
     1102\subsubsection{Basic Calibration Stages}
    12971103
    12981104The IPP must generate basic calibration images using the raw bias,
     
    13081114see which input images are consistent and valid.
    13091115
    1310 \subparagraph{bias images}
     1116\paragraph{bias images}
    13111117
    13121118Bias images may be needed to correct for structure in the bias.  The
     
    13221128used to exclude any significant outlier input images.
    13231129
    1324 \subparagraph{dark images}
     1130\paragraph{dark images}
    13251131
    13261132Dark images may be needed to correct for structure in the dark
     
    13411147-- by what component?}.
    13421148
    1343 \subparagraph{flat-field images}
     1149\paragraph{flat-field images}
    13441150
    13451151Master flat-field images must be constructed from a collection of
     
    13561162exclude any significant outlier input images. 
    13571163
    1358 \paragraph{Other Calibration Stages}
    1359 
    1360 \subparagraph{mask images}
     1164\subsubsection{Other Calibration Stages}
     1165
     1166\paragraph{mask images}
    13611167
    13621168Initial bad-pixel mask images must be generated on the basis of
     
    13671173inconsistent, an error must be raised.
    13681174
    1369 \subparagraph{fringe frames}
     1175\paragraph{fringe frames}
    13701176
    13711177Fringe-correction frames must be generated to remove the fringe
     
    13821188standard combination statistics (mean, median, mode, etc).
    13831189
    1384 \subparagraph{low-k sky models}
     1190\paragraph{low-k sky models}
    13851191
    13861192Large-scale background structure in images which is not caused by
     
    13911197telescope.  \tbd{discuss principal components, SVD?}
    13921198
    1393 \subparagraph{Flat-field correction frame}
     1199\paragraph{Flat-field correction frame}
    13941200
    13951201Flat-field images, whether constructed from the dome, twilight, or
     
    14011207sequence of images.
    14021208
    1403 \subparagraph{Non-linearity correction frames}
     1209\paragraph{Non-linearity correction frames}
    14041210
    14051211The IPP must have the capability of constructing non-linear correction
     
    14101216from a linear detector. 
    14111217
    1412 \paragraph{Reference Catalog Creation}
     1218\subsubsection{Reference Catalog Creation}
    14131219
    14141220For PS-1, one of the primary goals is the creation of photometric and astrometric
     
    14211227list the requirements of the tools needed for this effort.
    14221228
    1423 \paragraph{Astrometry Reference Creation}
     1229\subsubsection{Astrometry Reference Creation}
    14241230
    14251231The existing astrometric reference catalogs are known to have
     
    14871293stars rather than for the normal image data.
    14881294
    1489 \paragraph{Photometry Reference Creation}
     1295\subsubsection{Photometry Reference Creation}
    14901296
    14911297The IPP must provide the analysis tools needed to generate a master
     
    15451351stars rather than for the normal image data.
    15461352
    1547 \subsubsection{Modules}
     1353\subsection{Modules}
    15481354
    15491355In order to encapsulation functionality, the analysis stages are
     
    15591365Processing Pipeline Algorithm Design Document' (PSDC-430-006).
    15601366
    1561 \subsubsection{PanSTARRS IPP Library}
     1367\subsection{PanSTARRS IPP Library}
    15621368
    15631369In order to facilitate testing and development, and to encourage
     
    15791385PSDC-430-006).
    15801386
    1581 \subsubsection{Data Sources and Formats}
    1582 
    1583 \paragraph{Image Formats}
     1387\subsection{Data Sources and Formats}
     1388
     1389\subsubsection{Image Formats}
    15841390
    15851391FITS images
    15861392
    1587 \paragraph{Table Formats}
     1393\subsubsection{Table Formats}
    15881394
    15891395FITS tables
    15901396
    1591 \paragraph{Other Data Formats}
     1397\subsubsection{Other Data Formats}
    15921398
    15931399XML files
    15941400
    1595 \paragraph{External Catalogs}
     1401\subsubsection{External Catalogs}
    15961402
    15971403\begin{itemize}
     
    16061412\end{itemize}
    16071413
    1608 \paragraph{Analysis Reference Data}
     1414\subsubsection{Analysis Reference Data}
    16091415
    16101416\begin{itemize}
     
    16161422\end{itemize}
    16171423
    1618 \paragraph{Installation Reference Data}
     1424\subsubsection{Installation Reference Data}
    16191425
    16201426\begin{itemize}
Note: See TracChangeset for help on using the changeset viewer.