IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6023


Ignore:
Timestamp:
Jan 16, 2006, 10:04:01 PM (21 years ago)
Author:
eugene
Message:

updated the text and figures

Location:
trunk/doc/ipptools
Files:
4 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/ipptools/ipptools.tex

    r6016 r6023  
    11\documentclass[panstarrs,spec]{panstarrs}
    22
    3 \title{PanTasks \& the IPP Analysis Stages}
     3\title{IPPTools, PanTasks \& the IPP Analysis Stages}
    44\subtitle{Job Relationships and Data Flow}
    55\author{Eugene Magnier}
     
    117117processing cluster.
    118118
    119 \section{Persistent vs Ephemeral State in Pantasks}
     119\section{Persistent vs Ephemeral State in PanTasks}
    120120
    121121\begin{figure}
    122122\begin{center}
    123123\includegraphics[scale=0.85]{pics/pantasks.01.ps}
    124 \caption{\label{queues} Pantask queues and MDDB tables}
     124\caption{\label{queues} PanTasks queues and MDDB tables}
    125125\end{center}
    126126\end{figure}
     
    213213image file has been copied.)
    214214
    215 In the rest of this document, the use of Pantask internal queues to
     215In the rest of this document, the use of PanTasks internal queues to
    216216manage the temporary data states is glossed over and assumed part of
    217217the tasks defined in the process.
     218
     219\section{IPP Pipelines Overview}
     220
     221The IPP as a whole performs all of the image analysis functions
     222required by the Pan-STARRS telescopes, including images from the full
     223Gigapixel camera (or cameras), the test camera TC-3, and the SkyProbe
     224camera.  The IPP is designed to be very flexible, with instrument
     225specific details isolated in configuration files associated with the
     226different cameras known to the system.  As a result, the organization
     227of the top level analysis infrastructure must be sufficiently general
     228that a wide range of cameras can be accomodated.  We have a few
     229general principles regarding constraints on the data to be processed
     230which are used to guide the IPP design and developement:
     231
     232\begin{itemize}
     233\item {\bf Camera Focal Plane Hierarchy} The IPP analysis programs
     234  assume that the images to be processed are obtained by a camera
     235  which can be represented by our Camera Focal-Plane Hierarchy of data
     236  structures.  This hierarchy is discussed in detail in the Modules
     237  SDRS, and defines a top-level {\em Focal-Plane Array (FPA)}, which
     238  may contain 1 or more {\em Chips}, each of which may contain one or
     239  more {\em Cells}.  An {\em FPA} is identified as having a single
     240  optical system feeding photons to the detectors.  A {\em Chip} is
     241  identified as a unit of data all deriving from a single detector
     242  (piece of silicon), while a {\em Cell} is identified as a collection
     243  of pixels read out as a continuous cartesian grid.  Finally, a
     244  single collection of data from an {\em FPA} may include multiple
     245  {\em Readouts} from any or all of the {\em Cells}. 
     246
     247\item {\bf Exposures vs Groups} The processing presumes that the data
     248  is organized into {\em exposures} and exposure {\em groups}.  An
     249  exposure represents the data from a single FPA, with the possible
     250  subdivision of the exposure into multiple readouts for some or all
     251  of the cells.  Exposure {\em Groups} are any group of exposures
     252  which are related together in some way; the definition of the {\em
     253  Groups} may be provided by the observers, or they may be derived
     254  from the characteristics of the exposures.  The use of a particular
     255  {\em group} depends on the context of that group.  A few examples of
     256  exposure groups:
     257
     258  \begin{itemize}
     259  \item a dithered sequence of exposures to be stacked for cosmetics
     260  and improved signal-to-noise.
     261  \item a twilight flat-field sequence.
     262  \item all images of the same filter within a 10 degree region to be
     263  used to construct an sample astrometric reference. 
     264  \end{itemize}
     265
     266\item {\bf Image Files (imfiles) vs Exposures}  Any single exposure
     267  may consist of a number of different data files.  The number of {\em
     268  imfiles} for a given exposure will depend on the camera, as will the
     269  data organization within those image files.  Also, a particular
     270  camera will supply files corresponding to one of the particular
     271  Focal-Plane Hierarchy elements.  The IPP analysis must be able to
     272  interpret the incoming data correctly.
     273\end{itemize}
     274
     275As discussed elsewhere, there are several major types of analysis
     276performed by the IPP.  For the purposes of data organization and
     277parallel processing efficiencies, we have identified the following
     278divisions of the analysis tasks.  These will be discuss in much more
     279detail below.
     280
     281\begin{itemize}
     282\item {\bf Science Image Analysis} : This represents the analysis
     283  performed on the images obtained by the telescope, and generally
     284  performed in real-time, night-by-night.  The science image analysis
     285  tasks are further subdivided as follows:
     286
     287  \begin{itemize}
     288  \item {\bf Phase 1} : The full focal-plane array is examined quickly
     289  to determine an initial astrometric calibration.  In this step, the
     290  OTA guide stars may be used as the astrometric reference; if none
     291  are available, predicted bright star positions are examined.  This
     292  step is only used for mosaic images, and may be skipped if no guide
     293  stars are available {\em and} the astrometric calibration for the
     294  telescope / camera is reliable (better than 10 arcseconds).
     295
     296  \item {\bf Phase 2} : Each image file is analysed independently: the
     297  image is detrended (bias, dark, flat, fringe, etc), sources are then
     298  detected to a modest level, improved astrometric calibration is
     299  performed.
     300
     301  \item {\bf Phase 3} : The collection of sources measured from all of
     302  the image files for the camera are used to determine a global
     303  astrometric, and possibly photometric, solution for the exposure.
     304  This step is only required for mosaic cameras.
     305
     306  \item {\bf Phase 4.1} : An exposure group consisting of images
     307  obtained in a specific region of the sky are merged together.  In
     308  this step, the images are first warped to a common pixel grid, defined by
     309  the static sky images.  The collection of images are then used to
     310  construct a single, cleaned image by rejecting the outliers from the
     311  source images in the stack.  The corresponding static sky pixels are
     312  then used to construct a difference image from the resulting stack.
     313
     314  \item {\bf Magic} : In this step, the difference images are examined
     315  to find the trailed images introduced by artificial satelites.
     316  These so-called {\em streaks} are excised from the difference
     317  images, as well as all of the source images which were used to
     318  generate the difference images; the public data sources are updated
     319  with the precise, correct time.  Note that this step requires that
     320  separate difference images be generated for each of the input
     321  images, a step which would be skipped if {\em magic} were avoided.
     322  Also note that, until {\em magic} is performed, the publically
     323  available time has a limited precision (probably $\sim 1$ minute
     324  errors).  This step is only necessary in the operational IPP system
     325  given the restrictions from the Air Force.
     326
     327  \item {\bf Phase 4.2} : After {\em magic} the final difference and
     328  the final cleaned stacked image are produced and objects in both
     329  images are detected.  The difference sources are used to mask the
     330  extreme outliers in the cleaned stack, which is then used to update
     331  the Static Sky images.
     332  \end{itemize}
     333
     334 \item {\bf Static Sky Image Analysis} : While the science image
     335 analysis is performed as images are availablef, the static sky image
     336 analysi occurs on a very different timescale.  In steady state, the
     337 full static sky analysis will take place over the course of a full
     338 year.  At any given time, the portion of the sky corresponding to the
     339 location of the sun will be under-going the analysis.  In practice,
     340 for PS-1, the static sky is produced in a somewhat different fashion
     341 than in the steady-state model.  In PS-1, the different survey
     342 strategies introduce very different update rates for the static sky.
     343 At one extreme, the AP Survey will not have enough data for a
     344 complete static sky analysis until nearly 22 months after the survey
     345 begins.  At the other extreme, the deep survey, which observes a much
     346 smaller portion of the sky, may best be analysed quite frequently.
     347 These details are part of the science guidelines of the PS-1 surveys,
     348 and are beyond the scope of this document.  Rather, the IPP Static
     349 Sky Image Analysis must provide the capability of defining the static
     350 sky analysis in a flexible and dynamic fashion.
     351
     352\item {\bf Basic Detrend Creation Analysis} : The analysis of most of
     353  the detrend data is grouped together in a common analysis stage.
     354  The differences between the analysis of the bias, dark, flat, and
     355  fringe images is primarily one of how the input images are
     356  pre-processed, what statistic is used to characterize a given input
     357  image, how the input images are scaled before being combined, and
     358  what normalization is applied to the resulting image.  All of these
     359  types of detrend images can thus be processed with a single analysis
     360  pipeline which is made aware of these minor differences.  This stage
     361  is never the less fairly complex, and as a result is subdivided into
     362  several compenents, as discussed below.
     363
     364\item {\bf Other analyses} There are a number of other tasks which the
     365  IPP must perform that are not well-defined by the different analysis
     366  types discussed above.  Some analysis tasks are not automatically
     367  triggered, and are thus outside the scope of this document; these
     368  are the tasks which are more properly considered as research
     369  projects than analysis systems.  The other important automatic tasks
     370  are:
     371  \begin{itemize}
     372    \item {\bf Summit Copy} : In this stage, the data source or data
     373    sources are queried for new exposures and image files, which are
     374    then copied to the IPP data area.  This stage also includes the
     375    copying of other metadata which are not included in the image
     376    files.
     377   
     378    \item {\bf Image Classification} : new images which are introduced
     379    to the IPP are examined by this analysis stage and placed in the
     380    appropriate table for processing.  This step includes a small
     381    amount of accumulating statistics about the images.
     382
     383    \item {\bf Data File management} : a few tasks are necessary to
     384    monitor and maintain the clustered storage system.  These tasks
     385    include the automatic duplication and deletion of different types
     386    of files from Nebulous, the file storage archive.  This also
     387    includes automatic redistribution of machine assignments as
     388    hardware is added or removed from the system.  This collection of
     389    tasks also includes monitoring of system parameters to alert
     390    people in case of dangerous hardware situations.
     391
     392    \item {\bf Irregular Calibration Data} certain types of
     393    calibration information is extracted on different intervals from
     394    the more regular detrend images.  These types of calibration data
     395    include improved telescope pointing models, astrometric
     396    calibrations, photometric calibrations, flat-field correction
     397    frames.
     398  \end{itemize}
     399\end{itemize}
     400
     401\section{Tables, Tasks and Tools}
     402
     403The following sections discuss the database tables, the tasks within
     404PanTasks, and the collection of programs used by PanTasks to examine
     405and manipulate the state tables.  These later programs do not, in
     406general, perform any in depth analysis; instead they perform actions
     407such as selecting from one table images ready for analysis in a
     408following processing step.  This collection of tools is grouped under
     409the name of the {\tt ippTools}, and consists of a separate tool for
     410each of the different major analysis steps.
     411
     412The {\tt ippTools} make use of {\em glueforge} to simplify the
     413management of the database table schema.  Glueforge provides a single
     414mechanism to generate a collection of C data structures, database
     415tables, database access APIs, and I/O routines from a simple table
     416description configuration file.  All APIs generated by {\em glueforge}
     417for the same type of interaction have common naming schemes.  This
     418technique has several important advantages.  It makes the writing of C
     419database interactions very quick and easy.  It also makes it easy to
     420modify the database schema without disrupting the software
     421development.  Finally, it provides a simple, self-documenting source
     422for data structure of multiple types which can be shared between
     423programs or platforms.
     424
     425Within the following diagrams, we illustrate the database tables used
     426to track the state of the IPP.  We also show the commands provided by
     427{\tt ippTools} to connect the tables.  Finally, we show the IPP tasks
     428which initiate the different analysis steps.  The following set of
     429diagrams uses several consistent features.  The blue-and-grey
     430rectangles define the metadata database tables.  The blue section
     431contains the table name, while the grey section lists a minimal subset
     432of the table columns.  The ellipses represent programs (or program
     433portions in some cases) executed by PanTasks.  The blue filled
     434ellipses represent the {\tt ippTools} commands which are executed
     435locally on the computer hosting PanTasks.  The grey-blue ellipses
     436represent the commands executed on the parallel cluster, monitored by
     437{\tt pcontrol}.  The green ellipses represent commands executed by
     438hand for testing and manual intervention.
     439
     440In most of the analysis tasks, we use a two-table approach to the data
     441in order to avoid excessive latencies.  One table is used to track
     442quantities which are still pending for a particular stage.  When the
     443analysis is completed, these items are moved from the 'pending' tables
     444to corresponding 'done' tables.  Although this introduces a somewhat
     445higher number of tables and complexity, it will avoid the system from
     446slowing down as the number of data items grows with time.  The pending
     447tables are searched repeatedly by the {\tt ippTools} programs as they
     448attempt to select new data of interest.  In contrast, the done tables
     449are searched much less frequently. 
    218450
    219451\section{Summit Copy Tasks}
     
    306538Figure~\ref{phase0} illustrates phase 0, in which the image files are
    307539categorised, examined for summary information and basic statistics,
    308 and moved to the tables used to trigger further analysis.  The process
    309 first examines the `new image files' table.  It selects images from
    310 this table which have not yet been examined (state is `new').  The
     540and moved to the later phase 'pending' tables to trigger further
     541analysis.  The command {\tt p0search -pending} examines the `new
     542imfiles' and 'new exposure' tables.  It selects images from this table
     543which have not yet been examined (state is `new').  These are returned
     544to PanTasks, which sends each image file to a separate analysis node
     545running the {\tt p0search -update} command.  With this command, the
    311546file header is examined and relevant metadata is extracted (eg, RA,
    312547DEC, times, and so forth to be defined later).  The process may also
     
    317552files' table is set to `ready'.
    318553
    319 The process is also responsible for moving the exposures to the tables
    320 used for triggering the analysis process.  If the image class is FPA,
    321 the image can be advanced without waiting for any other image files.
    322 If the class is Chip or Cell, the process must also examine the `new
    323 exposure' table for this exposure ID.  The number of class files
    324 available for this exposure is listed in this table.  The process must
    325 the select all image files matching the exposure ID with state of
    326 `ready' and compare the number avalable to the number expected.  If
    327 the two match, then a new exposure is ready.  Based on the image type
    328 (from the most recently examined image file header or new exp table?),
    329 the exposure is added to the `raw exposure' table for images of that
    330 type.  The allowed types are `detrend', (all bias, dark, flat images),
    331 `object', `focus'(??), etc.  (** The different tables represent
    332 different analysis modes.  This process also adds an entry to the exp
    333 ID / image file match **).  This process also adds all science
    334 (OBJECT) exposures to the P1 exposure table (for mosaic data) or the
    335 P2 chip table (for single detector data).  These tables are used to
    336 trigger the Phase 1 and Phase 2 analysis stages.
     554The {\tt p0search -update} command is also responsible for moving the
     555exposures to the tables used for triggering the analysis process.  If
     556the image class is FPA, the image can be advanced without waiting for
     557any other image files.  If the class is Chip or Cell, the process must
     558also examine the `new exposure' table for this exposure ID.  The
     559number of class files available for this exposure is listed in this
     560table.  The process must the select all image files matching the
     561exposure ID with state of `ready' and compare the number avalable to
     562the number expected.  If the two match, then a new exposure is ready.
     563Based on the image type (from the most recently examined image file
     564header or new exp table?), the exposure is added to the `raw exposure'
     565table for images of that type.  The allowed types are `detrend', (all
     566bias, dark, flat images), `object', `focus'(??), etc.  (** The
     567different tables represent different analysis modes.  This process
     568also adds an entry to the exp ID / image file match **).  This process
     569also adds all science (OBJECT) exposures to the P1 exposure table (for
     570mosaic data) or the P2 chip table (for single detector data).  These
     571tables are used to trigger the Phase 1 and Phase 2 analysis stages.
    337572
    338573\section{Phase 1}
     
    345580\end{figure}
    346581
    347 Figure~\ref{phase1} shows the tables involved in running the P1
     582Figure~\ref{phase1} shows the tables involved in running the Phase 1
    348583analysis stage.  There are paths for exposures to enter the analysis
    349 automatically from the P0 analysis (arrow on left) or to be added
     584automatically from the Phase 0 analysis (arrow on left) or to be added
    350585manually based on a selection from the raw exposure table.  Exposures
    351586to be analysed by Phase 1 are added to the P1 exposure table with the
    352587state `new'.  Exposures may be added multiple times for processing and
    353 reprocessing. The P1 exp table keeps a record of the old attempts for
    354 debugging and analysis.  Each time an exposure is added to the P1 exp
    355 table, it is given a new, unique version number, allowing the system
    356 as a whole to track different analysis attempts.  This method is used
    357 in all of the image analysis stages (and extrapolated to iterations in
    358 the detrend analysis steps below).  The top portion of the diagram
    359 represents the user-space tool which may be used to re-submit an
    360 exposure or a group of exposures, potentially selected on the basis of
    361 a query from the raw SCIENCE exposure table.
    362 
    363 The P1 exposure table is examined to select the new exposures, these
    364 are then used to generate the P1 analysis jobs.  Within the analysis
    365 job, the chips (image files) associated with the exposure are select
    366 from the raw image file table.  The analysis examines the contents of
    367 these files, either extract the guide star information from the image
    368 files (GS table extension) or searches for and centroids the pixels on
     588reprocessing. The P1 done exposure table keeps a record of the old
     589attempts for debugging and analysis.  Each time an exposure is added
     590to the P1 exp table, it is given a new, unique version number,
     591allowing the system as a whole to track different analysis attempts.
     592This method is used in all of the image analysis stages (and
     593extrapolated to iterations in the detrend analysis steps below).  The
     594top portion of the diagram shows the use of the command {\tt p1search
     595-define} to select and submit an exposure or a group of exposures,
     596potentially selected on the basis of a query from the raw science
     597exposure table.
     598
     599The P1 pending exposure table is examined by {\tt p1search -pending}
     600to select the new exposures, which are sent to PanTasks.  PanTasks
     601initiates a separate analysis job (p1astro) for each exposure, which
     602are sent to the parallel processing nodes.  Within the analysis job,
     603the chips (image files) associated with the exposure are select from
     604the raw image file table.  The analysis examines the contents of these
     605files, either extract the guide star information from the image files
     606(GS table extension) or searches for and centroids the pixels on
    369607appropriate bright stars.  The analysis results in astrometric
    370608calibration terms which are written to the astrometric calibration
     
    373611exposure table.  The images associated with exposures which are
    374612successfully processed by P1 are then added to the P2 image table,
    375 which is used to trigger the Phase 2 analysis.
     613which is used to trigger the Phase 2 analysis.  This last step is
     614performed by the command {\tt p1search -done}, which is executed
     615regularly to search for completed Phase 1 jobs.
    376616
    377617\section{Phase 2}
     
    388628automatically from the P1 analysis (arrow on left) or to be added
    389629manually based on a selection from the raw exposure and raw image file
    390 tables.  Images to be analysed by Phase 2 are added to the P2 image
    391 table with the state `new'.  When images are added to this table, a
    392 single entry is also added to the P2 exposure table listing the P1 and
    393 P2 versions for this exposure.  These version numbers must be integers
    394 starting with 1.  If this image did not have a P1 analysis, the P1
    395 version is set to 0.  Exposures may be added multiple times for
    396 processing and reprocessing. The P2 image table keeps a record of the
    397 old attempts for debugging and analysis.  As with P1, each time a
    398 collection of associated images from an exposure is added to the P2
    399 image table, it is given a new, unique version number, allowing the
    400 system as a whole to track different analysis attempts.  The top
    401 portion of the diagram represents the user-space tool which may be
    402 used to re-submit the images for an exposure or a group of exposures,
    403 potentially selected on the basis of a query from the raw SCIENCE
    404 exposure and raw image file tables.
    405 
    406 The P2 image table is examined to select the `new' images.  These
    407 images are used to generate P2 analysis jobs.  The P2 analysis uses
    408 the input url to find and load the image file.  The url may be a file
    409 on disk, an entry in the image server, Nebulous, etc.  The master
    410 detrend images matching the specific science image and the conditions
    411 are selected by examining the table of master detrend frames.  The
    412 specific detrend image files are selected by using the master detrend
    413 ID to select the matching the entries in the table of master detrend
    414 files.  After the analysis, the output image, mask, and FITS table of
    415 objects, including the astrometry calibration, are written to the P2
    416 image table, along with summary statistics from the P2 analysis.  The
    417 state is also updated (to `done'). 
    418 
    419 Whenever the exposure is completed, the value of Ndone in the P2
    420 exposure table is incremented.  If all P2 images matching the P2
    421 exposure version have been completed, the value of Ndone will match
    422 Nclass, and in this case, the process adds an entry to the P3 exposure
    423 table.
     630tables.  Image files to be analysed by Phase 2 are added to the P2
     631pending imfiles table with the state `new'.  When images are added to
     632this table, a single entry is also added to the P2 exposure table
     633listing the P1 and P2 versions for this exposure.  These version
     634numbers must be integers starting with 1.  If this image did not have
     635a P1 analysis, the P1 version is set to 0.  Exposures may be added
     636multiple times for processing and reprocessing. The P2 image table
     637keeps a record of the old attempts for debugging and analysis.  As
     638with P1, each time a collection of associated images from an exposure
     639is added to the P2 image table, it is given a new, unique version
     640number, allowing the system as a whole to track different analysis
     641attempts.  Note that these version numbers are unique for each {\em
     642exposure} processed by Phase 2, not just for any image file.  The top
     643portion of the diagram illustrates the behavior of the commands {\tt
     644p2search -define} and {\tt p2search -quick}.  The first may be used to
     645re-submit the images for an exposure or a group of exposures,
     646potentially selected on the basis of a query from the raw science
     647exposure and raw image file tables.  The second version sends images
     648files directly to PanTasks for processing; these entries will not be
     649included in the processing tables, and is used only for testing
     650purposes.
     651
     652The P2 pending image table is examined with the command {\tt p2search
     653  -pending} to select the `new' images.  These images are used by
     654PanTasks to generate P2 analysis jobs, running the analysis command
     655{\tt ppImage}.  The P2 analysis uses the input url to find and load
     656the image file.  The url may be a file on disk, an entry in the image
     657server, Nebulous, etc.  The master detrend images matching the
     658specific science image and the conditions are selected by examining
     659the table of master detrend frames.  The specific detrend image files
     660are selected by using the master detrend ID to select the matching the
     661entries in the table of master detrend files.  After the analysis, the
     662output image, mask, and FITS table of objects, including the
     663astrometry calibration, are written back to the P2 image table, along
     664with summary statistics from the P2 analysis.  The state is also
     665updated (to `done').
     666
     667The completed images are examined by the command {\tt p2search -done},
     668and when all image files for a single exposure are completed, this
     669command migrates them to the P2 done table.  This process is also
     670responsible for populating the P3 pending tables so exposures may be
     671processing by Phase 3.
    424672
    425673\section{Phase 3}
     
    432680\end{figure}
    433681
    434 Figure~\ref{phase3} illustrates the tables involved in the Phase 3
    435 analysis.  The P3 exposure table lists the exposure ID, the P3
    436 analysis version, the P2 analysis version to be used as input to this
    437 P3 analysis, and the recipe to be used.  The P2 exposure and image
    438 tables are used, in conjunction with the P2 version information, to
    439 select the P2 output measured objects and the astrometric calibrations
    440 from P2 and P1.  These measured objects are matched with the reference
    441 catalog objects, and calibrated astrometry and photometry is produced
    442 for the full exposure.  The location of the resulting astometry
     682Figure~\ref{phase3} illustrates the tables and commands involved in
     683the Phase 3 analysis.  The P3 pending exposure table lists the
     684exposure ID, the P3 analysis version, the P2 analysis version to be
     685used as input to this P3 analysis, and the recipe to be used.  The
     686command {\tt p3search -pending} extracts exposures from this table and
     687provides them to PanTasks for processing.  PanTasks launches a Phase 3
     688analysis (the command {\tt psastro}?) for each exposure.  In this
     689analysis, the P2 exposure and image tables are used, in conjunction
     690with the P2 version information, to select the P2 output measured
     691objects and the astrometric calibrations from P2 and P1.  These
     692measured objects are matched with the reference catalog objects, and
     693calibrated astrometry {\em and eventually photometry} is produced for
     694the full exposure.  The location of the resulting astometry
    443695calibration table is stored back in the P3 exposure table.  If the
    444696recipe file specifies, the 2-D photometric and background / fringe
     
    636888above, the `process' stage is a null operation.
    637889
     890\begin{figure}
     891\begin{center}
     892\includegraphics[scale=0.85]{pics/pantasks.09.ps}
     893\caption{\label{detprocess} Detrend Creation : Process Tasks}
     894\end{center}
     895\end{figure}
     896
     897\begin{figure}
     898\begin{center}
     899\includegraphics[scale=0.85]{pics/pantasks.10.ps}
     900\caption{\label{detresid} Detrend Creation : Residual Tasks}
     901\end{center}
     902\end{figure}
     903
     904\begin{figure}
     905\begin{center}
     906\includegraphics[scale=0.85]{pics/pantasks.11.ps}
     907\caption{\label{detstack} Detrend Creation : Stack and Norm}
     908\end{center}
     909\end{figure}
     910
    638911\pagebreak
    639912
     
    655928particularly true of the \code{submit.Px} type of commands. 
    656929
    657 \note{the command names are for illustration purposes only.  any
    658   suggestions for better / fancier names are welcome...}
    659 
    660930\begin{verbatim}
    661931
     
    690960  also adds an entry to either the P1 exposure table or the P2 image table.
    691961 
     962Phase 0 commands:
     963
     964p0search -pending :
     965  * examine the new.imfiles,new.exposures tables and select exposures ready for analysis
     966  * output is: (expID) (camera)
     967
     968p0search -update (expID) (camera):
     969  * select a the corresponding images from the new.imfiles/new.exposures table
     970  * extract the specified header information
     971  * search the summit metadata db tables
     972  * write an entry to the raw.imfiles and raw.exposure tables
     973  * set the state on the new.imfiles,new.exposure tables
     974  * based on the camera config information;
     975    * add an entry to the p1.pending table (mosaic)
     976    - or
     977    * add an entry to the p2.pending table (single)
     978
     979p0search -stats (expID) (camera):
     980  * select a specified image in the new.imfiles/new.exposures table
     981  * extract the specified header information
     982  * search the summit metadata db tables
     983  * report the image stats
     984  [-update without output to MDDB]
     985
     986p0search -mkraw (expID) (camera):
     987  * select a specified image in the new.imfiles/new.exposures table
     988  * extract the specified header information
     989  * search the summit metadata db tables
     990  * write an entry to the raw.imfiles and raw.exposure tables
     991  * set the state on the new.imfiles,new.exposure tables
     992
     993p0search -cleanup:
     994  * remove completed entries from the new.imfiles,new.exposure tables
     995
     996** note : the division of -pending and -update allows separate processes
     997   to be examining the image headers and measuring some stats.  these
     998   jobs can be run via pcontrol to reduce the load on the PanTasks
     999   machines
     1000
     1001Phase 1 pipeline tools:
     1002
     1003p1search -define [constraints]:
     1004  * examine the raw.exposures tables and select exposures matching the given criteria
     1005  * add entries which are allowed (mosaic) to the p1.pending table
     1006
     1007p1search -pending :
     1008  * examine the p1.pending table and select exposures waiting for p1
     1009  * output: lines consisting of:
     1010    (expID) (p1version) (camera)
     1011
     1012p1search -done :
     1013  * select completed entries in the p1.pending table
     1014  * move to the p1.done table
     1015  * add new entry to the p2.pending tables
     1016
     1017Phase 2 pipeline tools:
     1018
     1019p2search -quick
     1020  * search for images which match in raw.exp,raw.imfiles
     1021  * output in format which can be used by ppImage pantasks script
     1022
     1023p2search -define [options]
     1024  * input: searches mddb:raw_exposures,raw_images
     1025  * output: updates mddb:P2_exposures_pending,P2_images_pending
     1026  * alternative output: identical to p2pending
     1027 
     1028p2search -pending
     1029  * input: searches mddb:P2_exposures_pending,P2_images_pending
     1030  * output: Nlines consisting of:
     1031    (URL) (expID) (class)
     1032  * options: ?
     1033
     1034p2search -update
     1035  * examine the imfiles and identify any completed exposures
     1036
     1037p2search -done
     1038  * add completed exposures to the p2.done tables
     1039  * remove corresponding entries from the p2.pending table
     1040  * send new entry to the pending p3 table
     1041
     1042ppImage file://path/filename file://path/outroot -recipe (recipe)
     1043ppImage neb://nebname neb://outroot -recipe (recipe)
     1044
     1045restriction options:
     1046  -time (start) (stop)
     1047  -camera (camera)
     1048  -region (ra,dec) (ra,dec)
     1049
     1050
     1051Phase 3 pipeline tools:
     1052
     1053p3search -define :
     1054  * examine the raw.exposures tables and select exposures matching the given criteria
     1055  * add entries which are allowed (mosaic) to the p3.pending table
     1056
     1057p3search -quick :
     1058  * examine the raw.exposures tables and select exposures matching the given criteria
     1059  * return list of entries for p3 processing
     1060  * output: lines consisting of:
     1061    (expID) (p3version) (camera)
     1062
     1063p3search -pending :
     1064  * examine the p3.pending exposures table and select exposures waiting for p3
     1065  * return list of entries for p3 processing
     1066  * output: lines consisting of:
     1067    (expID) (p3version) (camera)
     1068
     1069p3search -done :
     1070  * select completed entries in the p3.pending table
     1071  * move to the p3.done table
     1072
     1073
     1074mkdetrend tools
     1075
     1076dettools -define [options]
     1077 * define a new detRun, specifying the constraints, and adding it to
     1078 the run table.  if the detRun ID already exists, creates a new
     1079 version.  the initial state is set to START.  the iteration is set to
     1080 0. also creates a new master detrend frame entry
     1081 (detID.version.iteration define this frame uniquely).
     1082 * select the input matching a given detRun.  selects the input
     1083 exposures and the input files.
     1084
     1085options :
     1086  -ID ID : a free-form string; if not specified, a unique string is constructed
     1087  -type type : bias dark (mask?) flat fringe (other?)
     1088  -camera camera
     1089  -filter filter
     1090  -time start stop
     1091  -exptime min max
     1092  -airmass min max
     1093  -expgroup groupID
     1094
     1095  (-type and -camera are mandatory)
     1096  (-filter is mandatory for 'light' types)
     1097  (-exptime is mandatory for dark)
     1098
     1099dettools -pending raw [-state state] [-outmode mode]
     1100 * select the unprocessed input infiles
     1101 - output of this program is used by pantasks to schedule the ppImage
     1102 run on each image
     1103
     1104dettools -pending resid [-state state] [-outmode mode]
     1105 * select the residual images to be processed
     1106 - output of this program is used by pantasks to schedule the ppImage
     1107 run on each image
     1108
     1109dettools -pending stack [-state state] [-outmode mode]
     1110 * select the files to be stacked for a given detRun, if exposures are ready
     1111 - output of this program is used by ppMerge to build a master stack
     1112
     1113dettools -pending norm
     1114 * select the master detrend frames & imfiles to be normalized
     1115
     1116dettools -update raw
     1117 * select the raw input exposures, count processed imfiles, update if done
     1118
     1119dettools -update resid
     1120 * select the resid exposures, count processed resid imfiles, update if done
     1121 - for a given resid exposure, compile the results from the stacks for
     1122 each chip and renormalize the output files as needed.
     1123
     1124dettools -assess
     1125 * for a given master detrend frame, compile the results from the
     1126 residual exposures and assess the validity of the input exposures and of
     1127 the complete stack.  if too many input images are rejected, the
     1128 affect the master detrend frame state.  if input images are rejected
     1129 and a new set of master stacks should be made, create a new master
     1130 detrend image, incrementing the iteration by one.
     1131
     1132** NOTE the sequence is:
     1133
     1134   process, stack, merge, residual, assess
     1135              ^--------------------------<
     1136
     1137   IF we have no relevant detrend image for comparison.  otherwise,
     1138   the sequence should skip from process to residual on the first
     1139   pass, with a lower rejection threshold for the first assess pass.
     1140   the tools above allow either option; it is the choice of state
     1141   after process that determines which happens next.
     1142
     1143
     1144
     1145States:
     1146 input detrend exposures:
     1147  RAW
     1148  PROCESSED
     1149
     1150 input detrend imfiles:
     1151  RAW
     1152  PROCESSED
     1153 
     1154 master detrend frames
     1155  RAW
     1156  NORMALIZED
     1157  MKRESID
     1158  SUCCESS
     1159  FAILURE
     1160  RETRY
     1161  (also has NEW/PRIOR flag)
     1162
     1163 master detrend imfiles
     1164  NEW (not yet created)
     1165  RAW (created, but not normalized)
     1166  NORMALIZED
     1167
     1168 resid exposure
     1169  RAW
     1170  PROCESSED
     1171  ASSESSED
     1172
     1173 resid imfiles:
     1174  RAW
     1175  PROCESSED
     1176
     1177 master detrend run:
     1178  NEW
     1179  DONE
     1180
     1181
     1182
     1183older descriptions:
     1184
    6921185Phase.1
    6931186  input: exp ID
Note: See TracChangeset for help on using the changeset viewer.