IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 13, 2007, 12:33:39 PM (19 years ago)
Author:
jhoblitt
Message:

VERSION 1.1.5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/src/ippdb.h

    r11733 r11780  
    68366836
    68376837typedef struct {
    6838     psS32           p4a_id;
     6838    psS32           p4_id;
    68396839    char            *mode;
    68406840    char            *state;
     
    68496849
    68506850p4RunRow *p4RunRowAlloc(
    6851     psS32           p4a_id,
     6851    psS32           p4_id,
    68526852    const char      *mode,
    68536853    const char      *state,
     
    68836883bool p4RunInsert(
    68846884    psDB            *dbh,               ///< Database handle
    6885     psS32           p4a_id,
     6885    psS32           p4_id,
    68866886    const char      *mode,
    68876887    const char      *state,
     
    70437043
    70447044typedef struct {
    7045     psS32           p4a_id;
     7045    psS32           p4_id;
    70467046    char            *exp_tag;
    70477047    psS32           p3_version;
     
    70557055
    70567056p4InputExpRow *p4InputExpRowAlloc(
    7057     psS32           p4a_id,
     7057    psS32           p4_id,
    70587058    const char      *exp_tag,
    70597059    psS32           p3_version,
     
    70887088bool p4InputExpInsert(
    70897089    psDB            *dbh,               ///< Database handle
    7090     psS32           p4a_id,
     7090    psS32           p4_id,
    70917091    const char      *exp_tag,
    70927092    psS32           p3_version,
     
    72417241    bool            mdcf                ///< format as mdconfig or simple
    72427242);
     7243/** p4SkyCellMapRow data structure
     7244 *
     7245 * Structure for representing a single row of p4SkyCellMap table data.
     7246 */
     7247
     7248typedef struct {
     7249    psS32           p4_id;
     7250    char            *skycell_id;
     7251    char            *tess_id;
     7252    char            *exp_tag;
     7253    psS32           p3_version;
     7254    char            *class_id;
     7255} p4SkyCellMapRow;
     7256
     7257/** Creates a new p4SkyCellMapRow object
     7258 *
     7259 *  @return A new p4SkyCellMapRow object or NULL on failure.
     7260 */
     7261
     7262p4SkyCellMapRow *p4SkyCellMapRowAlloc(
     7263    psS32           p4_id,
     7264    const char      *skycell_id,
     7265    const char      *tess_id,
     7266    const char      *exp_tag,
     7267    psS32           p3_version,
     7268    const char      *class_id
     7269);
     7270
     7271/** Creates a new p4SkyCellMap table
     7272 *
     7273 * @return true on success
     7274 */
     7275
     7276bool p4SkyCellMapCreateTable(
     7277    psDB            *dbh                ///< Database handle
     7278);
     7279
     7280/** Deletes a p4SkyCellMap table
     7281 *
     7282 * @return true on success
     7283 */
     7284
     7285bool p4SkyCellMapDropTable(
     7286    psDB            *dbh                ///< Database handle
     7287);
     7288
     7289/** Insert a single row into a table
     7290 *
     7291 * This function constructs and inserts a single row based on it's parameters.
     7292 *
     7293 * @return true on success
     7294 */
     7295
     7296bool p4SkyCellMapInsert(
     7297    psDB            *dbh,               ///< Database handle
     7298    psS32           p4_id,
     7299    const char      *skycell_id,
     7300    const char      *tess_id,
     7301    const char      *exp_tag,
     7302    psS32           p3_version,
     7303    const char      *class_id
     7304);
     7305
     7306/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     7307 *
     7308 * @return A The number of rows removed or a negative value on error
     7309 */
     7310
     7311long long p4SkyCellMapDelete(
     7312    psDB            *dbh,               ///< Database handle
     7313    const psMetadata *where,            ///< Row match criteria
     7314    unsigned long long limit            ///< Maximum number of elements to delete
     7315);
     7316
     7317/** Insert a single p4SkyCellMapRow object into a table
     7318 *
     7319 * This function constructs and inserts a single row based on it's parameters.
     7320 *
     7321 * @return true on success
     7322 */
     7323
     7324bool p4SkyCellMapInsertObject(
     7325    psDB            *dbh,               ///< Database handle
     7326    p4SkyCellMapRow *object             ///< p4SkyCellMapRow object
     7327);
     7328
     7329/** Insert an array of p4SkyCellMapRow object into a table
     7330 *
     7331 * This function constructs and inserts multiple rows based on it's parameters.
     7332 *
     7333 * @return true on success
     7334 */
     7335
     7336bool p4SkyCellMapInsertObjects(
     7337    psDB            *dbh,               ///< Database handle
     7338    psArray         *objects            ///< array of p4SkyCellMapRow objects
     7339);
     7340
     7341/** Insert data from a binary FITS table p4SkyCellMapRow into the database
     7342 *
     7343 * This function expects a psFits object with a FITS table as the first
     7344 * extension.  The table must have at least one row of data in it, that is of
     7345 * the appropriate format (number of columns and their type).  All other
     7346 * extensions are ignored.
     7347 *
     7348 * @return true on success
     7349 */
     7350
     7351bool p4SkyCellMapInsertFits(
     7352    psDB            *dbh,               ///< Database handle
     7353    const psFits    *fits               ///< psFits object
     7354);
     7355
     7356/** Selects up to limit from the database and returns them in a binary FITS table
     7357 *
     7358 * This function assumes an empty psFits object and will create a FITS table
     7359 * as the first extension.
     7360 *
     7361 *  See psDBSelectRows() for documentation on the format of where.
     7362 *
     7363 * @return true on success
     7364 */
     7365
     7366bool p4SkyCellMapSelectRowsFits(
     7367    psDB            *dbh,               ///< Database handle
     7368    psFits          *fits,              ///< psFits object
     7369    const psMetadata *where,            ///< Row match criteria
     7370    unsigned long long limit            ///< Maximum number of elements to return
     7371);
     7372
     7373/** Convert a p4SkyCellMapRow into an equivalent psMetadata
     7374 *
     7375 * @return A psMetadata pointer or NULL on error
     7376 */
     7377
     7378psMetadata *p4SkyCellMapMetadataFromObject(
     7379    const p4SkyCellMapRow *object             ///< fooRow to convert into a psMetadata
     7380);
     7381
     7382/** Convert a psMetadata into an equivalent fooRow
     7383 *
     7384 * @return A p4SkyCellMapRow pointer or NULL on error
     7385 */
     7386
     7387p4SkyCellMapRow *p4SkyCellMapObjectFromMetadata(
     7388    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     7389);
     7390/** Selects up to limit rows from the database and returns as p4SkyCellMapRow objects in a psArray
     7391 *
     7392 *  See psDBSelectRows() for documentation on the format of where.
     7393 *
     7394 * @return A psArray pointer or NULL on error
     7395 */
     7396
     7397psArray *p4SkyCellMapSelectRowObjects(
     7398    psDB            *dbh,               ///< Database handle
     7399    const psMetadata *where,            ///< Row match criteria
     7400    unsigned long long limit            ///< Maximum number of elements to return
     7401);
     7402/** Deletes a row from the database coresponding to an p4SkyCellMap
     7403 *
     7404 *  Note that a 'where' search psMetadata is constructed from each object and
     7405 *  used to find rows to delete.
     7406 *
     7407 * @return A The number of rows removed or a negative value on error
     7408 */
     7409
     7410bool p4SkyCellMapDeleteObject(
     7411    psDB            *dbh,               ///< Database handle
     7412    const p4SkyCellMapRow *object    ///< Object to delete
     7413);
     7414/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     7415 *
     7416 *  Note that a 'where' search psMetadata is constructed from each object and
     7417 *  used to find rows to delete.
     7418 *
     7419 * @return A The number of rows removed or a negative value on error
     7420 */
     7421
     7422long long p4SkyCellMapDeleteRowObjects(
     7423    psDB            *dbh,               ///< Database handle
     7424    const psArray   *objects,           ///< Array of objects to delete
     7425    unsigned long long limit            ///< Maximum number of elements to delete
     7426);
     7427/** Formats and prints an array of p4SkyCellMapRow objects
     7428 *
     7429 * When mdcf is set the formated output is in psMetadataConfig
     7430 * format, otherwise it is in a simple tabular format.
     7431 *
     7432 * @return true on success
     7433 */
     7434
     7435bool p4SkyCellMapPrintObjects(
     7436    FILE            *stream,            ///< a stream
     7437    psArray         *objects,           ///< An array of p4SkyCellMapRow objects
     7438    bool            mdcf                ///< format as mdconfig or simple
     7439);
     7440/** Formats and prints an p4SkyCellMapRow object
     7441 *
     7442 * When mdcf is set the formated output is in psMetadataConfig
     7443 * format, otherwise it is in a simple tabular format.
     7444 *
     7445 * @return true on success
     7446 */
     7447
     7448bool p4SkyCellMapPrintObject(
     7449    FILE            *stream,            ///< a stream
     7450    p4SkyCellMapRow *object,    ///< an p4SkyCellMapRow object
     7451    bool            mdcf                ///< format as mdconfig or simple
     7452);
    72437453/** p4ScfileRow data structure
    72447454 *
     
    72477457
    72487458typedef struct {
    7249     psS32           p4a_id;
     7459    psS32           p4_id;
    72507460    char            *skycell_id;
    72517461    char            *tess_id;
     
    72637473
    72647474p4ScfileRow *p4ScfileRowAlloc(
    7265     psS32           p4a_id,
     7475    psS32           p4_id,
    72667476    const char      *skycell_id,
    72677477    const char      *tess_id,
     
    73007510bool p4ScfileInsert(
    73017511    psDB            *dbh,               ///< Database handle
    7302     psS32           p4a_id,
     7512    psS32           p4_id,
    73037513    const char      *skycell_id,
    73047514    const char      *tess_id,
     
    74577667    bool            mdcf                ///< format as mdconfig or simple
    74587668);
    7459 /** p4InputScfileRow data structure
    7460  *
    7461  * Structure for representing a single row of p4InputScfile table data.
    7462  */
    7463 
    7464 typedef struct {
    7465     psS32           p4b_id;
    7466     char            *skycell_id;
    7467     char            *tess_id;
    7468     char            *exp_tag;
    7469     psS32           p3_version;
    7470     char            *kind;
    7471 } p4InputScfileRow;
    7472 
    7473 /** Creates a new p4InputScfileRow object
    7474  *
    7475  *  @return A new p4InputScfileRow object or NULL on failure.
    7476  */
    7477 
    7478 p4InputScfileRow *p4InputScfileRowAlloc(
    7479     psS32           p4b_id,
    7480     const char      *skycell_id,
    7481     const char      *tess_id,
    7482     const char      *exp_tag,
    7483     psS32           p3_version,
    7484     const char      *kind
    7485 );
    7486 
    7487 /** Creates a new p4InputScfile table
    7488  *
    7489  * @return true on success
    7490  */
    7491 
    7492 bool p4InputScfileCreateTable(
    7493     psDB            *dbh                ///< Database handle
    7494 );
    7495 
    7496 /** Deletes a p4InputScfile table
    7497  *
    7498  * @return true on success
    7499  */
    7500 
    7501 bool p4InputScfileDropTable(
    7502     psDB            *dbh                ///< Database handle
    7503 );
    7504 
    7505 /** Insert a single row into a table
    7506  *
    7507  * This function constructs and inserts a single row based on it's parameters.
    7508  *
    7509  * @return true on success
    7510  */
    7511 
    7512 bool p4InputScfileInsert(
    7513     psDB            *dbh,               ///< Database handle
    7514     psS32           p4b_id,
    7515     const char      *skycell_id,
    7516     const char      *tess_id,
    7517     const char      *exp_tag,
    7518     psS32           p3_version,
    7519     const char      *kind
    7520 );
    7521 
    7522 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    7523  *
    7524  * @return A The number of rows removed or a negative value on error
    7525  */
    7526 
    7527 long long p4InputScfileDelete(
    7528     psDB            *dbh,               ///< Database handle
    7529     const psMetadata *where,            ///< Row match criteria
    7530     unsigned long long limit            ///< Maximum number of elements to delete
    7531 );
    7532 
    7533 /** Insert a single p4InputScfileRow object into a table
    7534  *
    7535  * This function constructs and inserts a single row based on it's parameters.
    7536  *
    7537  * @return true on success
    7538  */
    7539 
    7540 bool p4InputScfileInsertObject(
    7541     psDB            *dbh,               ///< Database handle
    7542     p4InputScfileRow *object             ///< p4InputScfileRow object
    7543 );
    7544 
    7545 /** Insert an array of p4InputScfileRow object into a table
    7546  *
    7547  * This function constructs and inserts multiple rows based on it's parameters.
    7548  *
    7549  * @return true on success
    7550  */
    7551 
    7552 bool p4InputScfileInsertObjects(
    7553     psDB            *dbh,               ///< Database handle
    7554     psArray         *objects            ///< array of p4InputScfileRow objects
    7555 );
    7556 
    7557 /** Insert data from a binary FITS table p4InputScfileRow into the database
    7558  *
    7559  * This function expects a psFits object with a FITS table as the first
    7560  * extension.  The table must have at least one row of data in it, that is of
    7561  * the appropriate format (number of columns and their type).  All other
    7562  * extensions are ignored.
    7563  *
    7564  * @return true on success
    7565  */
    7566 
    7567 bool p4InputScfileInsertFits(
    7568     psDB            *dbh,               ///< Database handle
    7569     const psFits    *fits               ///< psFits object
    7570 );
    7571 
    7572 /** Selects up to limit from the database and returns them in a binary FITS table
    7573  *
    7574  * This function assumes an empty psFits object and will create a FITS table
    7575  * as the first extension.
    7576  *
    7577  *  See psDBSelectRows() for documentation on the format of where.
    7578  *
    7579  * @return true on success
    7580  */
    7581 
    7582 bool p4InputScfileSelectRowsFits(
    7583     psDB            *dbh,               ///< Database handle
    7584     psFits          *fits,              ///< psFits object
    7585     const psMetadata *where,            ///< Row match criteria
    7586     unsigned long long limit            ///< Maximum number of elements to return
    7587 );
    7588 
    7589 /** Convert a p4InputScfileRow into an equivalent psMetadata
    7590  *
    7591  * @return A psMetadata pointer or NULL on error
    7592  */
    7593 
    7594 psMetadata *p4InputScfileMetadataFromObject(
    7595     const p4InputScfileRow *object             ///< fooRow to convert into a psMetadata
    7596 );
    7597 
    7598 /** Convert a psMetadata into an equivalent fooRow
    7599  *
    7600  * @return A p4InputScfileRow pointer or NULL on error
    7601  */
    7602 
    7603 p4InputScfileRow *p4InputScfileObjectFromMetadata(
    7604     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    7605 );
    7606 /** Selects up to limit rows from the database and returns as p4InputScfileRow objects in a psArray
    7607  *
    7608  *  See psDBSelectRows() for documentation on the format of where.
    7609  *
    7610  * @return A psArray pointer or NULL on error
    7611  */
    7612 
    7613 psArray *p4InputScfileSelectRowObjects(
    7614     psDB            *dbh,               ///< Database handle
    7615     const psMetadata *where,            ///< Row match criteria
    7616     unsigned long long limit            ///< Maximum number of elements to return
    7617 );
    7618 /** Deletes a row from the database coresponding to an p4InputScfile
    7619  *
    7620  *  Note that a 'where' search psMetadata is constructed from each object and
    7621  *  used to find rows to delete.
    7622  *
    7623  * @return A The number of rows removed or a negative value on error
    7624  */
    7625 
    7626 bool p4InputScfileDeleteObject(
    7627     psDB            *dbh,               ///< Database handle
    7628     const p4InputScfileRow *object    ///< Object to delete
    7629 );
    7630 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    7631  *
    7632  *  Note that a 'where' search psMetadata is constructed from each object and
    7633  *  used to find rows to delete.
    7634  *
    7635  * @return A The number of rows removed or a negative value on error
    7636  */
    7637 
    7638 long long p4InputScfileDeleteRowObjects(
    7639     psDB            *dbh,               ///< Database handle
    7640     const psArray   *objects,           ///< Array of objects to delete
    7641     unsigned long long limit            ///< Maximum number of elements to delete
    7642 );
    7643 /** Formats and prints an array of p4InputScfileRow objects
    7644  *
    7645  * When mdcf is set the formated output is in psMetadataConfig
    7646  * format, otherwise it is in a simple tabular format.
    7647  *
    7648  * @return true on success
    7649  */
    7650 
    7651 bool p4InputScfilePrintObjects(
    7652     FILE            *stream,            ///< a stream
    7653     psArray         *objects,           ///< An array of p4InputScfileRow objects
    7654     bool            mdcf                ///< format as mdconfig or simple
    7655 );
    7656 /** Formats and prints an p4InputScfileRow object
    7657  *
    7658  * When mdcf is set the formated output is in psMetadataConfig
    7659  * format, otherwise it is in a simple tabular format.
    7660  *
    7661  * @return true on success
    7662  */
    7663 
    7664 bool p4InputScfilePrintObject(
    7665     FILE            *stream,            ///< a stream
    7666     p4InputScfileRow *object,    ///< an p4InputScfileRow object
    7667     bool            mdcf                ///< format as mdconfig or simple
    7668 );
    7669 /** p4DiffScfileRow data structure
    7670  *
    7671  * Structure for representing a single row of p4DiffScfile table data.
    7672  */
    7673 
    7674 typedef struct {
    7675     psS32           p4b_id;
    7676     char            *skycell_id;
    7677     char            *tess_id;
    7678     char            *exp_tag;
    7679     psS32           p3_version;
    7680     char            *uri;
    7681     psF64           bg;
    7682     psF64           bg_mean_stdev;
    7683 } p4DiffScfileRow;
    7684 
    7685 /** Creates a new p4DiffScfileRow object
    7686  *
    7687  *  @return A new p4DiffScfileRow object or NULL on failure.
    7688  */
    7689 
    7690 p4DiffScfileRow *p4DiffScfileRowAlloc(
    7691     psS32           p4b_id,
    7692     const char      *skycell_id,
    7693     const char      *tess_id,
    7694     const char      *exp_tag,
    7695     psS32           p3_version,
    7696     const char      *uri,
    7697     psF64           bg,
    7698     psF64           bg_mean_stdev
    7699 );
    7700 
    7701 /** Creates a new p4DiffScfile table
    7702  *
    7703  * @return true on success
    7704  */
    7705 
    7706 bool p4DiffScfileCreateTable(
    7707     psDB            *dbh                ///< Database handle
    7708 );
    7709 
    7710 /** Deletes a p4DiffScfile table
    7711  *
    7712  * @return true on success
    7713  */
    7714 
    7715 bool p4DiffScfileDropTable(
    7716     psDB            *dbh                ///< Database handle
    7717 );
    7718 
    7719 /** Insert a single row into a table
    7720  *
    7721  * This function constructs and inserts a single row based on it's parameters.
    7722  *
    7723  * @return true on success
    7724  */
    7725 
    7726 bool p4DiffScfileInsert(
    7727     psDB            *dbh,               ///< Database handle
    7728     psS32           p4b_id,
    7729     const char      *skycell_id,
    7730     const char      *tess_id,
    7731     const char      *exp_tag,
    7732     psS32           p3_version,
    7733     const char      *uri,
    7734     psF64           bg,
    7735     psF64           bg_mean_stdev
    7736 );
    7737 
    7738 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    7739  *
    7740  * @return A The number of rows removed or a negative value on error
    7741  */
    7742 
    7743 long long p4DiffScfileDelete(
    7744     psDB            *dbh,               ///< Database handle
    7745     const psMetadata *where,            ///< Row match criteria
    7746     unsigned long long limit            ///< Maximum number of elements to delete
    7747 );
    7748 
    7749 /** Insert a single p4DiffScfileRow object into a table
    7750  *
    7751  * This function constructs and inserts a single row based on it's parameters.
    7752  *
    7753  * @return true on success
    7754  */
    7755 
    7756 bool p4DiffScfileInsertObject(
    7757     psDB            *dbh,               ///< Database handle
    7758     p4DiffScfileRow *object             ///< p4DiffScfileRow object
    7759 );
    7760 
    7761 /** Insert an array of p4DiffScfileRow object into a table
    7762  *
    7763  * This function constructs and inserts multiple rows based on it's parameters.
    7764  *
    7765  * @return true on success
    7766  */
    7767 
    7768 bool p4DiffScfileInsertObjects(
    7769     psDB            *dbh,               ///< Database handle
    7770     psArray         *objects            ///< array of p4DiffScfileRow objects
    7771 );
    7772 
    7773 /** Insert data from a binary FITS table p4DiffScfileRow into the database
    7774  *
    7775  * This function expects a psFits object with a FITS table as the first
    7776  * extension.  The table must have at least one row of data in it, that is of
    7777  * the appropriate format (number of columns and their type).  All other
    7778  * extensions are ignored.
    7779  *
    7780  * @return true on success
    7781  */
    7782 
    7783 bool p4DiffScfileInsertFits(
    7784     psDB            *dbh,               ///< Database handle
    7785     const psFits    *fits               ///< psFits object
    7786 );
    7787 
    7788 /** Selects up to limit from the database and returns them in a binary FITS table
    7789  *
    7790  * This function assumes an empty psFits object and will create a FITS table
    7791  * as the first extension.
    7792  *
    7793  *  See psDBSelectRows() for documentation on the format of where.
    7794  *
    7795  * @return true on success
    7796  */
    7797 
    7798 bool p4DiffScfileSelectRowsFits(
    7799     psDB            *dbh,               ///< Database handle
    7800     psFits          *fits,              ///< psFits object
    7801     const psMetadata *where,            ///< Row match criteria
    7802     unsigned long long limit            ///< Maximum number of elements to return
    7803 );
    7804 
    7805 /** Convert a p4DiffScfileRow into an equivalent psMetadata
    7806  *
    7807  * @return A psMetadata pointer or NULL on error
    7808  */
    7809 
    7810 psMetadata *p4DiffScfileMetadataFromObject(
    7811     const p4DiffScfileRow *object             ///< fooRow to convert into a psMetadata
    7812 );
    7813 
    7814 /** Convert a psMetadata into an equivalent fooRow
    7815  *
    7816  * @return A p4DiffScfileRow pointer or NULL on error
    7817  */
    7818 
    7819 p4DiffScfileRow *p4DiffScfileObjectFromMetadata(
    7820     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    7821 );
    7822 /** Selects up to limit rows from the database and returns as p4DiffScfileRow objects in a psArray
    7823  *
    7824  *  See psDBSelectRows() for documentation on the format of where.
    7825  *
    7826  * @return A psArray pointer or NULL on error
    7827  */
    7828 
    7829 psArray *p4DiffScfileSelectRowObjects(
    7830     psDB            *dbh,               ///< Database handle
    7831     const psMetadata *where,            ///< Row match criteria
    7832     unsigned long long limit            ///< Maximum number of elements to return
    7833 );
    7834 /** Deletes a row from the database coresponding to an p4DiffScfile
    7835  *
    7836  *  Note that a 'where' search psMetadata is constructed from each object and
    7837  *  used to find rows to delete.
    7838  *
    7839  * @return A The number of rows removed or a negative value on error
    7840  */
    7841 
    7842 bool p4DiffScfileDeleteObject(
    7843     psDB            *dbh,               ///< Database handle
    7844     const p4DiffScfileRow *object    ///< Object to delete
    7845 );
    7846 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    7847  *
    7848  *  Note that a 'where' search psMetadata is constructed from each object and
    7849  *  used to find rows to delete.
    7850  *
    7851  * @return A The number of rows removed or a negative value on error
    7852  */
    7853 
    7854 long long p4DiffScfileDeleteRowObjects(
    7855     psDB            *dbh,               ///< Database handle
    7856     const psArray   *objects,           ///< Array of objects to delete
    7857     unsigned long long limit            ///< Maximum number of elements to delete
    7858 );
    7859 /** Formats and prints an array of p4DiffScfileRow objects
    7860  *
    7861  * When mdcf is set the formated output is in psMetadataConfig
    7862  * format, otherwise it is in a simple tabular format.
    7863  *
    7864  * @return true on success
    7865  */
    7866 
    7867 bool p4DiffScfilePrintObjects(
    7868     FILE            *stream,            ///< a stream
    7869     psArray         *objects,           ///< An array of p4DiffScfileRow objects
    7870     bool            mdcf                ///< format as mdconfig or simple
    7871 );
    7872 /** Formats and prints an p4DiffScfileRow object
    7873  *
    7874  * When mdcf is set the formated output is in psMetadataConfig
    7875  * format, otherwise it is in a simple tabular format.
    7876  *
    7877  * @return true on success
    7878  */
    7879 
    7880 bool p4DiffScfilePrintObject(
    7881     FILE            *stream,            ///< a stream
    7882     p4DiffScfileRow *object,    ///< an p4DiffScfileRow object
    7883     bool            mdcf                ///< format as mdconfig or simple
    7884 );
    7885 /** p4MagicMaskImfileRow data structure
    7886  *
    7887  * Structure for representing a single row of p4MagicMaskImfile table data.
    7888  */
    7889 
    7890 typedef struct {
    7891     psS32           p4c_id;
    7892     char            *exp_tag;
    7893     psS32           p3_version;
    7894     char            *class_id;
    7895     char            *uri;
    7896 } p4MagicMaskImfileRow;
    7897 
    7898 /** Creates a new p4MagicMaskImfileRow object
    7899  *
    7900  *  @return A new p4MagicMaskImfileRow object or NULL on failure.
    7901  */
    7902 
    7903 p4MagicMaskImfileRow *p4MagicMaskImfileRowAlloc(
    7904     psS32           p4c_id,
    7905     const char      *exp_tag,
    7906     psS32           p3_version,
    7907     const char      *class_id,
    7908     const char      *uri
    7909 );
    7910 
    7911 /** Creates a new p4MagicMaskImfile table
    7912  *
    7913  * @return true on success
    7914  */
    7915 
    7916 bool p4MagicMaskImfileCreateTable(
    7917     psDB            *dbh                ///< Database handle
    7918 );
    7919 
    7920 /** Deletes a p4MagicMaskImfile table
    7921  *
    7922  * @return true on success
    7923  */
    7924 
    7925 bool p4MagicMaskImfileDropTable(
    7926     psDB            *dbh                ///< Database handle
    7927 );
    7928 
    7929 /** Insert a single row into a table
    7930  *
    7931  * This function constructs and inserts a single row based on it's parameters.
    7932  *
    7933  * @return true on success
    7934  */
    7935 
    7936 bool p4MagicMaskImfileInsert(
    7937     psDB            *dbh,               ///< Database handle
    7938     psS32           p4c_id,
    7939     const char      *exp_tag,
    7940     psS32           p3_version,
    7941     const char      *class_id,
    7942     const char      *uri
    7943 );
    7944 
    7945 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    7946  *
    7947  * @return A The number of rows removed or a negative value on error
    7948  */
    7949 
    7950 long long p4MagicMaskImfileDelete(
    7951     psDB            *dbh,               ///< Database handle
    7952     const psMetadata *where,            ///< Row match criteria
    7953     unsigned long long limit            ///< Maximum number of elements to delete
    7954 );
    7955 
    7956 /** Insert a single p4MagicMaskImfileRow object into a table
    7957  *
    7958  * This function constructs and inserts a single row based on it's parameters.
    7959  *
    7960  * @return true on success
    7961  */
    7962 
    7963 bool p4MagicMaskImfileInsertObject(
    7964     psDB            *dbh,               ///< Database handle
    7965     p4MagicMaskImfileRow *object             ///< p4MagicMaskImfileRow object
    7966 );
    7967 
    7968 /** Insert an array of p4MagicMaskImfileRow object into a table
    7969  *
    7970  * This function constructs and inserts multiple rows based on it's parameters.
    7971  *
    7972  * @return true on success
    7973  */
    7974 
    7975 bool p4MagicMaskImfileInsertObjects(
    7976     psDB            *dbh,               ///< Database handle
    7977     psArray         *objects            ///< array of p4MagicMaskImfileRow objects
    7978 );
    7979 
    7980 /** Insert data from a binary FITS table p4MagicMaskImfileRow into the database
    7981  *
    7982  * This function expects a psFits object with a FITS table as the first
    7983  * extension.  The table must have at least one row of data in it, that is of
    7984  * the appropriate format (number of columns and their type).  All other
    7985  * extensions are ignored.
    7986  *
    7987  * @return true on success
    7988  */
    7989 
    7990 bool p4MagicMaskImfileInsertFits(
    7991     psDB            *dbh,               ///< Database handle
    7992     const psFits    *fits               ///< psFits object
    7993 );
    7994 
    7995 /** Selects up to limit from the database and returns them in a binary FITS table
    7996  *
    7997  * This function assumes an empty psFits object and will create a FITS table
    7998  * as the first extension.
    7999  *
    8000  *  See psDBSelectRows() for documentation on the format of where.
    8001  *
    8002  * @return true on success
    8003  */
    8004 
    8005 bool p4MagicMaskImfileSelectRowsFits(
    8006     psDB            *dbh,               ///< Database handle
    8007     psFits          *fits,              ///< psFits object
    8008     const psMetadata *where,            ///< Row match criteria
    8009     unsigned long long limit            ///< Maximum number of elements to return
    8010 );
    8011 
    8012 /** Convert a p4MagicMaskImfileRow into an equivalent psMetadata
    8013  *
    8014  * @return A psMetadata pointer or NULL on error
    8015  */
    8016 
    8017 psMetadata *p4MagicMaskImfileMetadataFromObject(
    8018     const p4MagicMaskImfileRow *object             ///< fooRow to convert into a psMetadata
    8019 );
    8020 
    8021 /** Convert a psMetadata into an equivalent fooRow
    8022  *
    8023  * @return A p4MagicMaskImfileRow pointer or NULL on error
    8024  */
    8025 
    8026 p4MagicMaskImfileRow *p4MagicMaskImfileObjectFromMetadata(
    8027     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    8028 );
    8029 /** Selects up to limit rows from the database and returns as p4MagicMaskImfileRow objects in a psArray
    8030  *
    8031  *  See psDBSelectRows() for documentation on the format of where.
    8032  *
    8033  * @return A psArray pointer or NULL on error
    8034  */
    8035 
    8036 psArray *p4MagicMaskImfileSelectRowObjects(
    8037     psDB            *dbh,               ///< Database handle
    8038     const psMetadata *where,            ///< Row match criteria
    8039     unsigned long long limit            ///< Maximum number of elements to return
    8040 );
    8041 /** Deletes a row from the database coresponding to an p4MagicMaskImfile
    8042  *
    8043  *  Note that a 'where' search psMetadata is constructed from each object and
    8044  *  used to find rows to delete.
    8045  *
    8046  * @return A The number of rows removed or a negative value on error
    8047  */
    8048 
    8049 bool p4MagicMaskImfileDeleteObject(
    8050     psDB            *dbh,               ///< Database handle
    8051     const p4MagicMaskImfileRow *object    ///< Object to delete
    8052 );
    8053 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    8054  *
    8055  *  Note that a 'where' search psMetadata is constructed from each object and
    8056  *  used to find rows to delete.
    8057  *
    8058  * @return A The number of rows removed or a negative value on error
    8059  */
    8060 
    8061 long long p4MagicMaskImfileDeleteRowObjects(
    8062     psDB            *dbh,               ///< Database handle
    8063     const psArray   *objects,           ///< Array of objects to delete
    8064     unsigned long long limit            ///< Maximum number of elements to delete
    8065 );
    8066 /** Formats and prints an array of p4MagicMaskImfileRow objects
    8067  *
    8068  * When mdcf is set the formated output is in psMetadataConfig
    8069  * format, otherwise it is in a simple tabular format.
    8070  *
    8071  * @return true on success
    8072  */
    8073 
    8074 bool p4MagicMaskImfilePrintObjects(
    8075     FILE            *stream,            ///< a stream
    8076     psArray         *objects,           ///< An array of p4MagicMaskImfileRow objects
    8077     bool            mdcf                ///< format as mdconfig or simple
    8078 );
    8079 /** Formats and prints an p4MagicMaskImfileRow object
    8080  *
    8081  * When mdcf is set the formated output is in psMetadataConfig
    8082  * format, otherwise it is in a simple tabular format.
    8083  *
    8084  * @return true on success
    8085  */
    8086 
    8087 bool p4MagicMaskImfilePrintObject(
    8088     FILE            *stream,            ///< a stream
    8089     p4MagicMaskImfileRow *object,    ///< an p4MagicMaskImfileRow object
    8090     bool            mdcf                ///< format as mdconfig or simple
    8091 );
    8092 /** skyCellRow data structure
    8093  *
    8094  * Structure for representing a single row of skyCell table data.
    8095  */
    8096 
    8097 typedef struct {
    8098     char            *skycell_id;
    8099     char            *tess_id;
    8100     psF64           ra1;
    8101     psF64           decl1;
    8102     psF64           ra2;
    8103     psF64           decl2;
    8104     psF64           ra3;
    8105     psF64           decl3;
    8106     psF64           ra4;
    8107     psF64           decl4;
    8108 } skyCellRow;
    8109 
    8110 /** Creates a new skyCellRow object
    8111  *
    8112  *  @return A new skyCellRow object or NULL on failure.
    8113  */
    8114 
    8115 skyCellRow *skyCellRowAlloc(
    8116     const char      *skycell_id,
    8117     const char      *tess_id,
    8118     psF64           ra1,
    8119     psF64           decl1,
    8120     psF64           ra2,
    8121     psF64           decl2,
    8122     psF64           ra3,
    8123     psF64           decl3,
    8124     psF64           ra4,
    8125     psF64           decl4
    8126 );
    8127 
    8128 /** Creates a new skyCell table
    8129  *
    8130  * @return true on success
    8131  */
    8132 
    8133 bool skyCellCreateTable(
    8134     psDB            *dbh                ///< Database handle
    8135 );
    8136 
    8137 /** Deletes a skyCell table
    8138  *
    8139  * @return true on success
    8140  */
    8141 
    8142 bool skyCellDropTable(
    8143     psDB            *dbh                ///< Database handle
    8144 );
    8145 
    8146 /** Insert a single row into a table
    8147  *
    8148  * This function constructs and inserts a single row based on it's parameters.
    8149  *
    8150  * @return true on success
    8151  */
    8152 
    8153 bool skyCellInsert(
    8154     psDB            *dbh,               ///< Database handle
    8155     const char      *skycell_id,
    8156     const char      *tess_id,
    8157     psF64           ra1,
    8158     psF64           decl1,
    8159     psF64           ra2,
    8160     psF64           decl2,
    8161     psF64           ra3,
    8162     psF64           decl3,
    8163     psF64           ra4,
    8164     psF64           decl4
    8165 );
    8166 
    8167 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    8168  *
    8169  * @return A The number of rows removed or a negative value on error
    8170  */
    8171 
    8172 long long skyCellDelete(
    8173     psDB            *dbh,               ///< Database handle
    8174     const psMetadata *where,            ///< Row match criteria
    8175     unsigned long long limit            ///< Maximum number of elements to delete
    8176 );
    8177 
    8178 /** Insert a single skyCellRow object into a table
    8179  *
    8180  * This function constructs and inserts a single row based on it's parameters.
    8181  *
    8182  * @return true on success
    8183  */
    8184 
    8185 bool skyCellInsertObject(
    8186     psDB            *dbh,               ///< Database handle
    8187     skyCellRow      *object             ///< skyCellRow object
    8188 );
    8189 
    8190 /** Insert an array of skyCellRow object into a table
    8191  *
    8192  * This function constructs and inserts multiple rows based on it's parameters.
    8193  *
    8194  * @return true on success
    8195  */
    8196 
    8197 bool skyCellInsertObjects(
    8198     psDB            *dbh,               ///< Database handle
    8199     psArray         *objects            ///< array of skyCellRow objects
    8200 );
    8201 
    8202 /** Insert data from a binary FITS table skyCellRow into the database
    8203  *
    8204  * This function expects a psFits object with a FITS table as the first
    8205  * extension.  The table must have at least one row of data in it, that is of
    8206  * the appropriate format (number of columns and their type).  All other
    8207  * extensions are ignored.
    8208  *
    8209  * @return true on success
    8210  */
    8211 
    8212 bool skyCellInsertFits(
    8213     psDB            *dbh,               ///< Database handle
    8214     const psFits    *fits               ///< psFits object
    8215 );
    8216 
    8217 /** Selects up to limit from the database and returns them in a binary FITS table
    8218  *
    8219  * This function assumes an empty psFits object and will create a FITS table
    8220  * as the first extension.
    8221  *
    8222  *  See psDBSelectRows() for documentation on the format of where.
    8223  *
    8224  * @return true on success
    8225  */
    8226 
    8227 bool skyCellSelectRowsFits(
    8228     psDB            *dbh,               ///< Database handle
    8229     psFits          *fits,              ///< psFits object
    8230     const psMetadata *where,            ///< Row match criteria
    8231     unsigned long long limit            ///< Maximum number of elements to return
    8232 );
    8233 
    8234 /** Convert a skyCellRow into an equivalent psMetadata
    8235  *
    8236  * @return A psMetadata pointer or NULL on error
    8237  */
    8238 
    8239 psMetadata *skyCellMetadataFromObject(
    8240     const skyCellRow *object             ///< fooRow to convert into a psMetadata
    8241 );
    8242 
    8243 /** Convert a psMetadata into an equivalent fooRow
    8244  *
    8245  * @return A skyCellRow pointer or NULL on error
    8246  */
    8247 
    8248 skyCellRow *skyCellObjectFromMetadata(
    8249     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    8250 );
    8251 /** Selects up to limit rows from the database and returns as skyCellRow objects in a psArray
    8252  *
    8253  *  See psDBSelectRows() for documentation on the format of where.
    8254  *
    8255  * @return A psArray pointer or NULL on error
    8256  */
    8257 
    8258 psArray *skyCellSelectRowObjects(
    8259     psDB            *dbh,               ///< Database handle
    8260     const psMetadata *where,            ///< Row match criteria
    8261     unsigned long long limit            ///< Maximum number of elements to return
    8262 );
    8263 /** Deletes a row from the database coresponding to an skyCell
    8264  *
    8265  *  Note that a 'where' search psMetadata is constructed from each object and
    8266  *  used to find rows to delete.
    8267  *
    8268  * @return A The number of rows removed or a negative value on error
    8269  */
    8270 
    8271 bool skyCellDeleteObject(
    8272     psDB            *dbh,               ///< Database handle
    8273     const skyCellRow *object    ///< Object to delete
    8274 );
    8275 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    8276  *
    8277  *  Note that a 'where' search psMetadata is constructed from each object and
    8278  *  used to find rows to delete.
    8279  *
    8280  * @return A The number of rows removed or a negative value on error
    8281  */
    8282 
    8283 long long skyCellDeleteRowObjects(
    8284     psDB            *dbh,               ///< Database handle
    8285     const psArray   *objects,           ///< Array of objects to delete
    8286     unsigned long long limit            ///< Maximum number of elements to delete
    8287 );
    8288 /** Formats and prints an array of skyCellRow objects
    8289  *
    8290  * When mdcf is set the formated output is in psMetadataConfig
    8291  * format, otherwise it is in a simple tabular format.
    8292  *
    8293  * @return true on success
    8294  */
    8295 
    8296 bool skyCellPrintObjects(
    8297     FILE            *stream,            ///< a stream
    8298     psArray         *objects,           ///< An array of skyCellRow objects
    8299     bool            mdcf                ///< format as mdconfig or simple
    8300 );
    8301 /** Formats and prints an skyCellRow object
    8302  *
    8303  * When mdcf is set the formated output is in psMetadataConfig
    8304  * format, otherwise it is in a simple tabular format.
    8305  *
    8306  * @return true on success
    8307  */
    8308 
    8309 bool skyCellPrintObject(
    8310     FILE            *stream,            ///< a stream
    8311     skyCellRow *object,    ///< an skyCellRow object
    8312     bool            mdcf                ///< format as mdconfig or simple
    8313 );
    8314 /** skyCellMapRow data structure
    8315  *
    8316  * Structure for representing a single row of skyCellMap table data.
    8317  */
    8318 
    8319 typedef struct {
    8320     char            *skycell_id;
    8321     char            *tess_id;
    8322     char            *exp_tag;
    8323     char            *class_id;
    8324 } skyCellMapRow;
    8325 
    8326 /** Creates a new skyCellMapRow object
    8327  *
    8328  *  @return A new skyCellMapRow object or NULL on failure.
    8329  */
    8330 
    8331 skyCellMapRow *skyCellMapRowAlloc(
    8332     const char      *skycell_id,
    8333     const char      *tess_id,
    8334     const char      *exp_tag,
    8335     const char      *class_id
    8336 );
    8337 
    8338 /** Creates a new skyCellMap table
    8339  *
    8340  * @return true on success
    8341  */
    8342 
    8343 bool skyCellMapCreateTable(
    8344     psDB            *dbh                ///< Database handle
    8345 );
    8346 
    8347 /** Deletes a skyCellMap table
    8348  *
    8349  * @return true on success
    8350  */
    8351 
    8352 bool skyCellMapDropTable(
    8353     psDB            *dbh                ///< Database handle
    8354 );
    8355 
    8356 /** Insert a single row into a table
    8357  *
    8358  * This function constructs and inserts a single row based on it's parameters.
    8359  *
    8360  * @return true on success
    8361  */
    8362 
    8363 bool skyCellMapInsert(
    8364     psDB            *dbh,               ///< Database handle
    8365     const char      *skycell_id,
    8366     const char      *tess_id,
    8367     const char      *exp_tag,
    8368     const char      *class_id
    8369 );
    8370 
    8371 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    8372  *
    8373  * @return A The number of rows removed or a negative value on error
    8374  */
    8375 
    8376 long long skyCellMapDelete(
    8377     psDB            *dbh,               ///< Database handle
    8378     const psMetadata *where,            ///< Row match criteria
    8379     unsigned long long limit            ///< Maximum number of elements to delete
    8380 );
    8381 
    8382 /** Insert a single skyCellMapRow object into a table
    8383  *
    8384  * This function constructs and inserts a single row based on it's parameters.
    8385  *
    8386  * @return true on success
    8387  */
    8388 
    8389 bool skyCellMapInsertObject(
    8390     psDB            *dbh,               ///< Database handle
    8391     skyCellMapRow   *object             ///< skyCellMapRow object
    8392 );
    8393 
    8394 /** Insert an array of skyCellMapRow object into a table
    8395  *
    8396  * This function constructs and inserts multiple rows based on it's parameters.
    8397  *
    8398  * @return true on success
    8399  */
    8400 
    8401 bool skyCellMapInsertObjects(
    8402     psDB            *dbh,               ///< Database handle
    8403     psArray         *objects            ///< array of skyCellMapRow objects
    8404 );
    8405 
    8406 /** Insert data from a binary FITS table skyCellMapRow into the database
    8407  *
    8408  * This function expects a psFits object with a FITS table as the first
    8409  * extension.  The table must have at least one row of data in it, that is of
    8410  * the appropriate format (number of columns and their type).  All other
    8411  * extensions are ignored.
    8412  *
    8413  * @return true on success
    8414  */
    8415 
    8416 bool skyCellMapInsertFits(
    8417     psDB            *dbh,               ///< Database handle
    8418     const psFits    *fits               ///< psFits object
    8419 );
    8420 
    8421 /** Selects up to limit from the database and returns them in a binary FITS table
    8422  *
    8423  * This function assumes an empty psFits object and will create a FITS table
    8424  * as the first extension.
    8425  *
    8426  *  See psDBSelectRows() for documentation on the format of where.
    8427  *
    8428  * @return true on success
    8429  */
    8430 
    8431 bool skyCellMapSelectRowsFits(
    8432     psDB            *dbh,               ///< Database handle
    8433     psFits          *fits,              ///< psFits object
    8434     const psMetadata *where,            ///< Row match criteria
    8435     unsigned long long limit            ///< Maximum number of elements to return
    8436 );
    8437 
    8438 /** Convert a skyCellMapRow into an equivalent psMetadata
    8439  *
    8440  * @return A psMetadata pointer or NULL on error
    8441  */
    8442 
    8443 psMetadata *skyCellMapMetadataFromObject(
    8444     const skyCellMapRow *object             ///< fooRow to convert into a psMetadata
    8445 );
    8446 
    8447 /** Convert a psMetadata into an equivalent fooRow
    8448  *
    8449  * @return A skyCellMapRow pointer or NULL on error
    8450  */
    8451 
    8452 skyCellMapRow *skyCellMapObjectFromMetadata(
    8453     psMetadata      *md                 ///< psMetadata to convert into a fooRow
    8454 );
    8455 /** Selects up to limit rows from the database and returns as skyCellMapRow objects in a psArray
    8456  *
    8457  *  See psDBSelectRows() for documentation on the format of where.
    8458  *
    8459  * @return A psArray pointer or NULL on error
    8460  */
    8461 
    8462 psArray *skyCellMapSelectRowObjects(
    8463     psDB            *dbh,               ///< Database handle
    8464     const psMetadata *where,            ///< Row match criteria
    8465     unsigned long long limit            ///< Maximum number of elements to return
    8466 );
    8467 /** Deletes a row from the database coresponding to an skyCellMap
    8468  *
    8469  *  Note that a 'where' search psMetadata is constructed from each object and
    8470  *  used to find rows to delete.
    8471  *
    8472  * @return A The number of rows removed or a negative value on error
    8473  */
    8474 
    8475 bool skyCellMapDeleteObject(
    8476     psDB            *dbh,               ///< Database handle
    8477     const skyCellMapRow *object    ///< Object to delete
    8478 );
    8479 /** Deletes up to limit rows from the database and returns the number of rows actually deleted.
    8480  *
    8481  *  Note that a 'where' search psMetadata is constructed from each object and
    8482  *  used to find rows to delete.
    8483  *
    8484  * @return A The number of rows removed or a negative value on error
    8485  */
    8486 
    8487 long long skyCellMapDeleteRowObjects(
    8488     psDB            *dbh,               ///< Database handle
    8489     const psArray   *objects,           ///< Array of objects to delete
    8490     unsigned long long limit            ///< Maximum number of elements to delete
    8491 );
    8492 /** Formats and prints an array of skyCellMapRow objects
    8493  *
    8494  * When mdcf is set the formated output is in psMetadataConfig
    8495  * format, otherwise it is in a simple tabular format.
    8496  *
    8497  * @return true on success
    8498  */
    8499 
    8500 bool skyCellMapPrintObjects(
    8501     FILE            *stream,            ///< a stream
    8502     psArray         *objects,           ///< An array of skyCellMapRow objects
    8503     bool            mdcf                ///< format as mdconfig or simple
    8504 );
    8505 /** Formats and prints an skyCellMapRow object
    8506  *
    8507  * When mdcf is set the formated output is in psMetadataConfig
    8508  * format, otherwise it is in a simple tabular format.
    8509  *
    8510  * @return true on success
    8511  */
    8512 
    8513 bool skyCellMapPrintObject(
    8514     FILE            *stream,            ///< a stream
    8515     skyCellMapRow *object,    ///< an skyCellMapRow object
    8516     bool            mdcf                ///< format as mdconfig or simple
    8517 );
    85187669
    85197670/// @}
     
    85237674#endif
    85247675
    8525 #endif // SKYCELLMAP_DB_H
     7676#endif // P4SCFILE_DB_H
Note: See TracChangeset for help on using the changeset viewer.