Index: trunk/ippdb/src/ippdb.h
===================================================================
--- trunk/ippdb/src/ippdb.h	(revision 9054)
+++ trunk/ippdb/src/ippdb.h	(revision 9107)
@@ -6084,4 +6084,247 @@
     bool            mdcf                ///< format as mdconfig or simple
 );
+/** detProcessedExpRow data structure
+ *
+ * Structure for representing a single row of detProcessedExp table data.
+ */
+
+typedef struct {
+    psS32           det_id;
+    char            *exp_tag;
+    char            *recipe;
+    psF64           bg;
+    psF64           bg_stdev;
+    psF64           bg_mean_stdev;
+    char            *b1_uri;
+    char            *b2_uri;
+} detProcessedExpRow;
+
+/** Creates a new detProcessedExpRow object
+ *
+ *  @return A new detProcessedExpRow object or NULL on failure.
+ */
+
+detProcessedExpRow *detProcessedExpRowAlloc(
+    psS32           det_id,
+    const char      *exp_tag,
+    const char      *recipe,
+    psF64           bg,
+    psF64           bg_stdev,
+    psF64           bg_mean_stdev,
+    const char      *b1_uri,
+    const char      *b2_uri
+);
+
+/** Creates a new detProcessedExp table
+ *
+ * @return true on success
+ */
+
+bool detProcessedExpCreateTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Deletes a detProcessedExp table
+ *
+ * @return true on success
+ */
+
+bool detProcessedExpDropTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Insert a single row into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool detProcessedExpInsert(
+    psDB            *dbh,               ///< Database handle
+    psS32           det_id,
+    const char      *exp_tag,
+    const char      *recipe,
+    psF64           bg,
+    psF64           bg_stdev,
+    psF64           bg_mean_stdev,
+    const char      *b1_uri,
+    const char      *b2_uri
+);
+
+/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+long long detProcessedExpDelete(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+
+/** Removes the last row from the database and returns it
+ *
+ * @return true on success
+ */
+
+bool detProcessedExpPop(
+    psDB            *dbh,               ///< Database handle
+    psS32           *det_id,
+    char            **exp_tag,
+    char            **recipe,
+    psF64           *bg,
+    psF64           *bg_stdev,
+    psF64           *bg_mean_stdev,
+    char            **b1_uri,
+    char            **b2_uri
+);
+
+/** Insert a single detProcessedExpRow object into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool detProcessedExpInsertObject(
+    psDB            *dbh,               ///< Database handle
+    detProcessedExpRow *object             ///< detProcessedExpRow object
+);
+
+/** Insert an array of detProcessedExpRow object into a table
+ *
+ * This function constructs and inserts multiple rows based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool detProcessedExpInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of detProcessedExpRow objects
+);
+
+/** Removes the last row from the database and returns it
+ *
+ * @return A new detProcessedExpRow on success or NULL on failure.
+ */
+
+detProcessedExpRow *detProcessedExpPopObject(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Insert data from a binary FITS table detProcessedExpRow into the database
+ *
+ * This function expects a psFits object with a FITS table as the first
+ * extension.  The table must have at least one row of data in it, that is of
+ * the appropriate format (number of columns and their type).  All other
+ * extensions are ignored.
+ *
+ * @return true on success
+ */
+
+bool detProcessedExpInsertFits(
+    psDB            *dbh,               ///< Database handle
+    const psFits    *fits               ///< psFits object
+);
+
+/** Removes the last limit row from the database and returns them in a binary FITS table.
+ *
+ * This function assumes an empty psFits object and will create a FITS table as
+ * the first extension. 
+ *
+ * @return true on success
+ */
+
+bool detProcessedExpPopFits(
+    psDB            *dbh,               ///< Database handle
+    psFits          *fits,              ///< psFits object
+    unsigned long long limit            ///< Maximum number of elements to return
+);
+
+/** Selects up to limit from the database and returns them in a binary FITS table
+ *
+ * This function assumes an empty psFits object and will create a FITS table
+ * as the first extension.
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return true on success
+ */
+
+bool detProcessedExpSelectRowsFits(
+    psDB            *dbh,               ///< Database handle
+    psFits          *fits,              ///< psFits object
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to return
+);
+
+/** Convert a detProcessedExpRow into an equivalent psMetadata
+ *
+ * @return A psMetadata pointer or NULL on error
+ */
+
+psMetadata *detProcessedExpMetadataFromObject(
+    const detProcessedExpRow *object             ///< fooRow to convert into a psMetadata
+);
+
+/** Convert a psMetadata into an equivalent fooRow
+ *
+ * @return A detProcessedExpRow pointer or NULL on error
+ */
+
+detProcessedExpRow *detProcessedExpObjectFromMetadata(
+    psMetadata      *md                 ///< psMetadata to convert into a fooRow
+);
+/** Selects up to limit rows from the database and returns as detProcessedExpRow objects in a psArray
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return A psArray pointer or NULL on error
+ */
+
+psArray *detProcessedExpSelectRowObjects(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to return
+);
+/** Deletes a row from the database coresponding to an detProcessedExp
+ *
+ *  Note that a 'where' search psMetadata is constructed from each object and
+ *  used to find rows to delete.
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+bool detProcessedExpDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const detProcessedExpRow *object    ///< Object to delete
+);
+/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
+ *
+ *  Note that a 'where' search psMetadata is constructed from each object and
+ *  used to find rows to delete.
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+long long detProcessedExpDeleteRowObjects(
+    psDB            *dbh,               ///< Database handle
+    const psArray   *objects,           ///< Array of objects to delete
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+/** Formats and prints an array of detProcessedExpRow objects
+ *
+ * When mdcf is set the formated output is in psMetadataConfig
+ * format, otherwise it is in a simple tabular format.
+ *
+ * @return true on success
+ */
+
+bool detProcessedExpPrintObjects(
+    FILE            *stream,            ///< a stream
+    psArray         *objects,           ///< An array of detProcessedExpRow objects
+    bool            mdcf                ///< format as mdconfig or simple
+);
 /** detStackedImfileRow data structure
  *
@@ -6098,5 +6341,4 @@
     psF64           bg_stdev;
     psF64           bg_mean_stdev;
-    bool            normalize;
 } detStackedImfileRow;
 
@@ -6114,6 +6356,5 @@
     psF64           bg,
     psF64           bg_stdev,
-    psF64           bg_mean_stdev,
-    bool            normalize
+    psF64           bg_mean_stdev
 );
 
@@ -6152,6 +6393,5 @@
     psF64           bg,
     psF64           bg_stdev,
-    psF64           bg_mean_stdev,
-    bool            normalize
+    psF64           bg_mean_stdev
 );
 
@@ -6181,6 +6421,5 @@
     psF64           *bg,
     psF64           *bg_stdev,
-    psF64           *bg_mean_stdev,
-    bool            *normalize
+    psF64           *bg_mean_stdev
 );
 
