Index: trunk/ippdb/src/ippdb.h
===================================================================
--- trunk/ippdb/src/ippdb.h	(revision 9423)
+++ trunk/ippdb/src/ippdb.h	(revision 9684)
@@ -125,1589 +125,4 @@
 );
 
-/** weatherRow data structure
- *
- * Structure for representing a single row of weather table data.
- */
-
-typedef struct {
-    psF32           temp01;
-    psF32           humi01;
-    psF32           temp02;
-    psF32           humi02;
-    psF32           temp03;
-    psF32           humi03;
-    psF32           pressure;
-} weatherRow;
-
-/** Creates a new weatherRow object
- *
- *  @return A new weatherRow object or NULL on failure.
- */
-
-weatherRow *weatherRowAlloc(
-    psF32           temp01,
-    psF32           humi01,
-    psF32           temp02,
-    psF32           humi02,
-    psF32           temp03,
-    psF32           humi03,
-    psF32           pressure
-);
-
-/** Creates a new weather table
- *
- * @return true on success
- */
-
-bool weatherCreateTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Deletes a weather table
- *
- * @return true on success
- */
-
-bool weatherDropTable(
-    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 weatherInsert(
-    psDB            *dbh,               ///< Database handle
-    psF32           temp01,
-    psF32           humi01,
-    psF32           temp02,
-    psF32           humi02,
-    psF32           temp03,
-    psF32           humi03,
-    psF32           pressure
-);
-
-/** 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 weatherDelete(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-
-/** Insert a single weatherRow object into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool weatherInsertObject(
-    psDB            *dbh,               ///< Database handle
-    weatherRow      *object             ///< weatherRow object
-);
-
-/** Insert an array of weatherRow object into a table
- *
- * This function constructs and inserts multiple rows based on it's parameters.
- *
- * @return true on success
- */
-
-bool weatherInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of weatherRow objects
-);
-
-/** Insert data from a binary FITS table weatherRow 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 weatherInsertFits(
-    psDB            *dbh,               ///< Database handle
-    const psFits    *fits               ///< psFits object
-);
-
-/** 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 weatherSelectRowsFits(
-    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 weatherRow into an equivalent psMetadata
- *
- * @return A psMetadata pointer or NULL on error
- */
-
-psMetadata *weatherMetadataFromObject(
-    const weatherRow *object             ///< fooRow to convert into a psMetadata
-);
-
-/** Convert a psMetadata into an equivalent fooRow
- *
- * @return A weatherRow pointer or NULL on error
- */
-
-weatherRow *weatherObjectFromMetadata(
-    psMetadata      *md                 ///< psMetadata to convert into a fooRow
-);
-/** Selects up to limit rows from the database and returns as weatherRow objects in a psArray
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return A psArray pointer or NULL on error
- */
-
-psArray *weatherSelectRowObjects(
-    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 weather
- *
- *  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 weatherDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const weatherRow *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 weatherDeleteRowObjects(
-    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 weatherRow 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 weatherPrintObjects(
-    FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of weatherRow objects
-    bool            mdcf                ///< format as mdconfig or simple
-);
-/** skyp_transparencyRow data structure
- *
- * Structure for representing a single row of skyp_transparency table data.
- */
-
-typedef struct {
-    char            *filter;
-    psF64           trans;
-    psS32           nstars;
-    psF64           ra;
-    psF64           decl;
-    psF32           exptime;
-    psF64           sky_bright;
-} skyp_transparencyRow;
-
-/** Creates a new skyp_transparencyRow object
- *
- *  @return A new skyp_transparencyRow object or NULL on failure.
- */
-
-skyp_transparencyRow *skyp_transparencyRowAlloc(
-    const char      *filter,
-    psF64           trans,
-    psS32           nstars,
-    psF64           ra,
-    psF64           decl,
-    psF32           exptime,
-    psF64           sky_bright
-);
-
-/** Creates a new skyp_transparency table
- *
- * @return true on success
- */
-
-bool skyp_transparencyCreateTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Deletes a skyp_transparency table
- *
- * @return true on success
- */
-
-bool skyp_transparencyDropTable(
-    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 skyp_transparencyInsert(
-    psDB            *dbh,               ///< Database handle
-    const char      *filter,
-    psF64           trans,
-    psS32           nstars,
-    psF64           ra,
-    psF64           decl,
-    psF32           exptime,
-    psF64           sky_bright
-);
-
-/** 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 skyp_transparencyDelete(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-
-/** Insert a single skyp_transparencyRow object into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool skyp_transparencyInsertObject(
-    psDB            *dbh,               ///< Database handle
-    skyp_transparencyRow *object             ///< skyp_transparencyRow object
-);
-
-/** Insert an array of skyp_transparencyRow object into a table
- *
- * This function constructs and inserts multiple rows based on it's parameters.
- *
- * @return true on success
- */
-
-bool skyp_transparencyInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of skyp_transparencyRow objects
-);
-
-/** Insert data from a binary FITS table skyp_transparencyRow 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 skyp_transparencyInsertFits(
-    psDB            *dbh,               ///< Database handle
-    const psFits    *fits               ///< psFits object
-);
-
-/** 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 skyp_transparencySelectRowsFits(
-    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 skyp_transparencyRow into an equivalent psMetadata
- *
- * @return A psMetadata pointer or NULL on error
- */
-
-psMetadata *skyp_transparencyMetadataFromObject(
-    const skyp_transparencyRow *object             ///< fooRow to convert into a psMetadata
-);
-
-/** Convert a psMetadata into an equivalent fooRow
- *
- * @return A skyp_transparencyRow pointer or NULL on error
- */
-
-skyp_transparencyRow *skyp_transparencyObjectFromMetadata(
-    psMetadata      *md                 ///< psMetadata to convert into a fooRow
-);
-/** Selects up to limit rows from the database and returns as skyp_transparencyRow objects in a psArray
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return A psArray pointer or NULL on error
- */
-
-psArray *skyp_transparencySelectRowObjects(
-    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 skyp_transparency
- *
- *  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 skyp_transparencyDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const skyp_transparencyRow *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 skyp_transparencyDeleteRowObjects(
-    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 skyp_transparencyRow 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 skyp_transparencyPrintObjects(
-    FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of skyp_transparencyRow objects
-    bool            mdcf                ///< format as mdconfig or simple
-);
-/** skyp_absorptionRow data structure
- *
- * Structure for representing a single row of skyp_absorption table data.
- */
-
-typedef struct {
-    char            *disperser_id;
-    psF32           atmcomp1;
-    psF32           atmcomp2;
-    psF32           atmcomp3;
-    psS32           nstars;
-    psF64           ra;
-    psF64           decl;
-    psF32           exptime;
-    psF64           sky_bright;
-} skyp_absorptionRow;
-
-/** Creates a new skyp_absorptionRow object
- *
- *  @return A new skyp_absorptionRow object or NULL on failure.
- */
-
-skyp_absorptionRow *skyp_absorptionRowAlloc(
-    const char      *disperser_id,
-    psF32           atmcomp1,
-    psF32           atmcomp2,
-    psF32           atmcomp3,
-    psS32           nstars,
-    psF64           ra,
-    psF64           decl,
-    psF32           exptime,
-    psF64           sky_bright
-);
-
-/** Creates a new skyp_absorption table
- *
- * @return true on success
- */
-
-bool skyp_absorptionCreateTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Deletes a skyp_absorption table
- *
- * @return true on success
- */
-
-bool skyp_absorptionDropTable(
-    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 skyp_absorptionInsert(
-    psDB            *dbh,               ///< Database handle
-    const char      *disperser_id,
-    psF32           atmcomp1,
-    psF32           atmcomp2,
-    psF32           atmcomp3,
-    psS32           nstars,
-    psF64           ra,
-    psF64           decl,
-    psF32           exptime,
-    psF64           sky_bright
-);
-
-/** 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 skyp_absorptionDelete(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-
-/** Insert a single skyp_absorptionRow object into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool skyp_absorptionInsertObject(
-    psDB            *dbh,               ///< Database handle
-    skyp_absorptionRow *object             ///< skyp_absorptionRow object
-);
-
-/** Insert an array of skyp_absorptionRow object into a table
- *
- * This function constructs and inserts multiple rows based on it's parameters.
- *
- * @return true on success
- */
-
-bool skyp_absorptionInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of skyp_absorptionRow objects
-);
-
-/** Insert data from a binary FITS table skyp_absorptionRow 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 skyp_absorptionInsertFits(
-    psDB            *dbh,               ///< Database handle
-    const psFits    *fits               ///< psFits object
-);
-
-/** 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 skyp_absorptionSelectRowsFits(
-    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 skyp_absorptionRow into an equivalent psMetadata
- *
- * @return A psMetadata pointer or NULL on error
- */
-
-psMetadata *skyp_absorptionMetadataFromObject(
-    const skyp_absorptionRow *object             ///< fooRow to convert into a psMetadata
-);
-
-/** Convert a psMetadata into an equivalent fooRow
- *
- * @return A skyp_absorptionRow pointer or NULL on error
- */
-
-skyp_absorptionRow *skyp_absorptionObjectFromMetadata(
-    psMetadata      *md                 ///< psMetadata to convert into a fooRow
-);
-/** Selects up to limit rows from the database and returns as skyp_absorptionRow objects in a psArray
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return A psArray pointer or NULL on error
- */
-
-psArray *skyp_absorptionSelectRowObjects(
-    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 skyp_absorption
- *
- *  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 skyp_absorptionDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const skyp_absorptionRow *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 skyp_absorptionDeleteRowObjects(
-    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 skyp_absorptionRow 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 skyp_absorptionPrintObjects(
-    FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of skyp_absorptionRow objects
-    bool            mdcf                ///< format as mdconfig or simple
-);
-/** skyp_emissionRow data structure
- *
- * Structure for representing a single row of skyp_emission table data.
- */
-
-typedef struct {
-    char            *disperser_id;
-    psF32           atmcomp1;
-    psF32           atmcomp2;
-    psF32           atmcomp3;
-    psF32           continuum;
-    psF32           exptime;
-} skyp_emissionRow;
-
-/** Creates a new skyp_emissionRow object
- *
- *  @return A new skyp_emissionRow object or NULL on failure.
- */
-
-skyp_emissionRow *skyp_emissionRowAlloc(
-    const char      *disperser_id,
-    psF32           atmcomp1,
-    psF32           atmcomp2,
-    psF32           atmcomp3,
-    psF32           continuum,
-    psF32           exptime
-);
-
-/** Creates a new skyp_emission table
- *
- * @return true on success
- */
-
-bool skyp_emissionCreateTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Deletes a skyp_emission table
- *
- * @return true on success
- */
-
-bool skyp_emissionDropTable(
-    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 skyp_emissionInsert(
-    psDB            *dbh,               ///< Database handle
-    const char      *disperser_id,
-    psF32           atmcomp1,
-    psF32           atmcomp2,
-    psF32           atmcomp3,
-    psF32           continuum,
-    psF32           exptime
-);
-
-/** 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 skyp_emissionDelete(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-
-/** Insert a single skyp_emissionRow object into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool skyp_emissionInsertObject(
-    psDB            *dbh,               ///< Database handle
-    skyp_emissionRow *object             ///< skyp_emissionRow object
-);
-
-/** Insert an array of skyp_emissionRow object into a table
- *
- * This function constructs and inserts multiple rows based on it's parameters.
- *
- * @return true on success
- */
-
-bool skyp_emissionInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of skyp_emissionRow objects
-);
-
-/** Insert data from a binary FITS table skyp_emissionRow 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 skyp_emissionInsertFits(
-    psDB            *dbh,               ///< Database handle
-    const psFits    *fits               ///< psFits object
-);
-
-/** 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 skyp_emissionSelectRowsFits(
-    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 skyp_emissionRow into an equivalent psMetadata
- *
- * @return A psMetadata pointer or NULL on error
- */
-
-psMetadata *skyp_emissionMetadataFromObject(
-    const skyp_emissionRow *object             ///< fooRow to convert into a psMetadata
-);
-
-/** Convert a psMetadata into an equivalent fooRow
- *
- * @return A skyp_emissionRow pointer or NULL on error
- */
-
-skyp_emissionRow *skyp_emissionObjectFromMetadata(
-    psMetadata      *md                 ///< psMetadata to convert into a fooRow
-);
-/** Selects up to limit rows from the database and returns as skyp_emissionRow objects in a psArray
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return A psArray pointer or NULL on error
- */
-
-psArray *skyp_emissionSelectRowObjects(
-    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 skyp_emission
- *
- *  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 skyp_emissionDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const skyp_emissionRow *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 skyp_emissionDeleteRowObjects(
-    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 skyp_emissionRow 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 skyp_emissionPrintObjects(
-    FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of skyp_emissionRow objects
-    bool            mdcf                ///< format as mdconfig or simple
-);
-/** dimmRow data structure
- *
- * Structure for representing a single row of dimm table data.
- */
-
-typedef struct {
-    psF32           sigmax;
-    psF32           sigmay;
-    psF32           fwhm;
-    psF64           ra;
-    psF64           decl;
-    psF32           expttime;
-    char            *telescope_id;
-} dimmRow;
-
-/** Creates a new dimmRow object
- *
- *  @return A new dimmRow object or NULL on failure.
- */
-
-dimmRow *dimmRowAlloc(
-    psF32           sigmax,
-    psF32           sigmay,
-    psF32           fwhm,
-    psF64           ra,
-    psF64           decl,
-    psF32           expttime,
-    const char      *telescope_id
-);
-
-/** Creates a new dimm table
- *
- * @return true on success
- */
-
-bool dimmCreateTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Deletes a dimm table
- *
- * @return true on success
- */
-
-bool dimmDropTable(
-    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 dimmInsert(
-    psDB            *dbh,               ///< Database handle
-    psF32           sigmax,
-    psF32           sigmay,
-    psF32           fwhm,
-    psF64           ra,
-    psF64           decl,
-    psF32           expttime,
-    const char      *telescope_id
-);
-
-/** 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 dimmDelete(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-
-/** Insert a single dimmRow object into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool dimmInsertObject(
-    psDB            *dbh,               ///< Database handle
-    dimmRow         *object             ///< dimmRow object
-);
-
-/** Insert an array of dimmRow object into a table
- *
- * This function constructs and inserts multiple rows based on it's parameters.
- *
- * @return true on success
- */
-
-bool dimmInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of dimmRow objects
-);
-
-/** Insert data from a binary FITS table dimmRow 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 dimmInsertFits(
-    psDB            *dbh,               ///< Database handle
-    const psFits    *fits               ///< psFits object
-);
-
-/** 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 dimmSelectRowsFits(
-    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 dimmRow into an equivalent psMetadata
- *
- * @return A psMetadata pointer or NULL on error
- */
-
-psMetadata *dimmMetadataFromObject(
-    const dimmRow   *object             ///< fooRow to convert into a psMetadata
-);
-
-/** Convert a psMetadata into an equivalent fooRow
- *
- * @return A dimmRow pointer or NULL on error
- */
-
-dimmRow *dimmObjectFromMetadata(
-    psMetadata      *md                 ///< psMetadata to convert into a fooRow
-);
-/** Selects up to limit rows from the database and returns as dimmRow objects in a psArray
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return A psArray pointer or NULL on error
- */
-
-psArray *dimmSelectRowObjects(
-    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 dimm
- *
- *  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 dimmDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const dimmRow *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 dimmDeleteRowObjects(
-    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 dimmRow 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 dimmPrintObjects(
-    FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of dimmRow objects
-    bool            mdcf                ///< format as mdconfig or simple
-);
-/** skyp_irRow data structure
- *
- * Structure for representing a single row of skyp_ir table data.
- */
-
-typedef struct {
-    psF64           sky_bright;
-    psF64           sky_var;
-    psF64           ra;
-    psF64           decl;
-    psF32           fov_x;
-    psF32           fov_y;
-} skyp_irRow;
-
-/** Creates a new skyp_irRow object
- *
- *  @return A new skyp_irRow object or NULL on failure.
- */
-
-skyp_irRow *skyp_irRowAlloc(
-    psF64           sky_bright,
-    psF64           sky_var,
-    psF64           ra,
-    psF64           decl,
-    psF32           fov_x,
-    psF32           fov_y
-);
-
-/** Creates a new skyp_ir table
- *
- * @return true on success
- */
-
-bool skyp_irCreateTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Deletes a skyp_ir table
- *
- * @return true on success
- */
-
-bool skyp_irDropTable(
-    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 skyp_irInsert(
-    psDB            *dbh,               ///< Database handle
-    psF64           sky_bright,
-    psF64           sky_var,
-    psF64           ra,
-    psF64           decl,
-    psF32           fov_x,
-    psF32           fov_y
-);
-
-/** 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 skyp_irDelete(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-
-/** Insert a single skyp_irRow object into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool skyp_irInsertObject(
-    psDB            *dbh,               ///< Database handle
-    skyp_irRow      *object             ///< skyp_irRow object
-);
-
-/** Insert an array of skyp_irRow object into a table
- *
- * This function constructs and inserts multiple rows based on it's parameters.
- *
- * @return true on success
- */
-
-bool skyp_irInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of skyp_irRow objects
-);
-
-/** Insert data from a binary FITS table skyp_irRow 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 skyp_irInsertFits(
-    psDB            *dbh,               ///< Database handle
-    const psFits    *fits               ///< psFits object
-);
-
-/** 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 skyp_irSelectRowsFits(
-    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 skyp_irRow into an equivalent psMetadata
- *
- * @return A psMetadata pointer or NULL on error
- */
-
-psMetadata *skyp_irMetadataFromObject(
-    const skyp_irRow *object             ///< fooRow to convert into a psMetadata
-);
-
-/** Convert a psMetadata into an equivalent fooRow
- *
- * @return A skyp_irRow pointer or NULL on error
- */
-
-skyp_irRow *skyp_irObjectFromMetadata(
-    psMetadata      *md                 ///< psMetadata to convert into a fooRow
-);
-/** Selects up to limit rows from the database and returns as skyp_irRow objects in a psArray
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return A psArray pointer or NULL on error
- */
-
-psArray *skyp_irSelectRowObjects(
-    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 skyp_ir
- *
- *  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 skyp_irDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const skyp_irRow *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 skyp_irDeleteRowObjects(
-    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 skyp_irRow 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 skyp_irPrintObjects(
-    FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of skyp_irRow objects
-    bool            mdcf                ///< format as mdconfig or simple
-);
-/** domeRow data structure
- *
- * Structure for representing a single row of dome table data.
- */
-
-typedef struct {
-    psF32           az;
-    bool            open;
-    bool            light;
-    bool            track;
-} domeRow;
-
-/** Creates a new domeRow object
- *
- *  @return A new domeRow object or NULL on failure.
- */
-
-domeRow *domeRowAlloc(
-    psF32           az,
-    bool            open,
-    bool            light,
-    bool            track
-);
-
-/** Creates a new dome table
- *
- * @return true on success
- */
-
-bool domeCreateTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Deletes a dome table
- *
- * @return true on success
- */
-
-bool domeDropTable(
-    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 domeInsert(
-    psDB            *dbh,               ///< Database handle
-    psF32           az,
-    bool            open,
-    bool            light,
-    bool            track
-);
-
-/** 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 domeDelete(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-
-/** Insert a single domeRow object into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool domeInsertObject(
-    psDB            *dbh,               ///< Database handle
-    domeRow         *object             ///< domeRow object
-);
-
-/** Insert an array of domeRow object into a table
- *
- * This function constructs and inserts multiple rows based on it's parameters.
- *
- * @return true on success
- */
-
-bool domeInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of domeRow objects
-);
-
-/** Insert data from a binary FITS table domeRow 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 domeInsertFits(
-    psDB            *dbh,               ///< Database handle
-    const psFits    *fits               ///< psFits object
-);
-
-/** 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 domeSelectRowsFits(
-    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 domeRow into an equivalent psMetadata
- *
- * @return A psMetadata pointer or NULL on error
- */
-
-psMetadata *domeMetadataFromObject(
-    const domeRow   *object             ///< fooRow to convert into a psMetadata
-);
-
-/** Convert a psMetadata into an equivalent fooRow
- *
- * @return A domeRow pointer or NULL on error
- */
-
-domeRow *domeObjectFromMetadata(
-    psMetadata      *md                 ///< psMetadata to convert into a fooRow
-);
-/** Selects up to limit rows from the database and returns as domeRow objects in a psArray
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return A psArray pointer or NULL on error
- */
-
-psArray *domeSelectRowObjects(
-    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 dome
- *
- *  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 domeDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const domeRow *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 domeDeleteRowObjects(
-    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 domeRow 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 domePrintObjects(
-    FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of domeRow objects
-    bool            mdcf                ///< format as mdconfig or simple
-);
-/** telescopeRow data structure
- *
- * Structure for representing a single row of telescope table data.
- */
-
-typedef struct {
-    char            *guide;
-    psF32           alt;
-    psF32           az;
-    psF64           ra;
-    psF64           decl;
-} telescopeRow;
-
-/** Creates a new telescopeRow object
- *
- *  @return A new telescopeRow object or NULL on failure.
- */
-
-telescopeRow *telescopeRowAlloc(
-    const char      *guide,
-    psF32           alt,
-    psF32           az,
-    psF64           ra,
-    psF64           decl
-);
-
-/** Creates a new telescope table
- *
- * @return true on success
- */
-
-bool telescopeCreateTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Deletes a telescope table
- *
- * @return true on success
- */
-
-bool telescopeDropTable(
-    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 telescopeInsert(
-    psDB            *dbh,               ///< Database handle
-    const char      *guide,
-    psF32           alt,
-    psF32           az,
-    psF64           ra,
-    psF64           decl
-);
-
-/** 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 telescopeDelete(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-
-/** Insert a single telescopeRow object into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool telescopeInsertObject(
-    psDB            *dbh,               ///< Database handle
-    telescopeRow    *object             ///< telescopeRow object
-);
-
-/** Insert an array of telescopeRow object into a table
- *
- * This function constructs and inserts multiple rows based on it's parameters.
- *
- * @return true on success
- */
-
-bool telescopeInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of telescopeRow objects
-);
-
-/** Insert data from a binary FITS table telescopeRow 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 telescopeInsertFits(
-    psDB            *dbh,               ///< Database handle
-    const psFits    *fits               ///< psFits object
-);
-
-/** 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 telescopeSelectRowsFits(
-    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 telescopeRow into an equivalent psMetadata
- *
- * @return A psMetadata pointer or NULL on error
- */
-
-psMetadata *telescopeMetadataFromObject(
-    const telescopeRow *object             ///< fooRow to convert into a psMetadata
-);
-
-/** Convert a psMetadata into an equivalent fooRow
- *
- * @return A telescopeRow pointer or NULL on error
- */
-
-telescopeRow *telescopeObjectFromMetadata(
-    psMetadata      *md                 ///< psMetadata to convert into a fooRow
-);
-/** Selects up to limit rows from the database and returns as telescopeRow objects in a psArray
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return A psArray pointer or NULL on error
- */
-
-psArray *telescopeSelectRowObjects(
-    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 telescope
- *
- *  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 telescopeDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const telescopeRow *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 telescopeDeleteRowObjects(
-    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 telescopeRow 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 telescopePrintObjects(
-    FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of telescopeRow objects
-    bool            mdcf                ///< format as mdconfig or simple
-);
 /** summitExpRow data structure
  *
@@ -2713,4 +1128,5 @@
     psF64           posang;
     char            *object;
+    psTime*         dateobs;
 } rawDetrendExpRow;
 
@@ -2738,5 +1154,6 @@
     psF32           ccd_temp,
     psF64           posang,
-    const char      *object
+    const char      *object,
+    psTime*         dateobs
 );
 
@@ -2785,5 +1202,6 @@
     psF32           ccd_temp,
     psF64           posang,
-    const char      *object
+    const char      *object,
+    psTime*         dateobs
 );
 
@@ -2946,4 +1364,5 @@
     psF64           posang;
     char            *object;
+    psTime*         dateobs;
 } rawScienceExpRow;
 
@@ -2971,5 +1390,6 @@
     psF32           ccd_temp,
     psF64           posang,
-    const char      *object
+    const char      *object,
+    psTime*         dateobs
 );
 
@@ -3018,5 +1438,6 @@
     psF32           ccd_temp,
     psF64           posang,
-    const char      *object
+    const char      *object,
+    psTime*         dateobs
 );
 
@@ -3179,4 +1600,5 @@
     psF64           posang;
     char            *object;
+    psTime*         dateobs;
 } rawImfileRow;
 
@@ -3204,5 +1626,6 @@
     psF32           ccd_temp,
     psF64           posang,
-    const char      *object
+    const char      *object,
+    psTime*         dateobs
 );
 
@@ -3251,5 +1674,6 @@
     psF32           ccd_temp,
     psF64           posang,
-    const char      *object
+    const char      *object,
+    psTime*         dateobs
 );
 
