IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 27, 2017, 6:55:08 PM (9 years ago)
Author:
watersc1
Message:

Still not done with edits, but I wanted to get what is done committed. sections 3.9-3.14 still need to updated with details about database and processing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/release.2015/ps1.datasystem/datasystem.tex

    r39894 r39958  
    8787\keywords{Surveys:\PSONE }
    8888
    89 \section{INTRODUCTION}\label{sec:intro}
     89\section{Introduction}
     90\label{sec: intro}
    9091
    9192This is the second in a series of seven papers describing the
    9293Pan-STARRS1 Surveys, the data reduction techiques and the resulting
    9394data products.  This paper (Paper II) describes how the various data
    94 processing stages are organised and implemented in the Imaging
     95processing stages are organised and implemented in the Image
    9596Processing Pipeline (IPP), including details of the the processing
    96 database which is a critical element in the IPP infrastructure .
     97database which is a critical element in the IPP infrastructure.
    9798
    9899%Chambers et al. 2017 (Paper I)
     
    142143described in detail in \cite{2012ApJ...750...99T}.
    143144
     145The Pan-STARRS Image Processing Pipeline consists of a suite of
     146software programs and data systems that are designed to reduce
     147astronomical images, with a focus on parallelization necessary to
     148speed the processing of the large images produced by the GPC1 camera.
     149Part of this parallelization is derived from the fact that this camera
     150consists of 60 independent orthogonal transfer array (OTA) devices,
     151and can therefore be processed simultaneously.  Although there are
     152multiple stages that operate on an entire exposure at once, the
     153majority of stages operate only on smaller segments of a full exposure
     154to allow the processing tasks to be spread over the machines in the
     155processing cluster.
     156
     157This paper presents a description of the IPP data handling system.
     158Section \ref{sec: subsystems} describes the major IPP subsystems that
     159underlie the main pipeline, providing a set of common interfaces and
     160tools used at multiple stages.  The main processing stages of the
     161pipeline are described in Section \ref{sec: stages}, although all
     162exposures may not necessarily pass through each of these stages.  The
     163hardware systems that have done the processing for the PV3 data
     164release are listed in Section \ref{sec: hardware}, with some details
     165on the scale of computing needed to reduce this large number of
     166exposures.  Finally, Section \ref{sec: discussion} presents a
     167discussion of some of the lessons learned in the creation of the IPP,
     168and its utility in reducing data from other cameras and telescopes.
     169
    144170{\color{red} {\em Note: These papers are being placed on arXiv.org to
    145171    provide crucial support information at the time of the public
     
    151177
    152178\section{IPP Software Subsystems}
     179\label{sec: subsystems}
     180
     181The IPP relies on a number of common libraries and programs to handle
     182various tasks that are shared between multiple stages of the
     183processing.  These subsystems are described in this section, to
     184provide an introduction to these essential components that underlie
     185the rest of the pipeline.
    153186
    154187\subsection{Processing Database}
     188\label{subsec: database}
    155189
    156190A critical element in the Pan-STARRS IPP infrastructure is the
     
    163197back to the database.  In this way, the database records this history
    164198of the processing, and also provides the information needed to
    165 successive processing stages to begin their own tasks. 
     199successive processing stages to begin their own tasks.
    166200
    167201The processing database is colloquially referred to as the `gpc1'
     
    169203processing of images and data products related to the PS1 GPC1 camera.
    170204This same database engine also has instances for other cameras
    171 processed by the IPP, e.g., GPC2, the test cameras TC1, TC3, the
    172 Imaging Sky Probe (ISP), etc.
     205processed by the IPP, e.g., GPC2, the test cameras TC1, TC3, and the
     206Imaging Sky Probe (ISP).
    173207
    174208Within the processing database, the various processing stages are
    175209represented as a set of tables.  In general, there is a top level
    176 table which defines the conceptual list of processing items either to
    177 be done, in progress, or completed.  An associated table lists the
    178 details of elements which have been processed.  For example, one
    179 critical stage is the Chip processing stage, discussed below, in which
    180 the individual chips from an exposure are detrended and sources are
    181 detected.  Within the gpc1 database, there is a top-level table called
    182 `chipRun' in which each exposure has a single entry.  Associated with
    183 this table is the `chipProcessedImfile' table, which contains one row
    184 for each of the (up to 60) chips associated with the exposure.  The
    185 top-level tables, such as chipRun, are populated once the system has
    186 decided that a specific item (e.g., an exposure) should be processed
    187 at that stage.  Initially, the entry is given a state of `run',
    188 denoting that the exposure is ready to be processed.  The low-level
    189 table entries, such as the chipProcessedImfile entries, are only
    190 populated once the element (e.g., the chip) has been processed by the
    191 analysis system.  Once all elements for a given stage, e.g., chips in
    192 this case, are completed, then the status of the top-level table entry
    193 (chipRun) are switched from `run' to `done'.
    194 
    195 If the analysis of an element (e.g., chip) completed successfully,
    196 then the corresponding table row (e.g., chipProcessedImfile) is listed
    197 with a fault of 0.  If the analysis failed, then a non-zero fault is
    198 recorded.  An analysis which results in a fault is one in which the
    199 failure is thought to be temporary.  For example, if a computer had a
    200 network glitch and was unable to write out some of the output files,
    201 this would be an ephemeral failure which was not a failing of the
    202 data, but merely the processing system.  On the other hand, if the
    203 analysis failed because of a problem with the input data, this is
    204 noted by setting a non-zero value in a different table field,
    205 `quality'.  For example, if the chip analysis failed to discover any
    206 stars because the image was completely saturated, the analysis can
    207 complete successfully (fault = 0), but the `quality' field will be set
    208 to a non-zero value.  The various processing stages are able to select
    209 only the good (quality = 0) elements of a prior stage when choosing
    210 items for processing.  For example, the Camera calibration stage will
    211 only use data from chips with good quality data, dropping the failed
    212 chips from the rest of the analysis.  On the other hand, a fault in
    213 one of the elements for a given stage will block any dependent stages
    214 from processing that item.  In this way, if a glitch occurs and a chip
    215 from an exposure failed to be written to disk in the Chip stage, the
    216 system will not partially process the exposure with the rest of the
    217 chips.  Since many of the faults which occur are ephemeral, the
    218 processing stages are set up to occasional clear and re-try the
    219 faulted entries.  Thus, automatic processing is able to keep the data
    220 flowing even in the face of occasional network glitches or hardware
    221 crashes.
     210primary table which defines the conceptual list of processing items
     211either to be done, in progress, or completed.  An associated secondary
     212table lists the details of elements which have been processed.  Table
     213\ref{tab: database schema} contains an outline of the database schema,
     214showing the relations between tables organized by processing stage.
     215As an example, one critical stage is the \ippstage{chip} processing
     216stage, discussed below, in which the individual chips from an exposure
     217are detrended and sources are detected.  Within the gpc1 database, the
     218primary table called \ippdbtable{chipRun} in which each exposure has a
     219single entry.  Associated with this table is the
     220\ippdbtable{chipProcessedImfile} table, which contains one row for
     221each of the (up to 60) chips associated with the exposure.  The
     222primary tables, such as \ippdbtable{chipRun}, are populated once the
     223system has decided that a specific item (e.g., an exposure) should be
     224processed at that stage.  Initially, the entry is given a state of
     225``run'', denoting that the exposure is ready to be processed.  The
     226low-level table entries, such as the \ippdbtable{chipProcessedImfile}
     227entries, are only populated once the element (e.g., the chip) has been
     228processed by the analysis system.  Once all elements for a given
     229stage, e.g., chips in this case, are completed, then the status of the
     230top-level table entry (\ippdbtable{chipRun}) are switched from ``run''
     231to ``full''.
     232
     233If the analysis of an element (e.g., the individual OTA chip)
     234completed successfully, then the corresponding table row (e.g.,
     235\ippdbtable{chipProcessedImfile}) is listed with a \ippdbcolumn{fault}
     236of 0.  If the analysis failed, then a non-zero \ippdbcolumn{fault} is
     237recorded.  An analysis which results in a \ippdbcolumn{fault} is one
     238in which the failure is thought to be temporary.  For example, if the
     239processing computer had a network interruption and was unable to write
     240some of the output files, this would be an ephemeral failure which was
     241not a failing of the data, but merely the processing system.  On the
     242other hand, if the analysis failed because of a problem with the input
     243data, this is noted by setting a non-zero value in a different table
     244field, \ippdbcolumn{quality}.  For example, if the chip analysis
     245failed to discover any stars because the image was completely
     246saturated, the analysis can complete successfully (\ippdbcolumn{fault}
     247= 0), but the \ippdbcolumn{quality} field will be set to a non-zero
     248value.  The various processing stages are able to select only the good
     249(\ippdbcolumn{quality} = 0) elements of a prior stage when choosing
     250items for processing.  For example, the \ippstage{camera} calibration
     251stage will only use data from chips with good \ippdbcolumn{quality}
     252data, dropping the failed chips from the rest of the analysis.  On the
     253other hand, a \ippdbcolumn{fault} in one of the elements for a given
     254stage will block any dependent stages from processing that item.  In
     255this way, if such a temporary failure occurs, the system will not
     256process an exposure through subsequent stages without the component
     257that has failed temporarily.  Since many of the \ippdbcolumn{fault}s
     258which occur are ephemeral, the processing stages are set up to
     259occasional clear and re-try the faulted entries.  Thus, automatic
     260processing is able to keep the data flowing even in the face of
     261occasional network glitches or hardware crashes.
    222262
    223263\subsection{Nebulous}
    224 
     264\label{subsec: nebulous}
    225265Storing the large volume of data that is generated by the GPC1 camera
    226266was recognized early in the Pan-STARRS project as a major concern.
     
    229269the files, with a Simple Object Access Protocol interface between the
    230270database and the other IPP programs.  The actual files are stored on
    231 NFS mounted partitions on a series of storage nodes in the IPP
    232 cluster.
    233 
    234 The original design of \ippprog{Nebulous} intended to aid in the
     271NFS mounted partitions on a series of storage nodes in the IPP cluster
     272that can be accessed throughout the cluster.  This distribution of
     273files is useful to balance the disk I/O, as this parallelizes the
     274load.
     275
     276The original design of \ippprog{Nebulous} was intended to aid in the
    235277targetted processing of data, by having specific image data (such as
    236278all the images from one OTA device) located on a single storage node.
    237279This would allow any jobs involving that data to be assigned to the
    238 storage node, eliminating network IO.  Important data could be
    239 duplicated to a further data nodes, with the alternate locations
     280storage node, eliminating network I/O.  Important data could be
     281duplicated to additional data nodes, with the alternate locations
    240282stored in the database.  In practice, however, hardware failures and
    241283increases in hard drive storage volumes and network bandwidth have
    242 reduced the amount that the IPP processing is targeted.
     284reduced the degree to which the IPP processing is targeted.
    243285
    244286When a program creates a new file in \ippprog{Nebulous}, it supplies
    245 an URI of the form \texttt{neb://HOST.VOLUME/PATH/FILENAME}.  The host
     287an URI of the form \code{neb://HOST.VOLUME/PATH/FILENAME}.  The host
    246288and volume specifiers are optional, and allow a file to be created on
    247 a specific node.  The path and filename appear as a standard full file
    248 location, and are used internally as the ``external id''.  A
    249 storage\_object is then created in the database for this id, and an
    250 instance of the file created on the specified node (or at random from
    251 available nodes if left empty). 
    252 
    253 
    254 \subsection{Pantasks \& Parallel Processing}
     289a specific node.  The path and filename appear similar to a standard
     290full file location, and are used internally as the ``external id''.  A
     291storage object entry is then created in the database for this id, and
     292an instance of the file created on the specified node (or at random
     293from available nodes if left empty).  This instance is created in a
     294deterministic filename location.  The external id is hashed using the
     295SHA-1 function, and the first four hexadecimal digits of this hash are
     296separated into two two-digit strings and used as the top and second
     297level directory location for the disk file.  The disk file is created
     298using the database instance id, and a transformed version of the
     299external id, which has colons replacing any forward slash characters,
     300to convert the external id path into a filename.  For the example URI
     301above, this results in a file located on disk in a location like
     302\code{/data/HOST.VOLUME/nebulous/d5/d8/9244993440.PATH:FILENAME}.
     303This file naming structure is useful, as it duplicates database
     304contents on disk.
     305
     306The storage volumes that contain the data on disk are defined in the
     307\ippprog{Nebulous} database in a number of ways.  First, the locations
     308and mount points for the actual NFS storage are listed in the
     309\ippdbtable{volume} table.  This table contains columns indicating if
     310the volume should be used for reading (\ippdbcolumn{available}) and
     311writing (\ippdbcolumn{allocate}), allowing these properties to be
     312manually set, which is useful in scheduling downtime for hardware
     313issues.  Another column, \ippdbcolumn{xattr}, is used to control the
     314behavior of this volume, with specific values used to denote desired
     315behavior.  For instance, the value of $1$ is used to indicate that a
     316volume should only be used as a backup volume (which accepts only
     317replicated copies), and the value of $5$ is used to indicate that the
     318volume is permanently unavailable, and should be ignored.
     319
     320In addition to this permanent table describing the volumes, a
     321\ippdbtable{mountedvol} table also exists that only lists those
     322volumes that are currently visible and accessible from the
     323\ippprog{Nebulous} database server.  This table also lists the total
     324and currently available disk space on each volume, allowing the
     325\ippprog{Nebulous} load balancing routines to prioritize those volumes
     326with large unused disk space before filling the volumes with only
     327small amounts remaining.  This table is regenerated every ten to
     328twenty minutes, after a scan of each of the volumes listed in the
     329\ippdbtable{volume} table.
     330
     331The final table controlling the operations of the \ippprog{Nebulous}
     332volumes is the \ippdbtable{cabinet} table, which organizes the
     333individual volumes into ``cabinets,'' a concept loosly based on the
     334physical arrangement of the storage servers in the data center.  These
     335cabinets are used to prevent the replication of a storage object
     336within a group of volumes where all instances of the object could be
     337taken off line by a single failure.  As the data center cabinets share
     338power supplies among the servers they contain, ensuring physical
     339distance between replicated copies is important to guarantee that a
     340temporary failure of one of these devices does not significantly
     341impact processing.
    255342
    256343\subsection{DVO}
     344\label{subsec: DVO}
    257345
    258346The Pan-STARRS IPP uses an internal database system, distinct from the
     
    262350database system, called the ``Desktop Virtual Observatory'' (DVO) was
    263351developed originally for the LONEOS project, and used as part of the
    264 CFHT Elixir system (Magnier \& Cuillandre REF).  The capabilities of
     352CFHT Elixir system \citep{2004PASP..116..449M}.  The capabilities of
    265353this databasing system have been somewhat expanded for the Pan-STARRS
    266354context. 
     
    268356One of the main purposes of the DVO system is to define the
    269357relationship between individual detections of an astronomical object
    270 and the definition of that object.  Before describing the database
    271 schema, we will discuss the process by which detections are associated
    272 with objects.  New detections are generally added to the database in a
    273 group associated with, for example, an image from the GPC1 camera.  As
    274 new detections are loaded, they are compared to the objects already
    275 stored in the database.  If an object is already found in the database
    276 within the match radius, the new detection is associated to that
    277 object. If more than one object exists within the database, the
    278 detection is associated with the closest object. 
     358and the definition of that object.  New detections are generally added
     359to the database in a group associated with, for example, an image from
     360the GPC1 camera.  As new detections are loaded, they are compared to
     361the objects already stored in the database.  If an object is already
     362found in the database within the match radius of \note{one arcsecond}, the new detection is
     363associated to that object. If more than one object exists within the
     364database, the detection is associated with the closest object.
    279365
    280366Detections in DVO have a special piece of metadata called the
    281 \code{photcode} which identifies the source of the measurement.  A
    282 \code{photcode} has a name which in general consists of the name of
    283 the camera or telescope (e.g., GPC1 or 2MASS), the name (or short-hand
    284 name) of the filter used for the measurement (e.g., $g$), and an
    285 identifier for the detector, if not unique (e.g., XY01 for GPC1).
    286 Along with each name, there is a numerical value for the photcode.  A
    287 table within the DVO system, \code{Photcode}, lists the photcoes and
    288 defines a number of additional pieces of information for each
    289 photcode.  These include the nominal zero point and airmass slope, as
    290 well as color trends to transform a measurement in the specific
    291 photcode to a common system.  There are 3 classes of photcodes defined
    292 within the DVO system.  Those photcodes associated with detections
    293 from an image loaded into the database system are called \code{DEP}
    294 photcodes.  There are also photcodes associated with the average
    295 photometry values, called SEC photcodes.  There are also those
    296 measurements which come from external data sources for which DVO does
    297 not have any information to determine a calibration (e.g.,
    298 instrumental magnitudes and detector coordinates).  These are
    299 measurements are reference values and are assigned REF photcodes.
     367\ippdbcolumn{photcode} which identifies the source of the measurement.
     368A \ippdbcolumn{photcode} has a name which in general consists of the
     369name of the camera or telescope (e.g., GPC1 or 2MASS), the name (or
     370short-hand name) of the filter used for the measurement (e.g.,
     371\gps{}), and an identifier for the detector, if not unique (e.g., XY01
     372for a GPC1 OTA).  Along with each name, there is a numerical value for
     373the photcode.  A table within the DVO system, \ippdbtable{Photcode},
     374lists the photcodes and defines a number of additional pieces of
     375information for each photcode.  These include the nominal zero point
     376and airmass slope, as well as color trends to transform a measurement
     377in the specific photcode to a common system.  There are 3 classes of
     378photcodes defined within the DVO system.  Those photcodes associated
     379with detections from an image loaded into the database system are
     380called \ippmisc{DEP} photcodes.  There are also photcodes associated with
     381the average photometry values, called \ippmisc{SEC} photcodes.  There are
     382also those measurements which come from external data sources for
     383which DVO does not have any information to determine a calibration
     384(e.g., instrumental magnitudes and detector coordinates).  These are
     385measurements are reference values and are assigned \ippmisc{REF}
     386photcodes.
    300387
    301388In the implementation of DVO used for the PV3 calibration analysis,
     
    304391of files for table which are spatially partitioned.  The binary FITS
    305392tables may be optionally compressed using the (to date) experimental
    306 FITS binary table compression strategy outlined by REF.  In this
     393FITS binary table compression strategy outlined by \note{REF}.  In this
    307394compression scheme, using a strategy similar to that used for FITS
    308 image compression (REF), the data stored in the binary table is
     395image compression (\note{REF}), the data stored in the binary table is
    309396compressed and stored in the 'HEAP' section of the FITS table.  In
    310397brief, each column in the FITS table is compressed as one (or more)
     
    342429region bounded by lines of constant RA,DEC are contained in a specific
    343430file.  The boundaries and the associated partition names are stored in
    344 one of the supporting tables, \code{SkyTable}.  This table contains
    345 the definitions of the boundaries for each sky region (\code{R_MIN},
    346 \code{R_MAX}, \code{D_MIN}, \code{D_MAX}), the name of the sky region,
    347 an ID (\code{INDEX}, equal to the sequence number of the region in the
     431one of the supporting tables, \ippdbtable{SkyTable}.  This table
     432contains the definitions of the boundaries for each sky region
     433(\ippdbcolumn{R\_MIN}, \ippdbcolumn{R\_MAX}, \ippdbcolumn{D\_MIN},
     434\ippdbcolumn{D\_MAX}), the name of the sky region, an ID
     435(\ippdbcolumn{INDEX}, equal to the sequence number of the region in the
    348436table), and index entries to enable navigation within the table.  The
    349437regions are defined in a hierarchical sense, with a series of levels
    350 each containing a finer mesh of regions covering the sky. 
     438each containing a finer mesh of regions covering the sky.
    351439
    352440In the default used by the PV3 DVO, the partitioning scheme is based
     
    3584464 - 8 smaller partitions.  This level exactly matches the HST GSC
    359447layout, and uses the same naming convention to identify the
    360 partitions: n0000/0000, etc. \note{more on the names?}.  Level 4
    361 further divides these regions by a factor of 16.  In the
    362 \code{SkyTable}, a region at one level has a pointer to its parent
    363 region (the one which contains it) and a sequence pointing to its
    364 children (regions it contains).  The \code{SkyTable} enables fast
    365 lookups of the on-disk partitions which map to a specific coordinate
    366 on the sky.  In general, a single DVO will have the full sky
    367 represented with tables at a single level, though it is possible for
    368 mixed levels to be used, this mode is not well tested.  For the PV3
    369 master database, the partitioning at the 5th level results in \approx
    370 150,000 regions to cover the full sky, of which \approx 110,000 are
    371 used for the PV3 $3\pi$ data.  The densest portions of the bulge
    372 contain at most \approx 300k astronomical objects in the database
    373 files, with an associated maximum of 30M measurements in these files.
    374 With the compression scheme described above, this makes the largest
    375 database files \approx 3GB, which can be loaded into memory in 30
    376 seconds on our partition machines.
     448partitions: \code{n0000/0000}, etc. \note{more on the names?}.  Level
     4494 further divides these regions by a factor of 16.  In the
     450\ippdbtable{SkyTable}, a region at one level has a pointer to its
     451parent region (the one which contains it) and a sequence pointing to
     452its children (regions it contains).  The \ippdbtable{SkyTable} enables
     453fast lookups of the on-disk partitions which map to a specific
     454coordinate on the sky.  In general, a single DVO will have the full
     455sky represented with tables at a single level, though it is possible
     456for mixed levels to be used, this mode is not well tested.  For the
     457PV3 master database, the partitioning at the \note{should this be
     458  4th?} 5th level results in \approx 150,000 regions to cover the full
     459sky, of which \approx 110,000 are used for the PV3 $3\pi$ data.  The
     460densest portions of the bulge contain at most \approx 300,000
     461astronomical objects in the database files, with an associated maximum
     462of 30 million measurements in these files.  With the compression
     463scheme described above, this makes the largest database files \approx
     4643GB, which can be loaded into memory in 30 seconds on the processing
     465machines that contain partition data.
    377466
    378467The DVO software system allows the tables which are partitioned across
     
    380469call partition hosts.  A single file defines the names of these
    381470partition hosts and the location of the database partition on the
    382 disks of that machine.  The \code{SkyTable} contains elements to
     471disks of that machine.  The \ippdbtable{SkyTable} contains elements to
    383472define by ID the parition host to which a partitioned set of tables
    384473has been assigned.  Operations which query the database, or perform
     
    395484manipulating the enormous database on a reasonable timescale.
    396485
    397 \subsection{Tables which describe objects}
     486\subsubsection{Astronomical Objects}
    398487
    399488Two tables carry the most important information about the astronomical
    400 objects in the database: Average and SecFilt.  These two tables
    401 specify the main average properties of the astronomical object.  The
    402 Average table includes the astrometric information ($\alpha, \delta,
    403 \mu \alpha, \mu \delta, \pi$) and associated errors, data quality
    404 flags for each object, links to the other tables, and a number of IDs,
    405 with one row for each astronomical object.  \note{go into complete
    406   detail here on the IDs?}.  The SecFilt table\footnote{The name
    407   SecFilt is a bit of a historical misnomer: originally, DVO was
    408   designed for a monochromatic survey and data for a single
    409   photometric band was maintained in the Average table.  Later, DVO
    410   was adapted to a multifilter system and additional filters were
    411   added to the SecFilt (Secondary Filter) table.  Eventually, the
    412   schema was normalized and all photometric data placed in SecFilt,
    413   with the Primary filter concept being dropped, but the name has
    414   since stuck.} contains average photometric information for a
    415 collection of filters.  A given DVO instance has a specified set of
    416 filters for which average photometry is stored in the SecFilt table.
    417 The number and choice of filters for the SecFilt may be modified by
    418 the database administrator fairly easily, but the process of updating
    419 the database is somewhat expensive (\approx 24 hours for the current
    420 PV3 instance).  Thus the choice is semi-static for a given DVO
    421 instance.  In the case of the PV3 DVO instance, 9 average bandpasses
    422 are defined: {\it g, r, i, z, y, J, H, K, w}.  The SecFilt table
    423 contains one row for each filter for each object, thus the PV3 DVO
    424 contains 9 times as many rows as the Average table.  The order of the
    425 table is fixed in relation to the Average table: row $i$ of Average
    426 defines the object with photometry contained in rows $9i \rightarrow 9i +
    427 8$ ($i$ is zero counting). 
     489objects in the database: \ippdbtable{Average} and
     490\ippdbtable{SecFilt}.  These two tables specify the main average
     491properties of the astronomical object.  The \ippdbtable{Average} table includes the
     492astrometric information ($\alpha, \delta, \mu \alpha, \mu \delta,
     493\pi$) and associated errors, data quality flags for each object, links
     494to the other tables, and a number of IDs, with one row for each
     495astronomical object.  \note{go into complete detail here on the IDs?}.
     496The \ippdbtable{SecFilt} table\footnote{The name \ippdbtable{SecFilt}
     497  is a bit of a historical misnomer: originally, DVO was designed for
     498  a monochromatic survey and data for a single photometric band was
     499  maintained in the Average table.  Later, DVO was adapted to a
     500  multifilter system and additional filters were added to the
     501  \ippdbtable{SecFilt} (Secondary Filter) table.  Eventually, the
     502  schema was normalized and all photometric data placed in
     503  \ippdbtable{SecFilt}, with the Primary filter concept being dropped,
     504  but the name has since stuck.} contains average photometric
     505information for a collection of filters.  A given DVO instance has a
     506specified set of filters for which average photometry is stored in the
     507\ippdbtable{SecFilt} table.  The number and choice of filters for the
     508\ippdbtable{SecFilt} may be modified by the database administrator
     509fairly easily, but the process of updating the database is somewhat
     510expensive (\approx 24 hours for the current PV3 instance).  Thus the
     511choice is semi-static for a given DVO instance.  In the case of the
     512PV3 DVO instance, 9 average bandpasses are defined: \gps{}, \rps{},
     513\ips{}, \zps{}, \yps{}, {\it J, H, K}, and \wps{}.  The
     514\ippdbtable{SecFilt} table contains one row for each filter for each
     515object, thus the PV3 DVO contains 9 times as many rows as the
     516\ippdbtable{Average} table.  The order of the table is fixed in
     517relation to the \ippdbtable{Average} table: row $i$ of
     518\ippdbtable{Average} defines the object with photometry contained in
     519rows $9i \rightarrow 9i + 8$ ($i$ is zero counting).
    428520
    429521The individual measurements of the astronomical objects are carried in
    430 the table \code{Measure}.  This table lists the values measured by
    431 \code{psphot} for each chip, warp, or stack image.  This includes the
    432 instrumental magnitudes for the PSF, aperture, and Kron photometry;
    433 raw position (Xccd, Yccd) and second moments (Mxx, Myy, Mxy), along
    434 with shape parameters of the PSF model at the position of the object
    435 (FWx, FWy, theta).  This table also includes metadata such as the
    436 exposure time, the date \& time of the observation, airmass, azimuth,
    437 and information specifying the filter \note{describe the photcodes}.
    438 The \code{Measure} table also carried the calibration magnitude offsts
    439 ($M_{\rm cal}$ and $M_{\rm flat}$ discussed below) and the
    440 astrometrically calibrated position.  Astrometric offsets for several
    441 systematic corrections discussed below are also defined for each
    442 measurement.  Since stacks and forced warp photometry may have
    443 non-significant values, the table is somewhat de-normalized in that it
    444 also carried instrumental flux values for the PSF, aperture, and Kron
    445 photometry. 
    446 
    447 In the \code{Measure} table, there are three fields which provide two
    448 independent links from the specific measurement to the associated
    449 object: \code{Measure.catID} specifies the spatial partition to which
    450 the measurement belongs; \code{Measure.objID} specifies to which entry
    451 in the \code{Average} table the measurement belongs.  These two 32 bit
    452 fields can thus be combined into a single 64 bit unique ID for all
    453 objects in the database.  In addition, the field \code{Measure.averef}
    454 specifies the row number in the \code{Average} table of the associated
    455 object.  The \code{Measure} table may be unsorted, in which case it is
    456 slow to find the measurements associated with a specific object (a
    457 full table scan is required).  After the table is sorted, the
    458 \code{Measure} rows for a given object are grouped together.  In the
    459 case, the fields \code{Average.measureOffset} and
    460 \code{Average.Nmeasure} define an index for the code to jump to the
    461 list of measurements for a single object.  The field
    462 \code{Measure.imageID} defines the link from the measurement to the
    463 image which supplied the measurement.
     522the table \ippdbtable{Measure}.  This table lists the values measured
     523by \ippprog{psphot} for each \ippstage{chip}, \ippstage{warp}, or
     524\ippstage{stack} stage image.  This includes the instrumental magnitudes for
     525the PSF, aperture, and Kron photometry; raw position
     526(\ippdbcolumn{Xccd}, \ippdbcolumn{Yccd}) and second moments
     527(\ippdbcolumn{Mxx}, \ippdbcolumn{Myy}, \ippdbcolumn{Mxy}), along with
     528shape parameters of the PSF model at the position of the object
     529(\ippdbcolumn{FWx}, \ippdbcolumn{FWy}, \ippdbcolumn{theta}).  Metadata
     530about the exposure that the measurement was derived from is also
     531include, such as the exposure time, the date \& time of the
     532observation, airmass, azimuth, and \ippdbcolumn{photcode} information
     533specifying the filter.  The \ippdbtable{Measure} table also carries
     534the calibration magnitude offsts ($M_{\rm cal}$ and $M_{\rm flat}$,
     535discussed below) and the astrometrically calibrated position.
     536Astrometric offsets for several systematic corrections discussed below
     537are also defined for each measurement.  Since stacks and forced warp
     538photometry may have non-significant values, the table is somewhat
     539de-normalized in that it also carries instrumental flux values for the
     540PSF, aperture, and Kron photometry.
     541
     542In the \ippdbtable{Measure} table, there are three fields which
     543provide two independent links from the specific measurement to the
     544associated object: \ippdbtable{Measure}.\ippdbcolumn{catID} specifies
     545the spatial partition to which the measurement belongs;
     546\ippdbtable{Measure}.\ippdbcolumn{objID} specifies to which entry in
     547the \ippdbtable{Average} table the measurement belongs.  These two 32
     548bit fields can thus be combined into a single 64 bit ID unique for all
     549objects in the database.  In addition, the field
     550\ippdbtable{Measure}.\ippdbcolumn{averef} specifies the row number in
     551the \ippdbtable{Average} table of the associated object.  The
     552\ippdbtable{Measure} table may be unsorted, in which case it is slow
     553to find the measurements associated with a specific object (a full
     554table scan is required).  After the table is sorted, the
     555\ippdbcolumn{Measure} rows for a given object are grouped together.
     556In this case, the fields
     557\ippdbtable{Average}.\ippdbcolumn{measureOffset} and
     558\ippdbcolumn{Average}.\ippdbcolumn{Nmeasure} define an index for the
     559code to jump to the list of measurements for a single object.  The
     560field \ippdbtable{Measure}.\ippdbcolumn{imageID} defines the link from
     561the measurement to the image which supplied the measurement.
    464562
    465563\note{some discussion of the db construction, addstar, dvomerge, etc?}
    466564
    467565For the warp images, we also measure the weak lensing KSB parameters
    468 related to the shear and smear tensors.  These measurements are stored
    469 in the \code{Lensing} table, along with the radial aperture fluxes for
    470 radii numbers 5, 6, \& 7 (XX, XX, XX arcsec).  This table contains one
    471 row for every warp row.  Similarly to the \code{Measure} table, the fields
    472 \code{objID}, \code{catID}, and \code{averef} define links from the
    473 \code{Lensing} table to the \code{Average} table.  In a similar
    474 fashion, the fields \code{Average.lensingOffset} and
    475 \code{Average.Nlensing} are the index into the sorted \code{Lensing}
    476 table entries.  \note{discuss failure of the Lensing to Measure
    477   indexing}
    478 
    479 The values stored in the \code{Lensing} table are used to calculate
    480 average values for each of these types of measurements in each
    481 filter.  The \code{Lensobj} table stores the averaged KSB and radial
    482 aperture photometry for each of the 5 filters \grizy.  This table
    483 contains one entry per object per filter.  The table is not generally
    484 stored unsorted as it is calculated after the full database is
    485 populated.  The link from \code{Average} to \code{Lensobj} is defined
    486 by the fields \code{Average.offsetLensobj} and
    487 \code{Average.Nlensobj}.  Each \code{Lensobj} row also includes the
    488 photcode (filter) for which the average lensing (and radial aperture)
    489 properties have been calculated.
    490 
    491 The \code{Galphot} table stores the results of the forced galaxy
     566related to the shear and smear tensors \citep{1995ApJ...449..460K}.
     567These measurements are stored in the \ippdbcolumn{Lensing} table,
     568along with the radial aperture fluxes for radii numbers 5, 6, \& 7
     569(respectively 3.0, 4.63, and 7.43 arcsec).  This table contains one
     570row for every warp row. \note{warp row hasn't been defined anywhere.}
     571Similarly to the \ippdbtable{Measure} table, the fields
     572\ippdbcolumn{objID}, \ippdbcolumn{catID}, and \ippdbcolumn{averef}
     573define links from the \ippdbtable{Lensing} table to the
     574\ippdbtable{Average} table.  In a similar fashion, the fields
     575\ippdbtable{Average}.\ippdbcolumn{lensingOffset} and
     576\ippdbtable{Average}.\ippdbcolumn{Nlensing} are the index into the
     577sorted \ippdbtable{Lensing} table entries.  \note{discuss failure of
     578  the Lensing to Measure indexing}
     579
     580The values stored in the \ippdbtable{Lensing} table are used to
     581calculate average values for each of these types of measurements in
     582each filter.  The \ippdbtable{Lensobj} table stores the averaged KSB
     583and radial aperture photometry for each of the 5 filters \grizy.  This
     584table contains one entry per object per filter.  The table is not
     585generally stored unsorted as it is calculated after the full database
     586is populated.  The link from \ippdbtable{Average} to
     587\ippdbtable{Lensobj} is defined by the fields
     588\ippdbtable{Average}.\ippdbcolumn{offsetLensobj} and
     589\ippdbtable{Average}.\ippdbcolumn{Nlensobj}.  Each
     590\ippdbtable{Lensobj} row also includes the \ippdbcolumn{photcode} for which
     591the average lensing (and radial aperture) properties have been
     592calculated.
     593
     594The \ippdbtable{Galphot} table stores the results of the forced galaxy
    492595fitting analysis for each object that has been measured.  This table
    493 contains one row per filter and model type (Sersic, Exponential,
     596contains one row per filter and model type (Sersic, Exponential, or
    494597DeVaucouleur) if forced galaxy models have been calculate for the
    495598object.  \note{need to expand on this somewhat}
    496599
    497 The \code{Starpar} table carries measurements provide by Greg Green \&
    498 Eddie Schlafly from their analysis of the SED of objects in the PS1
    499 $3\pi$ data, using the \note{PV1?} version of the analysis (Green et
    500 al REF).  In this work, the goal was a 3D model of the dust in the
    501 Galaxy based on Pan-STARRS (\note{and WISE \& 2MASS?}) photometry.  As
     600The \ippdbtable{Starpar} table carries measurements provide by Greg
     601Green \& Eddie Schlafly from their analysis of the SED of objects in
     602the PS1 $3\pi$ data, using the \note{PV1?} version of the analysis
     603\citep{2015ApJ...810...25G}.  In this work, the goal was a 3D model of
     604the dust in the Galaxy based on Pan-STARRS and 2MASS photometry.  As
    502605part of this analysis, the authors fit the SEDs of all \note{stellar?}
    503606sources with stellar models including free parameters of extinction,
     
    505608these photometric distance modulus measurements are not extremely
    506609precise (see below), they provide a constraint on the distance is used
    507 in our analysis of the astrometry (see Section~\ref{sec:astrometry}).
    508 
    509 \subsection{Other Tables}
     610in our analysis of the astrometry \citep[][see]{magnier2017a}.
     611
     612\subsubsection{Other Tables}
    510613
    511614Data from GPC1 (and other cameras processed by the IPP) are loaded
    512 into DVO in units \code{smf} files generated by the Camera calibration
    513 stage.  As described above, these files contain all measurements from
    514 a complete exposure, with measurements from each chip grouped into
    515 separate FITS tables.  When these measurements are loaded into the
    516 \code{Measure} and similar tables, a subset of the information from
    517 the chip header is used to populated a row in the DVO \code{Image}
    518 table.  This table contains one row for each chip known to DVO, with
    519 information such as the filter (\code{photcode}), the exposure time,
    520 the airmass, the astrometric calibration terms, the photometric
    521 zero point, etc.  For GPC1 and other mosaic cameras, an additional row
    522 is defined to carry the projection and camera distortion elements of
    523 the astrometry model.  As chips are loaded into this table, they are
    524 assigned an internal ID (a running sequence in the table).  Images may
    525 also be assigned an external ID: in the case of the GPC1 images, this
    526 ID is defined by the processing mysql database and is guaranteed to be
    527 unique within the processing system.
     615into DVO in units \code{smf} files generated by the \ippstage{camera}
     616calibration stage (see section \ref{subsec: camera} below).  As
     617described above, these files contain all measurements from a complete
     618exposure, with measurements from each chip grouped into separate FITS
     619tables.  When these measurements are loaded into the
     620\ippdbtable{Measure} and similar tables, a subset of the information
     621from the chip header is used to populated a row in the DVO
     622\ippdbtable{Image} table.  This table contains one row for each chip
     623known to DVO, with information such as the filter
     624(\ippdbcolumn{photcode}), the exposure time, the airmass, the
     625astrometric calibration terms, the photometric zero point, etc.  For
     626GPC1 and other mosaic cameras, an additional row is defined to carry
     627the projection and camera distortion elements of the astrometry model.
     628As chips are loaded into this table, they are assigned an internal ID
     629(a running sequence in the table).  Images may also be assigned an
     630external ID: in the case of the GPC1 images, this ID is defined by the
     631processing mysql database and is guaranteed to be unique within the
     632processing system.
    528633
    529634Other tables are used to track information used by the calibration
    530635system.  This includes the complete set of flat-field corrections
    531 determined by the photometry calibration analysis (see
    532 Section~\ref{sec:relphot}) and the astrometric flat-field corrections
    533 determined by the astrometry calibration analysis (see Section~\ref{sec:relastro})
     636determined by the photometry calibration analysis and the astrometric
     637flat-field corrections determined by the astrometry calibration
     638analysis \citep[][see]{magnier2017a}.
     639
     640\subsection{Datastore repositories}
     641\label{subsec: datastore}
     642
     643Transferring data between the IPP and other parts of the Pan-STARRS
     644system is generally accomplished via a ``datastore'', an http service
     645that exposes data in a common form.  One of the main datastores used
     646by the IPP is the one located at the summit.  This datastore exposes,
     647a list of the exposures obtained since the start of the PS1
     648operations.  Requests to this server may restrict to the latest by
     649time.  Each row in the listing includes basic information about the
     650exposure: an exposure identifier (e.g., o5432g0123o;
     651see~\ref{GPC1.names} for details), the date and time of the exposure,
     652the telescope commanded pointing, the filter and exposure time, and
     653the observation comment for that exposure.  The row also provides a
     654link to a listing of the chips associated with that exposure.  This
     655listing includes a link to the individual chip FITS files as well as
     656an md5 checksum.  Systems which are allowed access may download chip
     657FITS files via http requests to the provided links.
     658
     659The IPP also uses datastores to provide access to its own data
     660products.  The detections identified in the \ippstage{diff} stage
     661images are organized by the \ippstage{publish} stage, which writes
     662output files containing those detections to a datastore that is
     663monitored by the Moving Object Processing System
     664\citep[][MOPS]{2013PASP..125..357D}, which analyses the detections to
     665identify asteroids.  Separate datastores are also used by the
     666\ippstage{distribution} stage to provide access to data products to
     667the Pan-STARRS Science Consortium members. 
     668
     669\subsection{Pantasks \& Parallel Processing}
     670\label{subsec: pantasks}
     671
     672The actual processing of data is managed by the \ippprog{pantasks}
     673program.  This program launches a series of connections to other
     674computers in the IPP compute cluster, and launches instances of the
     675\ippprog{pclient} program that wait for jobs to be submitted.  These
     676jobs are generated from \ippmisc{ippTasks} command scripts that each
     677contain one set of tasks, written in the opihi language shared with
     678DVO.  These task scripts are generally sorted by the IPP stage.  The
     679tasks listed in these scripts are mainly written in the form of a pair
     680of \ippmisc{load} and \ippmisc{run} tasks.
     681
     682The \ippmisc{load} task for a particular stage queries the processing
     683database via an appropriate \ippmisc{ippTool} (see section \ref{subsec:
     684  ipptools} below) for a list of jobs that are waiting to be run.
     685This task is executed on the host running the \ippprog{pantasks}
     686server, and only one of each type of \ippmisc{load} task is permitted to
     687run simultaneously, preventing race conditions.  To manage the
     688processing, the primary database tables for each stage contain a
     689\ippdbcolumn{label} field.  This field groups data into categories,
     690and the appropriate list of \ippdbcolumn{label}s are supplied to the
     691\ippprog{pantasks} program to be included in the queries to ensure
     692that only jobs for the active \ippdbcolumn{label}s are executed.  The
     693results from the database query are stored in \ippmisc{books} within the
     694\ippprog{pantasks} environment, with each resulting result row saved
     695to a separate entry within the \ippmisc{book}.  These \ippmisc{books} are
     696similar to an associative array indexing the entries (\ippmisc{pages} to
     697continue the analogy) to be accessed via a particular key.  Keys for
     698most stages are a combination of the stage id and an identifier for
     699the individual component for the job that will be executed.  The rest
     700of the column results from the query are stored to the \ippmisc{page},
     701with each field stored with the database column name.  An additional
     702field is added, the \ippdbcolumn{pantasksState}, which is set to
     703\ippmisc{INIT}, indicating that this \ippmisc{page} is a new addition to the
     704\ippmisc{book}.  Once all results from the database query have been
     705saved, the \ippmisc{load} task terminates, and waits to be rerun after
     706some timeout (on the order of a minute).  Once all new \ippmisc{pages}
     707have been added, the task then scans the \ippmisc{book} for any pages
     708with \ippdbcolumn{pantasksState} set to \ippmisc{DONE}, and removes them
     709from the book, as these represent jobs that have finished.
     710
     711Parallel to the \ippmisc{load} task, the \ippmisc{run} tasks are executed
     712by the \ippprog{pclient} code on one of the client nodes.  These
     713clients can access the \ippmisc{books} from \ippprog{pantasks}, and scan
     714the \ippmisc{book} to determine if it contains \ippmisc{pages}, and if one
     715of those pages contains an entry with the \ippdbcolumn{pantasksState}
     716set to \ippmisc{INIT}.  If such a \ippmisc{page} is found, the task sets
     717this field to \ippmisc{RUN} (ensuring no other \ippmisc{run} task will
     718attempt to process that page as well), and uses the information stored
     719on the page to construct a valid command line for the appropriate IPP
     720script.  The script (described below) command line is then executed,
     721and upon completion, pass the exit code back to \ippprog{pantasks},
     722allowing for an accounting of success and failures.  The page is then
     723set to \ippmisc{DONE}, indicating the job has completed, and the
     724\ippmisc{page} can be removed from the \ippmisc{book} by the next call of
     725the \ippmisc{load} task.  As the \ippmisc{run} tasks will involve processing
     726that may not complete in a known period of time, there is a timeout
     727limit set for the task, after which the \ippprog{pantasks} process can
     728terminate the task.  This prevents unproductive jobs from building up.
     729
     730In addition to these tasks, most stages have \ippmisc{revert} tasks
     731paired with the \ippmisc{run} task.  These tasks issue an appropriate
     732\ippmisc{ippTool} command to remove entries from the stage's secondary
     733database table that have the \ippdbcolumn{fault} field set to a value
     734other than zero.  This step allows these failures to be cleared from
     735the system, and schedule those jobs again for a retry.  Again, this
     736query is limited by the set of active \ippdbcolumn{label}s, ensuring
     737that only the data currently being processed is reverted.  Similarly,
     738some stages have \ippmisc{advance} tasks that update the primary table to
     739indicate that all of its components are complete.  For many of the
     740early stages of the pipeline (the \ippstage{chip} through
     741\ippstage{warp} stages), this \ippmisc{advance} task also adds an entry
     742into the database table for the next stage of processing for the
     743exposure being considered.  This step allows the data to process
     744automatically from stage to stage without intervention.
     745
     746\subsubsection{Stage automation}
     747\label{subsec: automation}
     748\note{I'm not convinced this is the right place for it, but it felt like a natural extension of the ``advance''}.
     749
     750Beyond the warp stage, there is no longer a single ``next'' stage into
     751which data can be queued.  Because of this, more robust methods are
     752used to advance the data.  For processing data that is actively being
     753observed at the summit, this is handled by a set of ``nightly
     754science'' tasks and an associated \ippmisc{ippScript}.  The goal of
     755these tasks is to ensure that exposures are correctly paired into sets
     756of \ippstage{warp}-\ippstage{warp} difference images, and that nightly
     757stacks are generated for MD fields.
     758
     759Queuing the diffs is done by first examining the set of all exposures
     760that have been taken at the summit on the current night of observing,
     761and querying information from each stage up through \ippstage{warp}
     762stage.  These exposures are grouped by \ippdbcolumn{filter} and
     763\ippdbcolumn{object}, which is a unique identifier for each telescope
     764pointing on the sky.  Exposures in each group are then sorted by
     765increasing observation date (\ippdbcolumn{dateobs}), and the
     766information from each stage is used to ensure that the observations
     767have completed all stages through \ippstage{warp} successfully.  If
     768this is not the case, the script ignores that group until a future
     769scan, to allow the data to finish processing.  If the lack of
     770completion is due to a failure at a stage prior to \ippstage{warp},
     771then that exposure is dropped from the group to allow the remainder to
     772be considered for \ippstage{diff}s.  The remaining exposures are then
     773paired sequentially, with the final exposure ignored in the case of an
     774odd number of exposures (caused by either a failure in the processing
     775of an exposure or due to the telescope closing for weather prior to
     776completing all scheduled observations).  Once the observing process
     777completes (signalled to the nightly science task and script by the
     778presence in the database of entries for dark exposures that are taken
     779each morning after the telescope closes), and the script has generated
     780all \ippstage{diff} pairs that can be made with the above rule, a
     781second pass is performed, this time with the exposures in each group
     782sorted by decreasing observation date.  This change in ordering allows
     783exposures that were excluded due to an odd number of exposures to be
     784paired with the exposure closest in time (with the exposure that was
     785previously first ignored).
     786
     787The nightly stacks are queued based on checking that a minimum number
     788of complete \ippstage{warp} entries exist for each filter and field.
     789For the nightly MD processing, this minimum number was set to 8
     790exposures, as this is the number of exposures taken for each field.
     791Once this number was reached, no more exposures are expected, so
     792\ippstage{stack} database entries can be queued with the
     793\ippstage{warp} entries.  Again, failures and weather can reduce the
     794number of usable exposures, so the task generates \ippstage{stack}
     795entries using whatever exposures are available if one has not yet been
     796constructed by the time the morning dark exposures are registered into
     797the database.
     798
     799Automating the nightly processing is important, as it ensures that
     800data is processed as soon as it is downloaded from the summit,
     801reducing the lag between an observation and the reduced data.  The
     802other processing task that requires automation is the reprocessing of
     803the entire $3\Pi$ survey, as the size of the dataset make it
     804challenging to do manually.  To manage this, the ``large area
     805processing'' (LAP) task and script are used.  The first stage of this
     806processing is generating an entry in the \ippdbtable{lapSequence}
     807table defining a new reprocessing.  After this, individual
     808\ippdbtable{lapRun} entries can be queued that define a
     809\ippdbcolumn{filter} and a \ippdbcolumn{projection\_cell} to be
     810considered.  A \ippdbcolumn{projection\_cell} is a unit of sky defined
     811to be a square four degrees on each side which has a single tangent
     812plane projection \citep[][see]{watersc2017}.  Once this entry is
     813defined, is is populated with exposures (stored in the
     814\ippdbtable{lapExp} table in the database), with any exposure located
     815within 5 degrees of the center of the projection cell included.  This
     816radius ensures that any exposure that overlaps the projection cell
     817will be included.  Once the exposures have been added, the other
     818exposures within the same sequence are checked to see if a
     819\ippstage{chip} stage entry has been generated, and if so, the
     820\ippdbcolumn{chip\_id} for that entry is saved into the
     821\ippdbtable{lapExp} as well.  This linkage ensures that each exposure
     822is only processed once.  If no entry is found, a new \ippstage{chip}
     823entry is queued for processing.  The task periodically checks the
     824status of the exposures in each \ippdbtable{lapRun} entry, and if they
     825have all completed the \ippstage{warp} stage, then a \ippstage{stack}
     826is queued for each skycell contained within the
     827\ippdbcolumn{projection\_cell}.
     828
     829\subsection{ippTools and ippScripts}
     830\label{subsec: ipptools}
     831
     832As shown above, the \ippprog{pantasks} tasks rely on \ippmisc{ippTools}
     833calls for database queries.  Each stage has an appropriate
     834\ippmisc{ippTool}, allowing the database interaction to be governed by a
     835fixed set of inserts and queries.  Isolating the database interaction
     836in this way adds a layer of validation before queries are executed,
     837and ensures that all database modifications are handled in a uniform
     838fashion. 
     839
     840In addition to simple queries and updates to entries already in the
     841database, the various \ippmisc{ippTools} programs can also be used to
     842define new processing runs for a stage.  Again, using pre-defined
     843queries wrapped in a program allow the options to be parsed to ensure
     844that any new processing run definitions are appropriately restricted
     845in scope, reducing the chance that mistakes will fill the database
     846with many unwanted jobs.
     847
     848Connecting the \ippprog{pantasks} parallel processing environment to
     849the actual IPP analysis programs are a series of \ippmisc{ippScripts}
     850written in Perl.  These scripts are what are actually executed by
     851\ippprog{pantasks}, with command line options provided based on the
     852database query performed there by the \ippmisc{load} task.  These
     853options are combined with configuration information stored in
     854\ippmisc{ippconfig} recipe files. 
     855
     856The appropriate recipe is selected from the configuration information,
     857based on the source camera of the data to be processed, and optionally
     858modified by the \ippdbcolumn{reduction} field in the database.  These
     859optional \ippdbcolumn{reduction} entries provide a way to group a
     860non-standard set of processing options together across multiple
     861stages, by selecting a recipe that is not the default.
     862
     863With the set of configuration options and database entries for the
     864data to be processed, the \ippmisc{ippScript} checks the input files
     865that will be used, and confirms that a valid copy of each is available
     866from the \ippprog{Nebulous} system.  For stages that have a large
     867number of inputs (such as the \ippstage{stack} stage, which requires
     868images, masks, variance maps, and detection catalogs from each of the
     869potentially large number of \ippstage{warp} stage inputs), the input
     870files are organized into temporary input list files, formatted in an
     871appropriate way for the analysis program that will process them.
     872
     873The script also sets up an output logfile for this processing run,
     874ensuring that any status information from either the script itself or
     875the underlying analysis is stored on disk.  The majority of this
     876information is identical between calls to the script, but for rare
     877failures of the analysis programs, retaining this information allows
     878for such problems to be diagnosed and repaired. 
     879
     880The command line for the main analysis program is constructed based on
     881the database values, the recipe options, and the input file names.
     882The analysis program is then executed, and any failure reported back
     883to the parent \ippprog{pantasks} process.  In the standard case of the
     884analysis completing successfully, the script checks that the expected
     885output products were generated, preventing hidden I/O errors from
     886being a problem with subsequent processing of those output products.
     887
     888One output product that must exist is the \code{stats} file, which is
     889generated by the analysis program and contains statistics about the
     890processing, including such things as the image background level, the
     891fraction of masked pixels, and the version numbers of the analysis
     892program.  This stats file is then parsed by the
     893\ippprog{ppStatsFromMetadata} program, which uses the information
     894within to generate command options for the \ippmisc{ippTool} program
     895to ensure that these statistics are included in the database row that
     896is created in the secondary database table for the individual
     897component processed.
     898
     899\subsection{psLib and psModules}
     900\label{subsec: pslib}
     901
     902Underlying all of the analysis programs are the \ippmisc{psLib} and
     903\ippmisc{psModules} C libraries.  The more fundamental \ippmisc{psLib}
     904library defines the internal data structures that are used (arrays of
     905arbitrary type, vectors, images, and hash tables among others), manage
     906data access (particularly for FITS images and tables), and organize
     907string and error handling in a uniform fashion.  This library also
     908contains fundamental math operations, covering vector statistics,
     909matrix operations, and function minimization.  Common image operations
     910such as binning, interpolation, and convolution are also provided, as
     911well as the methods to to write JPEG versions of the data for
     912visualizations.  Finally, general coordinate transformations are
     913provided between planes and projections of spheres.
     914
     915The functions provided by \ippmisc{psModules} have more focused scopes
     916that are nevertheless still shared between multiple programs.  The
     917isolation of source objects is included, providing the organization of
     918detections that is used in the \ippprog{psphot} photometry analysis
     919\citep{magnier2017c}.  The PSF matching required for \ippstage{stack}
     920and \ippstage{diff} stage image combinations is as well.  The
     921unification of configuration options between config files on disk and
     922the options specified on the command line is handled by
     923\ippmisc{psModules} functions, as is the contruction of data
     924structures in memory to represent the astronomical camera based on the
     925header information in the input file.  The functions to generate and
     926apply the detrend corrections to the data are also provided by this
     927library.
     928
     929\note{This likely needs cleaning up and more information.}
    534930
    535931\section{IPP Data Processing Stages}
    536 
    537 \subsection{Download from Summit}
    538 
    539 As exposures are taken by the PS1 telescope \& camera system, the 60
    540 OTA CCDs are read out by the camera software system and each chip is
    541 written to disk on computers at the summit in the PS1 facility.  The
    542 chip images are written to a collection of machines in the PS1
    543 facility called the `pixel servers'.  After the images are written to
    544 disk, a summary listing of the information about the exposure and the
    545 chip images are written to an http server system called the
    546 `datastore'.  The datastore exposes, via http, a list of the exposures
    547 obtained since the start of the PS1 operations.  Requests to this
    548 server may restrict to the latest by time.  Each row in the listing
    549 includes basic information about the exposure: an exposure identifier
    550 (e.g., o5432g0123o; see~\ref{GPC1.names} for details), the date and
    551 time of the exposure, \note{etc}.  The row also provides a link to a
    552 listing of the chips associated with that exposure.  This listing
    553 includes a link to the individual chip FITS files as well as an md5
    554 CHECKSUM.  Systems which are allowed access may download chip FITS
    555 files via http requests to the provided links.
    556 
    557 During night-time operations, while the telescope is observing the sky
    558 and the camera subsystem is saving images to the pixel servers and
    559 adding their information to the datastore list, the IPP subsystem
    560 called `summitcopy' monitors the datastore in order to discover new
    561 exposures ready for download.  Once a new exposure has been listed on
    562 the datastore, summitcopy adds an entry of the exposure to a table in
    563 the processing database (summitExp).  This tells the summitcopy to
    564 look for the list of chips, which are then added to another table
    565 (summitImfile).  The summitcopy system then attempts to download the
    566 chips from the summit pixel servers with an http request.  As the chip
    567 files are downloaded, their md5 checksum values are calculated and
    568 compared with the value reported by the camera subsystem / datastore.
    569 Download failures are rare and marked as a non-zero fault, allowing for a
    570 manual recovery, rather than automatically rejecting the failed
    571 chips. 
     932\label{sec: stages}
     933
     934
     935\subsection{Summit copy}
     936\label{subsec: summit copy}
     937
     938As exposures are taken by the PS1 telescope \& GPC1 camera system, the
     939data from the 60 OTA devices are read out by the camera software
     940wsystem and written to disk on a collection of computers at the summit
     941in the PS1 facility called ``pixel servers.'' After the images are
     942written to disk, a summary listing of the information about the
     943exposure and the chip images are added to the summit datastore.
     944
     945During night-time operations, while the summit datastore is being
     946populated, the IPP subsystem called \ippstage{summitcopy} monitors the
     947datastores listed in the \ippdbtable{pzDatastore} table of the
     948database in order to discover new exposures ready for download.  Once
     949a new exposure has been listed on the datastore, \ippstage{summitcopy}
     950adds an entry of the exposure to a table in the processing database
     951(\ippdbtable{summitExp}), indexed by an identifier that simply
     952increments the number of exposures announced by the summit, the
     953\ippdbcolumn{summit\_id}.  This tells the \ippstage{summitcopy} system
     954to look for the list of chips, which are then added to another table
     955(\ippdbtable{summitImfile}).  This system then attempts to download
     956the chips (registering the results of those operations into the
     957\ippdbtable{pzDownloadExp} and \ippdbtable{pzDownloadImfile} tables)
     958from the summit pixel servers via an http request.  As the image files
     959are downloaded, their MD5 checksum values are calculated and compared
     960with the value reported by the summit datastore.  Download failures
     961are rare and marked with a non-zero \ippdbcolumn{fault}, allowing for
     962a manual recovery, rather than automatically rejecting the failed
     963chips.  Once all the components of the exposure have been downloaded,
     964they are further entered into the \ippdbtable{newExp} and
     965\ippdbtable{newImfile} tables, which index the exposures by
     966\ippdbcolumn{exp\_id}.  This switch in index indicates that the
     967exposure has successfully been copied from the summit to the IPP
     968cluster, and that further processing is no longer dependent on outside
     969resources.
    572970
    573971\subsection{Image Registration}
    574 
    575 Once chips for an exposure have all been downloaded, the exposure is
    576 ready to be registered.  In this context, `registration' refers to the
    577 process of adding them to the database listing of known, raw exposures
    578 (not to be confused with 'registration' in the sense of pixel
    579 re-alignment).  The result of the registration analysis is an entry
    580 for each exposure in the rawExp table, and one for each chip in the
    581 rawImfile table.  These tables are critical for downstream processing
    582 to identify what exposures are available for processing in any other
    583 stage.  In the registration stage, a large amount of descriptive
    584 metadata for each chip is added to the rawImfile table, some of which
    585 is extracted from the chip FITS file headers (e.g., RA, DEC, FILTER)
    586 and some of which is determined by a quick analysis of the pixels
    587 (e.g., mean pixel values, standard deviation).  The chip-level
    588 information is merged into a set of exposure-level metadata and added
    589 to the rawExp table entry.  The exposure-level metadata may be the
    590 same as any one of the chip, in a case where the values are duplicated
    591 across the chip files (e.g., the name of the telescope or the date \&
    592 time of the exposure), or it may be a calculation based on the values
    593 from each chip (e.g., average of the average pixel values).
     972\label{subsec: registration}
     973
     974Once the chips for an exposure have all been downloaded, the exposure
     975is ready to be registered.  In this context, `registration' refers to
     976the process of adding them to the database listing of known, raw
     977exposures (not to be confused with 'registration' in the sense of
     978pixel re-alignment).  The result of the registration analysis is an
     979entry for each exposure in the \ippdbtable{rawExp} table, and one for
     980each chip in the \ippdbtable{rawImfile} table.  These tables are
     981critical for downstream processing to identify what exposures are
     982available for processing in any other stage.  At the registration
     983stage, a large amount of descriptive metadata for each chip is added
     984to the \ippdbtable{rawImfile} table, the majority of which is
     985extracted from the chip FITS file headers (e.g., RA, DEC, FILTER) and
     986some of which is determined by a quick analysis of the pixels (e.g.,
     987mean pixel values, standard deviation).  The chip-level information is
     988merged into a set of exposure-level metadata and added to the
     989\ippdbtable{rawExp} table entry.  The exposure-level metadata may be
     990the same as any one of the chip, in a case where the values are
     991duplicated across the chip files (e.g., the name of the telescope or
     992the date \& time of the exposure), or it may be a calculation based on
     993the values from each chip (e.g., average of the average pixel values).
    594994
    595995Unlike much of the rest of the IPP stage, the raw exposures may only
    596996have a single entry in the registration tables of the processing
    597 database tables (rawExp and rawImfile).
     997database tables (\ippdbtable{rawExp} and \ippdbtable{rawImfile}).
     998
     999For GPC1, the image registration stage is also the stage at which the
     1000\ippprog{burntool} analysis is run.  This analysis is more completely
     1001described in \citet{waters2017}.  In brief, the \ippprog{burntool}
     1002program identifies bright sources on the image, and identifies
     1003persistence trails that result from the incomplete transfer of charge.
     1004As this charge can leak out in subsequent exposures, the burntool
     1005analysis is run sequentially on the exposures, based on the
     1006observation date and time listed in the headers, with the results
     1007stored in an text table.  As a result of the sequential nature of this
     1008analysis, the registration of exposures is blocked until the
     1009\ippprog{burntool} has been run on the previous exposures.
     1010
     1011Once the registration process has finished, new science exposures that
     1012have an \ippdbcolumn{obs\_mode} value that indicates they are part of
     1013a particular science survey are automatically launched into the
     1014science analysis by defining entries for the \ippstage{chip}
     1015processing stage, as described above.  This analysis can be relaunched
     1016multiple times, such as for the large scale PV3 reprocessing.
     1017However, this automatic process ensures the shortest time between
     1018observation and analysis, which is particularly important in the
     1019search for transient sources.
    5981020
    5991021\subsection{Chip Processing}
    600 
    601 The science analysis of an exposure begins with the processing of the
    602 individual chips, the Chip Processing stage.  This analysis step has
    603 two main goals: the removal of the instrumental signature from the
    604 pixel values (detrending) and the detection of the sources in the
    605 objects.  In the Chip stage, the individual chips are processed
    606 independently in parallel within the data processing cluster.  Within
    607 the processing computer cluster, most of the data storage resources
    608 are in the form of computers with large raids as well as substantial
    609 processing capability.  The processing system attempts to locate one
    610 copy of specific raw chips on pre-defined computers for each chip.
    611 The processing system is aware of this data localization and attempts
    612 to target the processing of a particular chip to the machine on which
    613 the data for that chip is stored.  The output products are then
    614 primarily saved back to the same machine.  This `targetted' processing
    615 was an early design choice to minimize the system wide network load
    616 during processing.  In practice, as computer disks filled up at
    617 different rates, the data has not been localized to a very high
    618 degree.  The targeted processing has probably reduced the network load
     1022\label{subsec: chip}
     1023
     1024The science analysis of an exposure begins with the \ippstage{chip}
     1025stage, which operates on the individual OTA image files.  This
     1026analysis step has two main goals: detrending the image to remove the
     1027instrumental signature from the pixel values, and the detection of
     1028astronomical sources in the objects.  Based on the entry the
     1029\ippdbtable{chipRun} primary table defining the processing details
     1030(with the \ippdbcolumn{state} column indicating it needs processing),
     1031and the associated information listed in the \ippdbtable{rawImfile},
     1032jobs can be spawned for each component OTA.  The \ippprog{pantasks}
     1033environment managing the jobs attempts to target the processing host
     1034to one that should host the OTA, to reduce number of operations done
     1035on remote data.  In practice, this targeted processing has not had as
     1036large of an effect as was originally intended, as the data volume has
     1037reduced the ability of any one node to reliably contain a particular
     1038OTA.  The targeted processing has probably reduced the network load
    6191039somewhat but it has not been as critical of a requirement as
    6201040originally expected.
    6211041
    622 The Chip processing stage consists of: reading the raw image into
    623 memory, appyling the detrending steps \citep[see][]{waters2017},
    624 stiching the individual OTA cells into a single chip image, detection
    625 and characterization of the sources in the image
    626 \citep[see][]{magnier2017b}, and output of the various data products.
    627 These include the detrended chip image, variance image, and mask
    628 image, as well as the FITS catalog of detected sources.  The PSF model
    629 and background model are also saved, along with a processing log.  A
     1042%% In the \ippstage{chip} stage,
     1043%% the individual OTA image files are processed independently in parallel
     1044%% within the data processing cluster.  \note{move this to kihei
     1045%%   discussion?} Within the processing computer cluster, most of the
     1046%% data storage resources are in the form of computers with large raids
     1047%% as well as substantial processing capability.  The processing system
     1048%% attempts to locate one copy of specific raw registered data on
     1049%% pre-defined computers that have been set as storage targets for that
     1050%% OTA.  The processing system is aware of this data localization and
     1051%% attempts to target the processing for each OTA to the machine on which
     1052%% the data for that detector is stored.  The output products are then
     1053%% primarily saved back to the same machine.  This `targetted' processing
     1054%% was an early design choice to minimize the system wide network load
     1055%% during processing.  In practice, as computer disks filled up at
     1056%% different rates, the data has not been localized to a very high
     1057%% degree. 
     1058
     1059The actual image processing is performed by the \ippprog{ppImage}
     1060program.  This program reads the raw data into memory and applies the
     1061detrend corrections \citep[see][]{waters2017} to each cell in the OTA
     1062(which are stored as different extensions in the FITS file format),
     1063and then mosaics the cells into a single contiguous \ippstage{chip}
     1064stage image.  This step also creates in memory additional images to
     1065hold the mask data, which indicates which pixels may not be valid, and
     1066the variance image, constructed as the Poissonian noise on the number
     1067of electrons detected based on the original pixel value and the
     1068detector gain.  A background model is then fit across the image and
     1069subtracted to remove the expected contribution from the sky
     1070\citep[see][]{waters2017} for details.
     1071
     1072With the image calibration procedure finished, object identification
     1073and photometry can be performed.  Although this can be done using a
     1074stand alone program, \ippprog{psphot}, the underlying functions are
     1075contained in a library that allows \ippprog{ppImage} to directly do
     1076this analysis, removing the need to write out and re-read the image
     1077data.  The details of the detection and characterization of the
     1078sources in the image are provided in \citet{magnier2017b}. 
     1079
     1080The results of the image processing are then written to disk,
     1081including the science, mask, and variance images, the background model
     1082subtracted, the PSF model used in the photometry process, and a FITS
     1083catalog of detected sources.  Additional binned images of the full OTA
     1084are also saved, providing $16\times{}16$ and $256\times{}256$ pixel
     1085binning scales for quick visualization.  The processing log and a
    6301086selection of summary metadata describing the processing results are
    631 saved and written to the processing database along with the completion
    632 status of the process.  Finally, binned chip images are generated (on
    633 two scales, binned by 16 and 256 pixels) for use in the visualization
    634 system of the processing monitor tool.
     1087also written to disk.  This metadata is used to populate a row in the
     1088\ippdbtable{chipProcessedImfile} table (linked to the
     1089\ippdbtable{chipRun} entry by a shared \ippdbcolumn{chip\_id} value)
     1090to indicate that the processing of this OTA is complete.
     1091
     1092As each OTA is processed independently of the others across a number
     1093of computers, the \ippprog{pantasks} managing the jobs periodically
     1094runs an \ippmisc{advance} task that checks that the number of rows in
     1095\ippdbtable{chipProcessedImfile} with \ippdbcolumn{fault} equal to
     1096zero matches the associated number of rows in \ippdbtable{rawImfile}.
     1097If this condition is met, than all processing for that exposure is
     1098finished, and the \ippdbcolumn{state} field is set to ``full''.  If
     1099the \ippdbtable{chipRun}.\ippdbcolumn{end\_stage} field is set to
     1100\ippstage{chip}, then no further action is taken.  However, this field
     1101is usually set to a subsequent stage (most often \ippstage{warp}),
     1102then an entry for this exposure is added to the \ippdbtable{camRun}
     1103table, and processing continues.
     1104
     1105%% The \ippstage{chip} processing stage consists of: reading the raw image into
     1106%% memory, applying the detrending steps \citep[see][]{waters2017},
     1107%% stiching the individual OTA cells into a single chip image, detection
     1108%% and characterization of the sources in the image
     1109%% \citep[see][]{magnier2017b}, and output of the various data products.
     1110%% These include the detrended chip image, variance image, and mask
     1111%% image, as well as the FITS catalog of detected sources.  The PSF model
     1112%% and background model are also saved, along with a processing log.  A
     1113%% selection of summary metadata describing the processing results are
     1114%% saved and written to the processing database along with the completion
     1115%% status of the process.  Finally, binned chip images are generated (on
     1116%% two scales, binned by 16 and 256 pixels) for use in the visualization
     1117%% system of the processing monitor tool. \note{describe elsewhere?}
     1118
     1119%% The database structure for the \stage{chip} stage mimics that of raw
     1120%% data, with a \ippdbtable{chipRun} characterizing the processing of a
     1121%% single exposure, mapping to a set of \ippdbtable{chipProcessedImfile}
     1122%% entries for each OTA via a common \ippdbcolumn{chip\_id}. 
    6351123
    6361124\subsection{Camera Calibration}
    637 
    638 After sources have been detected and measured for each of the chip,
    639 the next stage is to perform a basic calibration of the full exposure.
    640 This stage starts with the collection of FITS tables containing the
    641 instrumental measurements of the detected sources, primarily the
    642 positions ($x_{\rm ccd}, y_{\rm ccd}$) and the instrumental PSF
    643 magnitudes.  The data for all chips of an exposure are loaded by the
    644 analysis program.  The header information is used to determine the
    645 coordinates of the telescope boresite (RA, DEC, Position angle).
    646 These three coordinates are used, along with a model of the camera
    647 layout, to generate an initial guess for the astrometry of each chip.
    648 Reference star coordinates and magnitudes are loaded from a reference
    649 catalog for a region corresponding to the boundaries of the exposure,
    650 padded by a large fraction of the exposure diameter in case of a
    651 modest pointing error.  The guess astrometry is used to match the
    652 reference catalog to the observed stellar positions in the focal plane
    653 coordinate system.  Once an acceptable match is found, the astrometric
    654 calibration of the individual chips is performed, including a a fit to
    655 a single model for the distortion introduced by the camera optics.
    656 After the astrometic analysis is completed, the photometric
    657 calibration is determined using the final match to the reference
    658 catalog.  At this stage, pre-determined color terms may be included to
    659 convert the reference photometry to an appropriate photometric
    660 system.  For PS1, this is used to generate synthetic w-band photometry
    661 for areas where no PS1-based calibrated w-band photometry is
    662 available.  For more details, see \cite{magnier2017c}.
     1125\label{subsec: camera}
     1126
     1127After sources have been detected and measured for each of the chips,
     1128the next stage is to perform a basic calibration of the full exposure
     1129in the \ippstage{camera} stage.  This runs as a single job for the
     1130entire exposure, passing the collection of FITS table catalogs
     1131generated from each OTA in the \ippstage{chip} stage to the
     1132\ippprog{psastro} program.  Although the full catalog is loaded, the
     1133calibration primarily concerns the positions ($x_{\rm ccd}, y_{\rm
     1134  ccd}$) and the instrumental PSF magnitudes.  The header information
     1135in these catalogs is used to determine the coordinates of the
     1136telescope boresite (RA, DEC, position angle).  These three coordinates
     1137are used, along with a pre-determined model of the OTA layout within
     1138the camera, to generate an initial guess for the astrometry of each
     1139chip.  Reference star coordinates and magnitudes are loaded from a
     1140reference catalog for a region corresponding to the boundaries of the
     1141exposure, padded by a large fraction (25\%) of the exposure diameter
     1142to help guarantee a solution in the case of a modest pointing error.
     1143The guess astrometry is used to match the reference catalog to the
     1144observed stellar positions in the focal plane coordinate system.  Once
     1145an acceptable match is found, the astrometric calibration of the
     1146individual chips is performed, including a fit to a single model for
     1147the distortion introduced by the camera optics.  After the astrometic
     1148analysis is completed, the photometric calibration is determined using
     1149the final match to the reference catalog.  At this stage,
     1150pre-determined color terms may be included to convert the reference
     1151photometry to an appropriate photometric system.  For PS1, this is
     1152used to generate synthetic w-band photometry for areas where no
     1153PS1-based calibrated w-band photometry is available.  For more
     1154details, see \cite{magnier2017c}.  The result of these calibrations is
     1155stored as a single multi-extension FITS table containing the results
     1156from each OTA as a separate extension.
    6631157
    6641158In addition to the astrometric and photometric calibrations, the
    665 Camera stage also generates the dynamic masks for the images.  The dynamic
    666 masks include masking for optical ghosts, glints, saturated stars,
    667 diffraction spikes, and electronic crosstalk.  The mask images
    668 generated by the Chip stage are updated with these dynamic masks and a
    669 new set of files are saved for the downstream analysis stages.
    670 
    671 The Camera stage also merges the binned chip images
    672 (see~\ref{sec:chip}) into single jpeg images of the entire focal
    673 plane.  These jpeg images can then be displayed by the process
     1159\ippstage{camera} stage also generates the dynamic masks for the
     1160images.  These include masking for optical ghosts, glints, saturated
     1161stars, diffraction spikes, and electronic crosstalk.  The mask images
     1162generated by the \ippstage{chip} stage are updated with these dynamic
     1163masks and a new set of files are saved for the downstream analysis
     1164stages.  The \ippstage{camera} stage also merges the binned chip
     1165images (see~\ref{sec:chip}) into single jpeg images of the entire
     1166focal plane.  These jpeg images can then be displayed by the process
    6741167monitoring system to visualize the data processing.
    6751168
    676 \subsection{Warp}
    677 
    678 Once astrometric and photometric calibrations have been performed,
    679 images are geometrically transformed into a set of common pixel-grid
    680 images with simple projections from the sky.  These images, called
    681 skycells, can then be used in subsequent stacking and difference image
    682 analysis without concern about the astrometric transformation of an
    683 exposure.  This processing is called `warping'; the warp analysis
    684 stage is run on all exposures before they are processed further.  For
    685 details on the warping algorithm, see \cite{waters2017}.
    686 
    687 The output products from the Warp stage consist of the skycell images
    688 containing the signal, the variance, and the mask information.  These
    689 images have been shipped to STScI and \note{are available / will be
    690   available} from the image extraction tools \note{in DR2}.
    691 
    692 \subsection{Stack}
    693 
    694 The skycell images generated by the Warp process are added together to
    695 make deeper, higher signal-to-noise images in the Stack stage.  The
    696 stacks also fill in coverage gaps between different exposures,
    697 resulting in an image of the sky with more uniform coverage than a
    698 single exposure.  See~\cite{waters2017} for details on the stack
    699 combination algorithm.
     1169Again, summary metadata is saved to disk as well, and the results
     1170listed therein are used to populate a row in the
     1171\ippdbtable{camProcessedExp} database table.  As the full exposure is
     1172processed all at once, this update also updates the associated
     1173\ippdbtable{camRun} entry, linked by the \ippdbcolumn{cam\_id}.  As
     1174with the \ippstage{chip} stage, the
     1175\ippdbtable{camRun}.\ippdbcolumn{end\_stage} is for a subsequent
     1176stage, an appropriate entry is added to the \ippdbtable{fakeRun}
     1177table.
     1178
     1179\subsection{Fake Analysis}
     1180\label{subsec: fake}
     1181
     1182The \ippstage{fake} stage was originally designed to do false source
     1183injection and recovery, in order to determine the detection efficiency
     1184of sources on the exposure.  However, early in the design of the IPP,
     1185this task was moved to the rest of the photometry analysis done at the
     1186\ippstage{chip} stage.  Removing the stage would require significant
     1187changes to the database schema.  As a result, this conveniently named
     1188stage generally does no actual data processing, and consists mainly of
     1189database operations to move the exposure on to the \ippstage{warp}
     1190stage.  The operations mimic the \ippstage{chip} stage, with
     1191individual jobs run for each OTA that update rows in the
     1192\ippdbtable{fakeProcessedImfile}, and an \ippmisc{advance} task that
     1193updates the \ippdbtable{fakeRun} table and promotes the exposure to
     1194the next stage by adding a row to the \ippdbtable{warpRun} table.
     1195
     1196\subsection{Image Warping}
     1197\label{subsec: warp}
     1198
     1199The \ippstage{warp} stage moves the data from a given exposure beyond
     1200away from being camera specific and towards a uniform sky oriented
     1201arrangement.  There are a number of ``tessellations'' defined and used
     1202by the IPP to define the extent and scaling of images on this uniform
     1203arrangement.  A tessellation can be defined for a limited region, such
     1204as M31 or other fields of particular interest that can be well
     1205described by a single tangent plane projection, or for larger regions
     1206which have multiple projection centers.  For the $3\Pi$ survey, the
     1207\ippmisc{RINGS.V3} tessellation was used that used projection centers
     1208spaced every four degrees in both RA and DEC, with $0\farcs{}25$
     1209pixels.  These projections are further broken down into ``skycells''
     1210that form a $10\times{}10$ grid within the projection, with an overlap
     1211region of 60" between adjacent skycells to ensure that objects are not
     1212split on all images.
     1213
     1214These tessellations are stored in the DVO format, with
     1215\ippdbtable{SkyTable} entries defining the projection centers and
     1216image boundaries for all the skycells.  The first step of the
     1217\ippstage{warp} stage is determining which skycells overlap with the
     1218input exposure.  These overlaps are determined by the
     1219\ippprog{dvoImageOverlaps} program, which compares the astrometrically
     1220calibrated catalog from the \ippstage{camera} stage to the
     1221\ippdbtable{SkyTable} entries.  The output of this command is used to
     1222populate the \ippdbtable{warpSkyCellMap} table in the database, which
     1223contains a row for each skycell and OTA that overlap.  This results in
     1224more rows than there are OTAs, as each skycell can contain
     1225contributions from multiple OTAs.
     1226
     1227Once this mapping has been defined, jobs to construct each skycell are
     1228run, passing the \ippstage{camera} stage catalog and the
     1229\ippstage{chip} stage images (including the variance images and the
     1230updated masks) to the \ippprog{pswarp} program.  For details on the
     1231warping algorithm, see \cite{waters2017}.  The output of this program
     1232are the geometrically transformed images containing all input pixels
     1233warped to the common skycell pixel grid, which can subsequently be
     1234used for stacking and difference image analysis.  The image, mask, and
     1235variance generated at this stage will be available from the image
     1236extraction tools at the MAST archive at STScI as part of the DR2 data
     1237release.  A catalog is also generated containing the locations of
     1238sources from the input catalog that fall within area of the
     1239\ippstage{warp}.
     1240
     1241When the jobs have completed, an entry for the skycell is added to the
     1242\ippdbtable{warpSkyfile} database table, linked to the
     1243\ippdbtable{warpRun} entry by a common \ippdbcolumn{warp\_id}.  An
     1244\ippmisc{advance} task again checks that all potential skycells have
     1245been generated.  At this point, the direct promotion of exposures from
     1246one stage to the next stops, as the logic for matching exposures for
     1247combination is more complicated than simply adding a single entry (as
     1248discussed above).
     1249
     1250\subsection{Stack Combination}
     1251\label{subsec: stack}
     1252
     1253The skycell images generated by the \ippstage{warp} process are added
     1254together to make deeper, higher signal-to-noise images in the
     1255\ippstage{stack} stage.  These stacked images also fill in coverage
     1256gaps between different exposures, resulting in an image of the sky
     1257with more uniform coverage than a single exposure.
    7001258
    7011259In the IPP processing, stacks may be made with various options for the
     
    7031261filter for each Medium Deep field are combined into a set of stacks
    7041262for that field.  These so-called `nightly stacks' are used by the
    705 transient survey projects to detect the faint supernovae, among other
    706 transient events.  For the PV3 $3\pi$ analysis, all filter images from
    707 the $3\pi$ survey observation were stacked together to generate a
    708 single set of images with $\sim 10 - 20\times$ the exposure of the
    709 individual survey exposures.  The signal, variance, and mask images
    710 resulting from these deep stacks are part of the DR1 release and are
    711 available from the image extraction tools.
     1263transient survey projects to detect faint supernovae, among other
     1264transient events.  For the PV3 $3\pi$ analysis, all images in each
     1265filter from the observations for this survey were stacked together to
     1266generate a single set of images with $\sim 10 - 20\times$ the exposure
     1267of the individual survey exposures. 
    7121268
    7131269For the PV3 processing of the Medium Deep fields, stacks have been
    7141270generated for the nightly groups and for the full depth using all
    715 exposures (deep stacks).  In addition, a 'best seeing' set of stack
    716 have been produced \note{using image quality cuts to be described}.
    717 We have also generated out-of-season stacks for the Medium Deep
    718 fields, in which all image not from a particular observing season for
    719 a field are combined into a stack.  These later stacks are useful as
    720 deep templates when studying long-term transient events in the Medium
    721 Deep fields as they are not (or less) contaminated by the flux of the
    722 transients from a given season.
     1271exposures, producing ``deep stacks''.  In addition, a 'best seeing'
     1272set of stacks have been produced \note{using image quality cuts to be
     1273  described}.  We have also generated out-of-season stacks for the
     1274Medium Deep fields, in which all image not from a particular observing
     1275season for a field are combined into a stack.  These later stacks are
     1276useful as deep templates when studying long-term transient events in
     1277the Medium Deep fields as they are not (or less) contaminated by the
     1278flux of the transients from a given season.
     1279
     1280When a given set of \ippstage{stack} stage are defined, exposures with
     1281existing \ippstage{warp} entries that match the filter, position, and
     1282other criteria such as seeing are grouped by their skycell.  An entry
     1283is then added for each skycell in the \ippdbtable{stackRun} table,
     1284with the \ippdbcolumn{warp\_id} entries for the exposures added to the
     1285\ippdbtable{stackInputSkyfile} table, linked to the
     1286\ippdbtable{stackRun} entry by the \ippdbcolumn{stack\_id} field.
     1287This defines the mapping for which exposures contribute to the
     1288\ippstage{stack}.  This breaks exposures into single skycells, but as
     1289adjacent \ippstage{stack} skycells may contain inputs from different
     1290exposures, there is no simple way to group the processing at the
     1291\ippstage{stack} stage into exposures.
     1292
     1293The \ippstage{stack} jobs pass the information about the input images
     1294and catalogs to the \ippprog{ppStack} program, which performs the
     1295image combinations.  See~\cite{waters2017} for details on the stack
     1296combination algorithm.  In addition to the standard image, mask, and
     1297variance produced at other stage, additional images are constructed
     1298with information about the contributions to each pixel.  A number
     1299image contains the number of input exposures used for each pixel,
     1300along with an exposure time map, and a weighted exposure time map that
     1301scales the exposure time based on the relative variance of each input.
     1302These images for the $3\Pi$ analysis are currently available from the
     1303MAST image extraction tools at STSci.
     1304
     1305Upon completing the generation of these images, a row is added to the
     1306\ippdbtable{stackSumSkyfile} table with statistics about
     1307\ippstage{stack} processing.  As this completes all processing for the
     1308entry, no \ippmisc{advance} job is required.
    7231309
    7241310\subsection{Stack Photometry}
    725 
    726 The stack images are generated in the Stack stage of the IPP, but the
    727 source detection and extraction analysis of those images is deferred
    728 until a separate stage, the Stack Photometry stage.  This separation
    729 is maintained because the stack photometry analysis is performed on
    730 all 5 filter stack images at the same time.  By deferring the
    731 analysis, the processing system may decouple the generation of the
    732 pixels from the source detection.  This makes the sequencing of
     1311\label{subsec: staticsky}
     1312
     1313Although images are generated in the \ippstage{stack} stage of the
     1314IPP, the source detection and extraction analysis of those images is
     1315deferred to the \ippstage{staticsky} stage.  This separation is
     1316maintained because the photometry analysis of the \ippstage{stack}
     1317images is performed on all 5 filters simultaneously.  By deferring
     1318this analysis, the processing system may also decouple the generation
     1319of the pixels from the source detection.  This makes the sequencing of
    7331320analysis somewhat easier and less subject to blocks due to a failure
    734 in the stacking analysis.
    735 
    736 The stack photometry algorithms are described in detail in
    737 \cite{magnier2017b}.  In short, sources are detected in all 5 filter
    738 images down to the $5\sigma$ significance.  The collection of detected
    739 sources is merged into a single master list.  If a source is detected
    740 in at least two bands, or only in $y$-band, then a PSF model is fitted
    741 to the pixels of the other bands in which the source was not detected.
    742 This forced photometry results in lower significance measurements of
    743 the flux at the positions of objects which are thought to be real
    744 sources, by virtue of triggering a detection in at least two bands.
    745 The relaxed limit for $y$-band is included to allow for searches of
    746 $y$-dropout objects: it is known that faint, high-redshift quasars may
    747 be detected in $y$-band only.  The casual user of the PV3 dataset
    748 should be wary of sources detected only in $y$-band as these are
    749 likely to have a higher false-positive rate than the other stack
    750 sources.
    751 
    752 The stack photometry output files consist of a set of FITS tables in a
    753 single file, with one file for each filter.  Within one of these
    754 files, the tables include: the measurements of sources based on the
    755 PSF model; aperture like parameters such as the Petrosian flux and
    756 radius; the convolved Galaxy model fits; the radial aperture
    757 measurements.  \note{is this list complete?}
     1321in the stacking analysis.  Similar to the \ippstage{stack} stage, an
     1322entry is created in the \ippdbtable{staticskyRun} table, linked to a
     1323series of rows in the \ippdbtable{staticskyInput} table by a common
     1324\ippdbcolumn{sky\_id}, each of which also contains the appropriate
     1325\ippdbcolumn{stack\_id} entries for the skycell under consideration.
     1326
     1327The input images are passed to the \ippprog{psphotStack} program,
     1328which does the analysis.  The stack photometry algorithms are
     1329described in detail in \cite{magnier2017b}.  In short, sources are
     1330detected in all 5 filter images down to the $5\sigma$ significance.
     1331The collection of detected sources is merged into a single master
     1332list.  If a source is detected in at least two bands, or only in
     1333\yps{} band, then a PSF model is fitted to the pixels of the other
     1334bands in which the source was not detected.  This forced photometry
     1335results in lower significance measurements of the flux at the
     1336positions of objects which are thought to be real sources, by virtue
     1337of triggering a detection in at least two bands.  The relaxed limit
     1338for \yps{} band is included to allow for searches of \yps{} dropout
     1339objects: it is known that faint, high-redshift quasars may be detected
     1340in \yps{} band only.  Sources detected only in \yps{} band are
     1341therefore more likely to have a higher false-positive rate than the
     1342other stack sources.
     1343
     1344The stack photometry output files consist of a set of FITS table
     1345catalogs, with one file for each filter.  Within these files, there
     1346are multiple table extensions that include: the measurements of
     1347sources based on the PSF model; aperture like parameters such as the
     1348Petrosian flux and radius; the convolved galaxy model fits; and the
     1349radial aperture measurements.  \note{is this list complete?}  Once the
     1350photometry is complete, a row is added to the
     1351\ippdbtable{staticskyResult} table with basic statistics from the
     1352analysis.
    7581353
    7591354The stack photometry output catalogs are re-calibrated for both
    760 photometry and astrometry in a process very similar to the Camera
    761 calibration stage.  In the case of the stack calibration, however,
    762 each skycell is processed independently.  The same reference catalog
    763 is used for the Camera and Stack calibration stages.
     1355photometry and astrometry in a process very similar to the
     1356\ippstage{camera} calibration stage.  In the case of this
     1357\ippstage{skycal} stage, each skycell is processed independently.
     1358Because of this independence, when queued for processing, the entries
     1359in the \ippdbtable{skycalRun} table contain the \ippdbcolumn{sky\_id}
     1360and \ippdbcolumn{stack\_id} entries of the parent data directly.  As
     1361in the \ippstage{camera} stage, the \ippprog{psastro} program reads in
     1362the stack photometry catalog, and produces a calibrated output.  A
     1363different processing recipe is supplied to \ippprog{psastro}, which
     1364controls for the different data.  The same reference catalog is used
     1365for the \ippstage{camera} and \ippstage{stack} calibration stages.
     1366Upon completion, the analysis statistics are written to the
     1367\ippdbtable{skycalResult} table. \note{Any difference in output formats?}
    7641368
    7651369\subsection{Forced Warp Photometry}
     1370\label{subsec: fullforce}
    7661371
    7671372Traditionally, projects which use multiple exposures to increase the
    7681373depth and sensitivity of the observations have generated something
    769 equivalent to the stack images produced by the IPP analysis.  In
    770 theory, the photometry of the stack images produces the `best'
    771 photometry catalog, with best sensitivity and the best data quality at
    772 all magnitudes (c.f, CFHT Legacy survey, COSMOS, etc).  In practice,
    773 the stack images have some significant limitations due to the
    774 difficulty of modelling the PSF variations.  This difficulty is
    775 particularly severe for the Pan-STARRS $3\pi$ survey stacks due to the
    776 combination of the substantial mask fraction of the individual
    777 exposures, the large instrinsic image quality variations within a
    778 single exposure, and the wide range of image quality conditions under
    779 which data were obtained and used to generate the $3\pi$ PV3 stacks.
     1374equivalent to the stack images produced by the IPP analysis (c.f, CFHT
     1375Legacy survey, COSMOS, etc).  In theory, the photometry of the stack
     1376images produces the `best' photometry catalog, with best sensitivity
     1377and the best data quality at all magnitudes.  In practice, the stack
     1378images have some significant limitations due to the difficulty of
     1379modelling the PSF variations.  This difficulty is particularly severe
     1380for the Pan-STARRS $3\pi$ survey stacks due to the combination of the
     1381substantial mask fraction of the individual exposures, the large
     1382instrinsic image quality variations within a single exposure, and the
     1383wide range of image quality conditions under which data were obtained
     1384and used to generate the $3\pi$ PV3 stacks.
    7801385
    7811386For any specific stack, the point spread function at a particular
     
    7901395location.  In the end, the stack images have a effective point spread
    7911396function which is not just variable, but changing significantly on
    792 small scales in a highly textured fashion. 
     1397small scales in a highly textured fashion.  \note{duplicates previous paragraph?}
    7931398
    7941399Any measurement which relies on a good knowledge of the PSF at the
     
    7961401present in the stack, or the measurement will be somewhat degraded.
    7971402The highly textured PSF variations make this a very challenging
    798 problem: not would such a PSF model require an unusually fine-grained
     1403problem: not only would such a PSF model require an unusually fine-grained
    7991404PSF model, there would likely not be enough PSF stars in an given
    8001405stack to determine the model at the resolution required.  The IPP
     
    8051410changes apparent in the stack images.
    8061411
    807 Thus PSF photometry as well as convolved Galaxy models in the stack
     1412Thus PSF photometry as well as convolved galaxy models in the stack
    8081413are degraded by the PSF variations.  Aperture-like measurements are in
    8091414general not as affected by the PSF variations, as long as the aperture
     
    8151420
    8161421The PV3 $3\pi$ analysis solves this problem by using the sources
    817 detected in the Stack images and performing forced photometry on the
     1422detected in the stack images and performing forced photometry on the
    8181423individual warp images used to generate the stack.  This analysis is
    8191424performed on all warps for a single filter as a single job, though
    820 this is more of a bookkeepping aid as it is not necessary for the
     1425this is more of a bookkeeping aid as it is not necessary for the
    8211426analysis of the different warps to know about the results of the other
    8221427warps.
     
    8361441measurement as the signal-to-noise increases by $\sqrt{N}$. 
    8371442
    838 \subsection{Forced Galaxy Models}
     1443\subsubsection{Forced Galaxy Models}
    8391444
    8401445The convolved galaxy models are also re-measured on the warp images by
     
    8551460(and thus the best galaxy magnitude value).
    8561461
    857 For each warp image, the Stack value for the major and minor axis are
     1462For each warp image, the stack value for the major and minor axis are
    8581463used as the center of a $7\times 7$ grid search of the major and minor
    8591464axis parameter values.  The grid spacing is defined as a function of
     
    8901495
    8911496\subsection{Difference Images}
    892 
     1497\label{subsec: diff}
    8931498Two of the primary science drivers for the Pan-STARRS system are the
    8941499search hazardous asteroids and the search for Type Ia supernovae to
     
    9041509images are matched.  \note{discuss Alard-Lupton}.
    9051510
    906 In the Difference Image stage, the IPP generates diffferece images for
    907 specified pairs of images.  It is possible for the difference image to
     1511In the \ippstage{diff} stage, the IPP generates diffferece images for
     1512appropriately specified pairs of images.  It is possible for the difference image to
    9081513be generated from a pair of warp images, from a warp and a stack of
    9091514some variety, or from a pair of stacks.  During the PS1 survey, pairs
     
    9181523for these fields each night. 
    9191524
    920 For the PV3 processing, the entire collection of warps for the $3\pi$
     1525For the PV3 $3\Pi$ processing, the entire collection of warps for the
    9211526survey were combined with the $3\pi$ stacks to generate `warp-stack
    9221527diffs'. 
    9231528
    9241529\subsection{Addstar : DVO Ingest}
     1530\label{subsec: addstar}
    9251531
    9261532\subsection{Calibration Operations}
     1533\label{subsec: calibration}
    9271534
    9281535\subsection{IPP to PSPS}
     1536\label{subsec: ipp2psps}
     1537\note{Default to pointing to Flewelling et al 2017?}
    9291538
    9301539\subsection{PSPS Load \& Merge}
     1540\label{subsec: psps}
     1541\note{Default as well to pointing to Flewelling et al 2017?}
    9311542
    9321543\section{IPP Hardware Systems}
     1544\label{sec: hardware}
     1545
    9331546
    9341547\subsection{Kihei Processing Cluster}
     1548\label{subsec: kihei}
     1549
     1550The majority of all Pan-STARRS processing has been performed on the
     1551dedicated IPP cluster, located in Kihei on Maui.  This cluster was
     1552originally located at the Maui High Performance Computing Center
     1553(MHPCC), a United States Air Force research laboratory center managed
     1554by the University of Hawaii.  This site was chosen based on the
     1555original development funding provided by the Air Force Research Labs
     1556\citep[see][for more details]{chambers2017}.  Once the Air Force
     1557funding stopped being a significant driver for Pan-STARRS, the cluster was
     1558physically moved from the MHPCC to a similar nearby computing center
     1559located at the Maui Research and Technology Center.
     1560
     1561The computing cluster is comprised of three main types of computers,
     1562with a variety of individual specifications due to the cluster being
     1563assembled from multiple generations of purchases.  The data storage
     1564nodes contain \note{check, as this contains B nodes} approximately 10
     1565petabytes of storage space that are used to store both the raw
     1566exposure data downloaded from the telescope as well as processed data
     1567products.  These nodes are also used to do processing, and have jobs
     1568targeted to them in an effort to reduce the network I/O demands
     1569(see~\ref{chip section} for more on this process).
     1570
     1571These storage nodes are not fully capable of completing all processing
     1572on the short timescale necessary for each night's worth of data.  To
     1573increase the processing capability, we have a large number
     1574\note{actual number?} of ``compute'' nodes, that have small amounts of
     1575local storage, but are able to add processing power.  In addition to
     1576the direct processing of image data, these nodes are also used to
     1577manage the \ippprog{Nebulous} file interface, as well as controlling
     1578the job scheduling for the processing.
     1579
     1580The final type of computer in the cluster are the database servers.
     1581These special purpose computers \note{have lots of memory and disk
     1582  space?  Is that it?} are used to store and manage both the IPP gpc1
     1583and \ippprog{Nebulous} databases.  In addition to the main master
     1584servers, we have duplicate servers used as database replicants, which
     1585allow for quick switching from the main to backup servers in case of a
     1586hardware issue that cannot be resolved immediately.
    9351587
    9361588\subsection{Los Alamos National Labs}
     1589\label{subsec: LANL}
    9371590
    9381591In order to increase the processing rate for the $3\Pi$ PV3 data, we
     
    10361689
    10371690\subsection{UH Cray Cluster}
     1691\label{subsec: UH Cray}
    10381692
    10391693In December 2014, the University of Hawaii installed a 178-compute
     
    10601714994,890 runs processed there.
    10611715
     1716\section{Discussion}
     1717\label{sec: discussion}
    10621718
    10631719\acknowledgments
     
    10831739\input{datasystem.bbl}
    10841740
     1741\appendix
     1742
     1743\section{GPC1 Database Schema Outline}
     1744\label{sec: database schema}
     1745
     1746Table \ref{tab: database schema} provides a list of a majority of the
     1747tables in the GPC1 database schema.  Tables that have been excluded
     1748are either no longer used in IPP processing, or are used for rare
     1749reductions that were not used for the PV3 data release.  The tables
     1750are grouped into stages, with the primary table and any secondary
     1751tables for that stage listed together, along with the primary key
     1752column that link the tables together.
     1753
     1754\begin{center}
     1755\begin{deluxetable}{lllll}
     1756  \tablecolumns{5}
     1757  \tablewidth{0pc}
     1758  \tablecaption{GPC1 Database Schema Outline}
     1759  \tablehead{\colhead{Stage} & \colhead{Primary Table} & \colhead{Secondary Table} & \colhead{Key} & \colhead{Notes}}
     1760  \startdata
     1761  \ippstage{addstar}      & \ippdbtable{addRun}       & \ippdbtable{addProcessedExp}     & \ippdbcolumn{add\_id} & \\
     1762  \ippstage{camera}       & \ippdbtable{camRun}       & \ippdbtable{camProcessedExp}     & \ippdbcolumn{cam\_id} & \\
     1763  \ippstage{chip}         & \ippdbtable{chipRun}      & \ippdbtable{chipProcessedImfile} & \ippdbcolumn{chip\_id} & \\
     1764  \ippstage{detrend}      & \ippdbtable{detRun}       & \ippdbtable{detRunSummary}       & \ippdbcolumn{det\_id} & \\
     1765                          &                           & \ippdbtable{detInputExp}         & & \\
     1766                          &                           & \ippdbtable{detRegisteredImfile} & & Information about detrends produced externally.\\
     1767                          &                           & \ippdbtable{detStackedImfile}    & & \\
     1768                          & \ippdbtable{detProcessedExp} & \ippdbtable{detProcessedImfile}  & & \\
     1769                          & \ippdbtable{detResidExp}  & \ippdbtable{detResidImfile}      & & \\
     1770                          & \ippdbtable{detNormalizedExp} & \ippdbtable{detNormalizedImfile} & & \\
     1771  \ippstage{diff}         & \ippdbtable{diffRun}      & \ippdbtable{diffSkyfile}         & \ippdbcolumn{diff\_id} & \\
     1772                          &                           & \ippdbtable{diffInputSkyfile}    & & \\
     1773  \ippstage{distribution} & \ippdbtable{distRun}      & \ippdbtable{distComponent}       & \ippdbcolumn{dist\_id} & \\
     1774                          &                           & \ippdbtable{distTarget}          & & \\
     1775  \ippstage{fake}         & \ippdbtable{fakeRun}      & \ippdbtable{fakeProcessedImfile} & \ippdbcolumn{fake\_id} & \\
     1776  \ippstage{fullforce}    & \ippdbtable{fullForceRun} & \ippdbtable{fullForceInput}      & \ippdbcolumn{ff\_id} & \\
     1777                          &                           & \ippdbtable{fullForceResult}     & & \\
     1778                          &                           & \ippdbtable{fullForceSummary}    & & Properties about average parameters from all results.\\
     1779  \ippstage{lap}          & \ippdbtable{lapSequence}  & \ippdbtable{lapRun}              & \ippdbcolumn{seq\_id} & Sequence of full reprocessing\\
     1780                          & \ippdbtable{lapRun}       & \ippdbtable{lapExp}              & \ippdbcolumn{lap\_id} & \\
     1781  \ippstage{publish}      & \ippdbtable{publishRun}   & \ippdbtable{publishDone}         & \ippdbcolumn{pub\_id} & \\
     1782                          &                           & \ippdbtable{publishClient}       & & \\
     1783  \ippstage{summitcopy}   & \ippdbtable{pzDataStore}  &                                  & & Lists locations to check for new exposures.\\
     1784                          & \ippdbtable{summitExp}    & \ippdbtable{summitImfile}        & \ippdbcolumn{summit\_id} & Exposures available at the telescope.\\
     1785                          & \ippdbtable{pzDownloadExp}& \ippdbtable{pzDownloadImfile}    & & Exposures that are being downloaded.\\
     1786                          & \ippdbtable{newExp}       & \ippdbtable{newImfile}           & \ippdbcolumn{exp\_id} & Exposures that have been saved to IPP cluster.\\
     1787
     1788  \ippstage{registration} & \ippdbtable{rawExp}       & \ippdbtable{rawImfile}           & \ippdbcolumn{exp\_id} & \\
     1789  \ippstage{remote}       & \ippdbtable{remoteRun}    & \ippdbtable{remoteComponent}     & \ippdbcolumn{remote\_id} & \\
     1790  \ippstage{skycal}       & \ippdbtable{skycalRun}    & \ippdbtable{skycalResult}        & \ippdbcolumn{skycal\_id} & \\
     1791  \ippstage{stack}        & \ippdbtable{stackRun}     & \ippdbtable{stackInputSkyfile}   & \ippdbcolumn{stack\_id} & \\
     1792                          &                           & \ippdbtable{stackSumSkyfile}     & & \\
     1793  \ippstage{staticsky}    & \ippdbtable{staticskyRun} & \ippdbtable{staticskyInput}      & \ippdbcolumn{sky\_id} & \\
     1794                          &                           & \ippdbtable{staticskyResult}     & & \\
     1795  \ippstage{warp}         & \ippdbtable{warpRun}      & \ippdbtable{warpImfile}          & \ippdbcolumn{warp\_id} & \\
     1796                          &                           & \ippdbtable{warpSkyCellMap}      & & Mapping of input chips to projection skycells.\\
     1797                          &                           & \ippdbtable{warpSkyfile}         & & \\
     1798  \enddata
     1799  \label{tab: database schema}
     1800\end{deluxetable}
     1801\end{center}
     1802 
    10851803
    10861804\end{document}
Note: See TracChangeset for help on using the changeset viewer.