IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 6, 2007, 3:46:45 PM (19 years ago)
Author:
jhoblitt
Message:

VERSION 1.1.1

File:
1 edited

Legend:

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

    r11635 r11679  
    2020/*
    2121 *
    22  * This file was generated by glueforge 1.00
     22 * This file was generated by glueforge 0.36
    2323 *
    2424 * Do NOT directly edit this file.
     
    68306830    bool            mdcf                ///< format as mdconfig or simple
    68316831);
    6832 /** p4RunRow data structure
    6833  *
    6834  * Structure for representing a single row of p4Run table data.
     6832/** p4aRunRow data structure
     6833 *
     6834 * Structure for representing a single row of p4aRun table data.
    68356835 */
    68366836
    68376837typedef struct {
    6838     psS32           p4_id;
    6839     char            *survey_mode;
     6838    psS32           p4a_id;
    68406839    char            *state;
    68416840    char            *workdir;
    6842     char            *filter;
    6843     char            *skycell_id;
    6844     char            *tess_id;
    6845     psF64           ra;
    6846     psF64           decl;
    6847     char            *input_ss;
    6848     char            *output_ss;
    6849 } p4RunRow;
    6850 
    6851 /** Creates a new p4RunRow object
    6852  *
    6853  *  @return A new p4RunRow object or NULL on failure.
    6854  */
    6855 
    6856 p4RunRow *p4RunRowAlloc(
    6857     psS32           p4_id,
    6858     const char      *survey_mode,
     6841    bool            magic;
     6842} p4aRunRow;
     6843
     6844/** Creates a new p4aRunRow object
     6845 *
     6846 *  @return A new p4aRunRow object or NULL on failure.
     6847 */
     6848
     6849p4aRunRow *p4aRunRowAlloc(
     6850    psS32           p4a_id,
    68596851    const char      *state,
    68606852    const char      *workdir,
    6861     const char      *filter,
    6862     const char      *skycell_id,
    6863     const char      *tess_id,
    6864     psF64           ra,
    6865     psF64           decl,
    6866     const char      *input_ss,
    6867     const char      *output_ss
    6868 );
    6869 
    6870 /** Creates a new p4Run table
    6871  *
    6872  * @return true on success
    6873  */
    6874 
    6875 bool p4RunCreateTable(
     6853    bool            magic
     6854);
     6855
     6856/** Creates a new p4aRun table
     6857 *
     6858 * @return true on success
     6859 */
     6860
     6861bool p4aRunCreateTable(
    68766862    psDB            *dbh                ///< Database handle
    68776863);
    68786864
    6879 /** Deletes a p4Run table
    6880  *
    6881  * @return true on success
    6882  */
    6883 
    6884 bool p4RunDropTable(
     6865/** Deletes a p4aRun table
     6866 *
     6867 * @return true on success
     6868 */
     6869
     6870bool p4aRunDropTable(
    68856871    psDB            *dbh                ///< Database handle
    68866872);
     
    68936879 */
    68946880
    6895 bool p4RunInsert(
    6896     psDB            *dbh,               ///< Database handle
    6897     psS32           p4_id,
    6898     const char      *survey_mode,
     6881bool p4aRunInsert(
     6882    psDB            *dbh,               ///< Database handle
     6883    psS32           p4a_id,
    68996884    const char      *state,
    69006885    const char      *workdir,
    6901     const char      *filter,
    6902     const char      *skycell_id,
    6903     const char      *tess_id,
    6904     psF64           ra,
    6905     psF64           decl,
    6906     const char      *input_ss,
    6907     const char      *output_ss
     6886    bool            magic
    69086887);
    69096888
     
    69136892 */
    69146893
    6915 long long p4RunDelete(
     6894long long p4aRunDelete(
    69166895    psDB            *dbh,               ///< Database handle
    69176896    const psMetadata *where,            ///< Row match criteria
     
    69196898);
    69206899
    6921 /** Insert a single p4RunRow object into a table
     6900/** Insert a single p4aRunRow object into a table
    69226901 *
    69236902 * This function constructs and inserts a single row based on it's parameters.
     
    69266905 */
    69276906
    6928 bool p4RunInsertObject(
    6929     psDB            *dbh,               ///< Database handle
    6930     p4RunRow        *object             ///< p4RunRow object
    6931 );
    6932 
    6933 /** Insert an array of p4RunRow object into a table
     6907bool p4aRunInsertObject(
     6908    psDB            *dbh,               ///< Database handle
     6909    p4aRunRow       *object             ///< p4aRunRow object
     6910);
     6911
     6912/** Insert an array of p4aRunRow object into a table
    69346913 *
    69356914 * This function constructs and inserts multiple rows based on it's parameters.
     
    69386917 */
    69396918
    6940 bool p4RunInsertObjects(
    6941     psDB            *dbh,               ///< Database handle
    6942     psArray         *objects            ///< array of p4RunRow objects
    6943 );
    6944 
    6945 /** Insert data from a binary FITS table p4RunRow into the database
     6919bool p4aRunInsertObjects(
     6920    psDB            *dbh,               ///< Database handle
     6921    psArray         *objects            ///< array of p4aRunRow objects
     6922);
     6923
     6924/** Insert data from a binary FITS table p4aRunRow into the database
    69466925 *
    69476926 * This function expects a psFits object with a FITS table as the first
     
    69536932 */
    69546933
    6955 bool p4RunInsertFits(
     6934bool p4aRunInsertFits(
    69566935    psDB            *dbh,               ///< Database handle
    69576936    const psFits    *fits               ///< psFits object
     
    69686947 */
    69696948
    6970 bool p4RunSelectRowsFits(
     6949bool p4aRunSelectRowsFits(
    69716950    psDB            *dbh,               ///< Database handle
    69726951    psFits          *fits,              ///< psFits object
     
    69756954);
    69766955
    6977 /** Convert a p4RunRow into an equivalent psMetadata
     6956/** Convert a p4aRunRow into an equivalent psMetadata
    69786957 *
    69796958 * @return A psMetadata pointer or NULL on error
    69806959 */
    69816960
    6982 psMetadata *p4RunMetadataFromObject(
    6983     const p4RunRow *object             ///< fooRow to convert into a psMetadata
     6961psMetadata *p4aRunMetadataFromObject(
     6962    const p4aRunRow *object             ///< fooRow to convert into a psMetadata
    69846963);
    69856964
    69866965/** Convert a psMetadata into an equivalent fooRow
    69876966 *
    6988  * @return A p4RunRow pointer or NULL on error
    6989  */
    6990 
    6991 p4RunRow *p4RunObjectFromMetadata(
     6967 * @return A p4aRunRow pointer or NULL on error
     6968 */
     6969
     6970p4aRunRow *p4aRunObjectFromMetadata(
    69926971    psMetadata      *md                 ///< psMetadata to convert into a fooRow
    69936972);
    6994 /** Selects up to limit rows from the database and returns as p4RunRow objects in a psArray
     6973/** Selects up to limit rows from the database and returns as p4aRunRow objects in a psArray
    69956974 *
    69966975 *  See psDBSelectRows() for documentation on the format of where.
     
    69996978 */
    70006979
    7001 psArray *p4RunSelectRowObjects(
     6980psArray *p4aRunSelectRowObjects(
    70026981    psDB            *dbh,               ///< Database handle
    70036982    const psMetadata *where,            ///< Row match criteria
    70046983    unsigned long long limit            ///< Maximum number of elements to return
    70056984);
    7006 /** Deletes a row from the database coresponding to an p4Run
     6985/** Deletes a row from the database coresponding to an p4aRun
    70076986 *
    70086987 *  Note that a 'where' search psMetadata is constructed from each object and
     
    70126991 */
    70136992
    7014 bool p4RunDeleteObject(
    7015     psDB            *dbh,               ///< Database handle
    7016     const p4RunRow *object    ///< Object to delete
     6993bool p4aRunDeleteObject(
     6994    psDB            *dbh,               ///< Database handle
     6995    const p4aRunRow *object    ///< Object to delete
    70176996);
    70186997/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    70247003 */
    70257004
    7026 long long p4RunDeleteRowObjects(
     7005long long p4aRunDeleteRowObjects(
    70277006    psDB            *dbh,               ///< Database handle
    70287007    const psArray   *objects,           ///< Array of objects to delete
    70297008    unsigned long long limit            ///< Maximum number of elements to delete
    70307009);
    7031 /** Formats and prints an array of p4RunRow objects
     7010/** Formats and prints an array of p4aRunRow objects
    70327011 *
    70337012 * When mdcf is set the formated output is in psMetadataConfig
     
    70377016 */
    70387017
    7039 bool p4RunPrintObjects(
     7018bool p4aRunPrintObjects(
    70407019    FILE            *stream,            ///< a stream
    7041     psArray         *objects,           ///< An array of p4RunRow objects
     7020    psArray         *objects,           ///< An array of p4aRunRow objects
    70427021    bool            mdcf                ///< format as mdconfig or simple
    70437022);
    7044 /** Formats and prints an p4RunRow object
     7023/** Formats and prints an p4aRunRow object
    70457024 *
    70467025 * When mdcf is set the formated output is in psMetadataConfig
     
    70507029 */
    70517030
    7052 bool p4RunPrintObject(
     7031bool p4aRunPrintObject(
    70537032    FILE            *stream,            ///< a stream
    7054     p4RunRow *object,    ///< an p4RunRow object
     7033    p4aRunRow *object,    ///< an p4aRunRow object
    70557034    bool            mdcf                ///< format as mdconfig or simple
    70567035);
    7057 /** p4InputImfileRow data structure
    7058  *
    7059  * Structure for representing a single row of p4InputImfile table data.
     7036/** p4aInputExpRow data structure
     7037 *
     7038 * Structure for representing a single row of p4aInputExp table data.
    70607039 */
    70617040
    70627041typedef struct {
    7063     psS32           p4_id;
     7042    psS32           p4a_id;
    70647043    char            *exp_tag;
    70657044    psS32           p3_version;
    7066     char            *class_id;
    7067 } p4InputImfileRow;
    7068 
    7069 /** Creates a new p4InputImfileRow object
    7070  *
    7071  *  @return A new p4InputImfileRow object or NULL on failure.
    7072  */
    7073 
    7074 p4InputImfileRow *p4InputImfileRowAlloc(
    7075     psS32           p4_id,
     7045} p4aInputExpRow;
     7046
     7047/** Creates a new p4aInputExpRow object
     7048 *
     7049 *  @return A new p4aInputExpRow object or NULL on failure.
     7050 */
     7051
     7052p4aInputExpRow *p4aInputExpRowAlloc(
     7053    psS32           p4a_id,
    70767054    const char      *exp_tag,
    7077     psS32           p3_version,
    7078     const char      *class_id
    7079 );
    7080 
    7081 /** Creates a new p4InputImfile table
    7082  *
    7083  * @return true on success
    7084  */
    7085 
    7086 bool p4InputImfileCreateTable(
     7055    psS32           p3_version
     7056);
     7057
     7058/** Creates a new p4aInputExp table
     7059 *
     7060 * @return true on success
     7061 */
     7062
     7063bool p4aInputExpCreateTable(
    70877064    psDB            *dbh                ///< Database handle
    70887065);
    70897066
    7090 /** Deletes a p4InputImfile table
    7091  *
    7092  * @return true on success
    7093  */
    7094 
    7095 bool p4InputImfileDropTable(
     7067/** Deletes a p4aInputExp table
     7068 *
     7069 * @return true on success
     7070 */
     7071
     7072bool p4aInputExpDropTable(
    70967073    psDB            *dbh                ///< Database handle
    70977074);
     
    71047081 */
    71057082
    7106 bool p4InputImfileInsert(
    7107     psDB            *dbh,               ///< Database handle
    7108     psS32           p4_id,
     7083bool p4aInputExpInsert(
     7084    psDB            *dbh,               ///< Database handle
     7085    psS32           p4a_id,
    71097086    const char      *exp_tag,
    7110     psS32           p3_version,
    7111     const char      *class_id
     7087    psS32           p3_version
    71127088);
    71137089
     
    71177093 */
    71187094
    7119 long long p4InputImfileDelete(
     7095long long p4aInputExpDelete(
    71207096    psDB            *dbh,               ///< Database handle
    71217097    const psMetadata *where,            ///< Row match criteria
     
    71237099);
    71247100
    7125 /** Insert a single p4InputImfileRow object into a table
     7101/** Insert a single p4aInputExpRow object into a table
    71267102 *
    71277103 * This function constructs and inserts a single row based on it's parameters.
     
    71307106 */
    71317107
    7132 bool p4InputImfileInsertObject(
    7133     psDB            *dbh,               ///< Database handle
    7134     p4InputImfileRow *object             ///< p4InputImfileRow object
    7135 );
    7136 
    7137 /** Insert an array of p4InputImfileRow object into a table
     7108bool p4aInputExpInsertObject(
     7109    psDB            *dbh,               ///< Database handle
     7110    p4aInputExpRow  *object             ///< p4aInputExpRow object
     7111);
     7112
     7113/** Insert an array of p4aInputExpRow object into a table
    71387114 *
    71397115 * This function constructs and inserts multiple rows based on it's parameters.
     
    71427118 */
    71437119
    7144 bool p4InputImfileInsertObjects(
    7145     psDB            *dbh,               ///< Database handle
    7146     psArray         *objects            ///< array of p4InputImfileRow objects
    7147 );
    7148 
    7149 /** Insert data from a binary FITS table p4InputImfileRow into the database
     7120bool p4aInputExpInsertObjects(
     7121    psDB            *dbh,               ///< Database handle
     7122    psArray         *objects            ///< array of p4aInputExpRow objects
     7123);
     7124
     7125/** Insert data from a binary FITS table p4aInputExpRow into the database
    71507126 *
    71517127 * This function expects a psFits object with a FITS table as the first
     
    71577133 */
    71587134
    7159 bool p4InputImfileInsertFits(
     7135bool p4aInputExpInsertFits(
    71607136    psDB            *dbh,               ///< Database handle
    71617137    const psFits    *fits               ///< psFits object
     
    71727148 */
    71737149
    7174 bool p4InputImfileSelectRowsFits(
     7150bool p4aInputExpSelectRowsFits(
    71757151    psDB            *dbh,               ///< Database handle
    71767152    psFits          *fits,              ///< psFits object
     
    71797155);
    71807156
    7181 /** Convert a p4InputImfileRow into an equivalent psMetadata
     7157/** Convert a p4aInputExpRow into an equivalent psMetadata
    71827158 *
    71837159 * @return A psMetadata pointer or NULL on error
    71847160 */
    71857161
    7186 psMetadata *p4InputImfileMetadataFromObject(
    7187     const p4InputImfileRow *object             ///< fooRow to convert into a psMetadata
     7162psMetadata *p4aInputExpMetadataFromObject(
     7163    const p4aInputExpRow *object             ///< fooRow to convert into a psMetadata
    71887164);
    71897165
    71907166/** Convert a psMetadata into an equivalent fooRow
    71917167 *
    7192  * @return A p4InputImfileRow pointer or NULL on error
    7193  */
    7194 
    7195 p4InputImfileRow *p4InputImfileObjectFromMetadata(
     7168 * @return A p4aInputExpRow pointer or NULL on error
     7169 */
     7170
     7171p4aInputExpRow *p4aInputExpObjectFromMetadata(
    71967172    psMetadata      *md                 ///< psMetadata to convert into a fooRow
    71977173);
    7198 /** Selects up to limit rows from the database and returns as p4InputImfileRow objects in a psArray
     7174/** Selects up to limit rows from the database and returns as p4aInputExpRow objects in a psArray
    71997175 *
    72007176 *  See psDBSelectRows() for documentation on the format of where.
     
    72037179 */
    72047180
    7205 psArray *p4InputImfileSelectRowObjects(
     7181psArray *p4aInputExpSelectRowObjects(
    72067182    psDB            *dbh,               ///< Database handle
    72077183    const psMetadata *where,            ///< Row match criteria
    72087184    unsigned long long limit            ///< Maximum number of elements to return
    72097185);
    7210 /** Deletes a row from the database coresponding to an p4InputImfile
     7186/** Deletes a row from the database coresponding to an p4aInputExp
    72117187 *
    72127188 *  Note that a 'where' search psMetadata is constructed from each object and
     
    72167192 */
    72177193
    7218 bool p4InputImfileDeleteObject(
    7219     psDB            *dbh,               ///< Database handle
    7220     const p4InputImfileRow *object    ///< Object to delete
     7194bool p4aInputExpDeleteObject(
     7195    psDB            *dbh,               ///< Database handle
     7196    const p4aInputExpRow *object    ///< Object to delete
    72217197);
    72227198/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    72287204 */
    72297205
    7230 long long p4InputImfileDeleteRowObjects(
     7206long long p4aInputExpDeleteRowObjects(
    72317207    psDB            *dbh,               ///< Database handle
    72327208    const psArray   *objects,           ///< Array of objects to delete
    72337209    unsigned long long limit            ///< Maximum number of elements to delete
    72347210);
    7235 /** Formats and prints an array of p4InputImfileRow objects
     7211/** Formats and prints an array of p4aInputExpRow objects
    72367212 *
    72377213 * When mdcf is set the formated output is in psMetadataConfig
     
    72417217 */
    72427218
    7243 bool p4InputImfilePrintObjects(
     7219bool p4aInputExpPrintObjects(
    72447220    FILE            *stream,            ///< a stream
    7245     psArray         *objects,           ///< An array of p4InputImfileRow objects
     7221    psArray         *objects,           ///< An array of p4aInputExpRow objects
    72467222    bool            mdcf                ///< format as mdconfig or simple
    72477223);
    7248 /** Formats and prints an p4InputImfileRow object
     7224/** Formats and prints an p4aInputExpRow object
    72497225 *
    72507226 * When mdcf is set the formated output is in psMetadataConfig
     
    72547230 */
    72557231
    7256 bool p4InputImfilePrintObject(
     7232bool p4aInputExpPrintObject(
    72577233    FILE            *stream,            ///< a stream
    7258     p4InputImfileRow *object,    ///< an p4InputImfileRow object
     7234    p4aInputExpRow *object,    ///< an p4aInputExpRow object
    72597235    bool            mdcf                ///< format as mdconfig or simple
    72607236);
    7261 /** p4WarpedImfileRow data structure
    7262  *
    7263  * Structure for representing a single row of p4WarpedImfile table data.
     7237/** p4aScfileRow data structure
     7238 *
     7239 * Structure for representing a single row of p4aScfile table data.
    72647240 */
    72657241
    72667242typedef struct {
    7267     psS32           p4_id;
     7243    psS32           p4a_id;
     7244    char            *skycell_id;
     7245    char            *tess_id;
    72687246    char            *exp_tag;
    72697247    psS32           p3_version;
    7270     char            *class_id;
    72717248    char            *uri;
    7272     char            *b1_uri;
    7273     char            *b2_uri;
    7274 } p4WarpedImfileRow;
    7275 
    7276 /** Creates a new p4WarpedImfileRow object
    7277  *
    7278  *  @return A new p4WarpedImfileRow object or NULL on failure.
    7279  */
    7280 
    7281 p4WarpedImfileRow *p4WarpedImfileRowAlloc(
    7282     psS32           p4_id,
     7249    psF64           bg;
     7250    psF64           bg_mean_stdev;
     7251} p4aScfileRow;
     7252
     7253/** Creates a new p4aScfileRow object
     7254 *
     7255 *  @return A new p4aScfileRow object or NULL on failure.
     7256 */
     7257
     7258p4aScfileRow *p4aScfileRowAlloc(
     7259    psS32           p4a_id,
     7260    const char      *skycell_id,
     7261    const char      *tess_id,
    72837262    const char      *exp_tag,
    72847263    psS32           p3_version,
    7285     const char      *class_id,
    72867264    const char      *uri,
    7287     const char      *b1_uri,
    7288     const char      *b2_uri
    7289 );
    7290 
    7291 /** Creates a new p4WarpedImfile table
    7292  *
    7293  * @return true on success
    7294  */
    7295 
    7296 bool p4WarpedImfileCreateTable(
     7265    psF64           bg,
     7266    psF64           bg_mean_stdev
     7267);
     7268
     7269/** Creates a new p4aScfile table
     7270 *
     7271 * @return true on success
     7272 */
     7273
     7274bool p4aScfileCreateTable(
    72977275    psDB            *dbh                ///< Database handle
    72987276);
    72997277
    7300 /** Deletes a p4WarpedImfile table
    7301  *
    7302  * @return true on success
    7303  */
    7304 
    7305 bool p4WarpedImfileDropTable(
     7278/** Deletes a p4aScfile table
     7279 *
     7280 * @return true on success
     7281 */
     7282
     7283bool p4aScfileDropTable(
    73067284    psDB            *dbh                ///< Database handle
    73077285);
     
    73147292 */
    73157293
    7316 bool p4WarpedImfileInsert(
    7317     psDB            *dbh,               ///< Database handle
    7318     psS32           p4_id,
     7294bool p4aScfileInsert(
     7295    psDB            *dbh,               ///< Database handle
     7296    psS32           p4a_id,
     7297    const char      *skycell_id,
     7298    const char      *tess_id,
    73197299    const char      *exp_tag,
    73207300    psS32           p3_version,
    7321     const char      *class_id,
    73227301    const char      *uri,
    7323     const char      *b1_uri,
    7324     const char      *b2_uri
     7302    psF64           bg,
     7303    psF64           bg_mean_stdev
    73257304);
    73267305
     
    73307309 */
    73317310
    7332 long long p4WarpedImfileDelete(
     7311long long p4aScfileDelete(
    73337312    psDB            *dbh,               ///< Database handle
    73347313    const psMetadata *where,            ///< Row match criteria
     
    73367315);
    73377316
    7338 /** Insert a single p4WarpedImfileRow object into a table
     7317/** Insert a single p4aScfileRow object into a table
    73397318 *
    73407319 * This function constructs and inserts a single row based on it's parameters.
     
    73437322 */
    73447323
    7345 bool p4WarpedImfileInsertObject(
    7346     psDB            *dbh,               ///< Database handle
    7347     p4WarpedImfileRow *object             ///< p4WarpedImfileRow object
    7348 );
    7349 
    7350 /** Insert an array of p4WarpedImfileRow object into a table
     7324bool p4aScfileInsertObject(
     7325    psDB            *dbh,               ///< Database handle
     7326    p4aScfileRow    *object             ///< p4aScfileRow object
     7327);
     7328
     7329/** Insert an array of p4aScfileRow object into a table
    73517330 *
    73527331 * This function constructs and inserts multiple rows based on it's parameters.
     
    73557334 */
    73567335
    7357 bool p4WarpedImfileInsertObjects(
    7358     psDB            *dbh,               ///< Database handle
    7359     psArray         *objects            ///< array of p4WarpedImfileRow objects
    7360 );
    7361 
    7362 /** Insert data from a binary FITS table p4WarpedImfileRow into the database
     7336bool p4aScfileInsertObjects(
     7337    psDB            *dbh,               ///< Database handle
     7338    psArray         *objects            ///< array of p4aScfileRow objects
     7339);
     7340
     7341/** Insert data from a binary FITS table p4aScfileRow into the database
    73637342 *
    73647343 * This function expects a psFits object with a FITS table as the first
     
    73707349 */
    73717350
    7372 bool p4WarpedImfileInsertFits(
     7351bool p4aScfileInsertFits(
    73737352    psDB            *dbh,               ///< Database handle
    73747353    const psFits    *fits               ///< psFits object
     
    73857364 */
    73867365
    7387 bool p4WarpedImfileSelectRowsFits(
     7366bool p4aScfileSelectRowsFits(
    73887367    psDB            *dbh,               ///< Database handle
    73897368    psFits          *fits,              ///< psFits object
     
    73927371);
    73937372
    7394 /** Convert a p4WarpedImfileRow into an equivalent psMetadata
     7373/** Convert a p4aScfileRow into an equivalent psMetadata
    73957374 *
    73967375 * @return A psMetadata pointer or NULL on error
    73977376 */
    73987377
    7399 psMetadata *p4WarpedImfileMetadataFromObject(
    7400     const p4WarpedImfileRow *object             ///< fooRow to convert into a psMetadata
     7378psMetadata *p4aScfileMetadataFromObject(
     7379    const p4aScfileRow *object             ///< fooRow to convert into a psMetadata
    74017380);
    74027381
    74037382/** Convert a psMetadata into an equivalent fooRow
    74047383 *
    7405  * @return A p4WarpedImfileRow pointer or NULL on error
    7406  */
    7407 
    7408 p4WarpedImfileRow *p4WarpedImfileObjectFromMetadata(
     7384 * @return A p4aScfileRow pointer or NULL on error
     7385 */
     7386
     7387p4aScfileRow *p4aScfileObjectFromMetadata(
    74097388    psMetadata      *md                 ///< psMetadata to convert into a fooRow
    74107389);
    7411 /** Selects up to limit rows from the database and returns as p4WarpedImfileRow objects in a psArray
     7390/** Selects up to limit rows from the database and returns as p4aScfileRow objects in a psArray
    74127391 *
    74137392 *  See psDBSelectRows() for documentation on the format of where.
     
    74167395 */
    74177396
    7418 psArray *p4WarpedImfileSelectRowObjects(
     7397psArray *p4aScfileSelectRowObjects(
    74197398    psDB            *dbh,               ///< Database handle
    74207399    const psMetadata *where,            ///< Row match criteria
    74217400    unsigned long long limit            ///< Maximum number of elements to return
    74227401);
    7423 /** Deletes a row from the database coresponding to an p4WarpedImfile
     7402/** Deletes a row from the database coresponding to an p4aScfile
    74247403 *
    74257404 *  Note that a 'where' search psMetadata is constructed from each object and
     
    74297408 */
    74307409
    7431 bool p4WarpedImfileDeleteObject(
    7432     psDB            *dbh,               ///< Database handle
    7433     const p4WarpedImfileRow *object    ///< Object to delete
     7410bool p4aScfileDeleteObject(
     7411    psDB            *dbh,               ///< Database handle
     7412    const p4aScfileRow *object    ///< Object to delete
    74347413);
    74357414/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    74417420 */
    74427421
    7443 long long p4WarpedImfileDeleteRowObjects(
     7422long long p4aScfileDeleteRowObjects(
    74447423    psDB            *dbh,               ///< Database handle
    74457424    const psArray   *objects,           ///< Array of objects to delete
    74467425    unsigned long long limit            ///< Maximum number of elements to delete
    74477426);
    7448 /** Formats and prints an array of p4WarpedImfileRow objects
     7427/** Formats and prints an array of p4aScfileRow objects
    74497428 *
    74507429 * When mdcf is set the formated output is in psMetadataConfig
     
    74547433 */
    74557434
    7456 bool p4WarpedImfilePrintObjects(
     7435bool p4aScfilePrintObjects(
    74577436    FILE            *stream,            ///< a stream
    7458     psArray         *objects,           ///< An array of p4WarpedImfileRow objects
     7437    psArray         *objects,           ///< An array of p4aScfileRow objects
    74597438    bool            mdcf                ///< format as mdconfig or simple
    74607439);
    7461 /** Formats and prints an p4WarpedImfileRow object
     7440/** Formats and prints an p4aScfileRow object
    74627441 *
    74637442 * When mdcf is set the formated output is in psMetadataConfig
     
    74677446 */
    74687447
    7469 bool p4WarpedImfilePrintObject(
     7448bool p4aScfilePrintObject(
    74707449    FILE            *stream,            ///< a stream
    7471     p4WarpedImfileRow *object,    ///< an p4WarpedImfileRow object
     7450    p4aScfileRow *object,    ///< an p4aScfileRow object
    74727451    bool            mdcf                ///< format as mdconfig or simple
    74737452);
    7474 /** p4StackedImfileRow data structure
    7475  *
    7476  * Structure for representing a single row of p4StackedImfile table data.
     7453/** p4bRunRow data structure
     7454 *
     7455 * Structure for representing a single row of p4bRun table data.
    74777456 */
    74787457
    74797458typedef struct {
    7480     psS32           p4_id;
    7481     char            *class_id;
    7482     char            *uri;
    7483     char            *b1_uri;
    7484     char            *b2_uri;
    7485 } p4StackedImfileRow;
    7486 
    7487 /** Creates a new p4StackedImfileRow object
    7488  *
    7489  *  @return A new p4StackedImfileRow object or NULL on failure.
    7490  */
    7491 
    7492 p4StackedImfileRow *p4StackedImfileRowAlloc(
    7493     psS32           p4_id,
    7494     const char      *class_id,
    7495     const char      *uri,
    7496     const char      *b1_uri,
    7497     const char      *b2_uri
    7498 );
    7499 
    7500 /** Creates a new p4StackedImfile table
    7501  *
    7502  * @return true on success
    7503  */
    7504 
    7505 bool p4StackedImfileCreateTable(
     7459    psS32           p4b_id;
     7460    char            *state;
     7461    char            *workdir;
     7462    bool            magic;
     7463} p4bRunRow;
     7464
     7465/** Creates a new p4bRunRow object
     7466 *
     7467 *  @return A new p4bRunRow object or NULL on failure.
     7468 */
     7469
     7470p4bRunRow *p4bRunRowAlloc(
     7471    psS32           p4b_id,
     7472    const char      *state,
     7473    const char      *workdir,
     7474    bool            magic
     7475);
     7476
     7477/** Creates a new p4bRun table
     7478 *
     7479 * @return true on success
     7480 */
     7481
     7482bool p4bRunCreateTable(
    75067483    psDB            *dbh                ///< Database handle
    75077484);
    75087485
    7509 /** Deletes a p4StackedImfile table
    7510  *
    7511  * @return true on success
    7512  */
    7513 
    7514 bool p4StackedImfileDropTable(
     7486/** Deletes a p4bRun table
     7487 *
     7488 * @return true on success
     7489 */
     7490
     7491bool p4bRunDropTable(
    75157492    psDB            *dbh                ///< Database handle
    75167493);
     
    75237500 */
    75247501
    7525 bool p4StackedImfileInsert(
    7526     psDB            *dbh,               ///< Database handle
    7527     psS32           p4_id,
    7528     const char      *class_id,
    7529     const char      *uri,
    7530     const char      *b1_uri,
    7531     const char      *b2_uri
     7502bool p4bRunInsert(
     7503    psDB            *dbh,               ///< Database handle
     7504    psS32           p4b_id,
     7505    const char      *state,
     7506    const char      *workdir,
     7507    bool            magic
    75327508);
    75337509
     
    75377513 */
    75387514
    7539 long long p4StackedImfileDelete(
     7515long long p4bRunDelete(
    75407516    psDB            *dbh,               ///< Database handle
    75417517    const psMetadata *where,            ///< Row match criteria
     
    75437519);
    75447520
    7545 /** Insert a single p4StackedImfileRow object into a table
     7521/** Insert a single p4bRunRow object into a table
    75467522 *
    75477523 * This function constructs and inserts a single row based on it's parameters.
     
    75507526 */
    75517527
    7552 bool p4StackedImfileInsertObject(
    7553     psDB            *dbh,               ///< Database handle
    7554     p4StackedImfileRow *object             ///< p4StackedImfileRow object
    7555 );
    7556 
    7557 /** Insert an array of p4StackedImfileRow object into a table
     7528bool p4bRunInsertObject(
     7529    psDB            *dbh,               ///< Database handle
     7530    p4bRunRow       *object             ///< p4bRunRow object
     7531);
     7532
     7533/** Insert an array of p4bRunRow object into a table
    75587534 *
    75597535 * This function constructs and inserts multiple rows based on it's parameters.
     
    75627538 */
    75637539
    7564 bool p4StackedImfileInsertObjects(
    7565     psDB            *dbh,               ///< Database handle
    7566     psArray         *objects            ///< array of p4StackedImfileRow objects
    7567 );
    7568 
    7569 /** Insert data from a binary FITS table p4StackedImfileRow into the database
     7540bool p4bRunInsertObjects(
     7541    psDB            *dbh,               ///< Database handle
     7542    psArray         *objects            ///< array of p4bRunRow objects
     7543);
     7544
     7545/** Insert data from a binary FITS table p4bRunRow into the database
    75707546 *
    75717547 * This function expects a psFits object with a FITS table as the first
     
    75777553 */
    75787554
    7579 bool p4StackedImfileInsertFits(
     7555bool p4bRunInsertFits(
    75807556    psDB            *dbh,               ///< Database handle
    75817557    const psFits    *fits               ///< psFits object
     
    75927568 */
    75937569
    7594 bool p4StackedImfileSelectRowsFits(
     7570bool p4bRunSelectRowsFits(
    75957571    psDB            *dbh,               ///< Database handle
    75967572    psFits          *fits,              ///< psFits object
     
    75997575);
    76007576
    7601 /** Convert a p4StackedImfileRow into an equivalent psMetadata
     7577/** Convert a p4bRunRow into an equivalent psMetadata
    76027578 *
    76037579 * @return A psMetadata pointer or NULL on error
    76047580 */
    76057581
    7606 psMetadata *p4StackedImfileMetadataFromObject(
    7607     const p4StackedImfileRow *object             ///< fooRow to convert into a psMetadata
     7582psMetadata *p4bRunMetadataFromObject(
     7583    const p4bRunRow *object             ///< fooRow to convert into a psMetadata
    76087584);
    76097585
    76107586/** Convert a psMetadata into an equivalent fooRow
    76117587 *
    7612  * @return A p4StackedImfileRow pointer or NULL on error
    7613  */
    7614 
    7615 p4StackedImfileRow *p4StackedImfileObjectFromMetadata(
     7588 * @return A p4bRunRow pointer or NULL on error
     7589 */
     7590
     7591p4bRunRow *p4bRunObjectFromMetadata(
    76167592    psMetadata      *md                 ///< psMetadata to convert into a fooRow
    76177593);
    7618 /** Selects up to limit rows from the database and returns as p4StackedImfileRow objects in a psArray
     7594/** Selects up to limit rows from the database and returns as p4bRunRow objects in a psArray
    76197595 *
    76207596 *  See psDBSelectRows() for documentation on the format of where.
     
    76237599 */
    76247600
    7625 psArray *p4StackedImfileSelectRowObjects(
     7601psArray *p4bRunSelectRowObjects(
    76267602    psDB            *dbh,               ///< Database handle
    76277603    const psMetadata *where,            ///< Row match criteria
    76287604    unsigned long long limit            ///< Maximum number of elements to return
    76297605);
    7630 /** Deletes a row from the database coresponding to an p4StackedImfile
     7606/** Deletes a row from the database coresponding to an p4bRun
    76317607 *
    76327608 *  Note that a 'where' search psMetadata is constructed from each object and
     
    76367612 */
    76377613
    7638 bool p4StackedImfileDeleteObject(
    7639     psDB            *dbh,               ///< Database handle
    7640     const p4StackedImfileRow *object    ///< Object to delete
     7614bool p4bRunDeleteObject(
     7615    psDB            *dbh,               ///< Database handle
     7616    const p4bRunRow *object    ///< Object to delete
    76417617);
    76427618/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    76487624 */
    76497625
    7650 long long p4StackedImfileDeleteRowObjects(
     7626long long p4bRunDeleteRowObjects(
    76517627    psDB            *dbh,               ///< Database handle
    76527628    const psArray   *objects,           ///< Array of objects to delete
    76537629    unsigned long long limit            ///< Maximum number of elements to delete
    76547630);
    7655 /** Formats and prints an array of p4StackedImfileRow objects
     7631/** Formats and prints an array of p4bRunRow objects
    76567632 *
    76577633 * When mdcf is set the formated output is in psMetadataConfig
     
    76617637 */
    76627638
    7663 bool p4StackedImfilePrintObjects(
     7639bool p4bRunPrintObjects(
    76647640    FILE            *stream,            ///< a stream
    7665     psArray         *objects,           ///< An array of p4StackedImfileRow objects
     7641    psArray         *objects,           ///< An array of p4bRunRow objects
    76667642    bool            mdcf                ///< format as mdconfig or simple
    76677643);
    7668 /** Formats and prints an p4StackedImfileRow object
     7644/** Formats and prints an p4bRunRow object
    76697645 *
    76707646 * When mdcf is set the formated output is in psMetadataConfig
     
    76747650 */
    76757651
    7676 bool p4StackedImfilePrintObject(
     7652bool p4bRunPrintObject(
    76777653    FILE            *stream,            ///< a stream
    7678     p4StackedImfileRow *object,    ///< an p4StackedImfileRow object
     7654    p4bRunRow *object,    ///< an p4bRunRow object
    76797655    bool            mdcf                ///< format as mdconfig or simple
    76807656);
    7681 /** p4DiffImfileRow data structure
    7682  *
    7683  * Structure for representing a single row of p4DiffImfile table data.
     7657/** p4bInputScfileRow data structure
     7658 *
     7659 * Structure for representing a single row of p4bInputScfile table data.
    76847660 */
    76857661
    76867662typedef struct {
    7687     psS32           p4_id;
     7663    psS32           p4b_id;
     7664    char            *skycell_id;
     7665    char            *tess_id;
    76887666    char            *exp_tag;
    76897667    psS32           p3_version;
    7690     char            *class_id;
    7691     char            *uri;
    7692     char            *b1_uri;
    7693     char            *b2_uri;
    7694 } p4DiffImfileRow;
    7695 
    7696 /** Creates a new p4DiffImfileRow object
    7697  *
    7698  *  @return A new p4DiffImfileRow object or NULL on failure.
    7699  */
    7700 
    7701 p4DiffImfileRow *p4DiffImfileRowAlloc(
    7702     psS32           p4_id,
     7668    char            *kind;
     7669} p4bInputScfileRow;
     7670
     7671/** Creates a new p4bInputScfileRow object
     7672 *
     7673 *  @return A new p4bInputScfileRow object or NULL on failure.
     7674 */
     7675
     7676p4bInputScfileRow *p4bInputScfileRowAlloc(
     7677    psS32           p4b_id,
     7678    const char      *skycell_id,
     7679    const char      *tess_id,
    77037680    const char      *exp_tag,
    77047681    psS32           p3_version,
    7705     const char      *class_id,
    7706     const char      *uri,
    7707     const char      *b1_uri,
    7708     const char      *b2_uri
    7709 );
    7710 
    7711 /** Creates a new p4DiffImfile table
    7712  *
    7713  * @return true on success
    7714  */
    7715 
    7716 bool p4DiffImfileCreateTable(
     7682    const char      *kind
     7683);
     7684
     7685/** Creates a new p4bInputScfile table
     7686 *
     7687 * @return true on success
     7688 */
     7689
     7690bool p4bInputScfileCreateTable(
    77177691    psDB            *dbh                ///< Database handle
    77187692);
    77197693
    7720 /** Deletes a p4DiffImfile table
    7721  *
    7722  * @return true on success
    7723  */
    7724 
    7725 bool p4DiffImfileDropTable(
     7694/** Deletes a p4bInputScfile table
     7695 *
     7696 * @return true on success
     7697 */
     7698
     7699bool p4bInputScfileDropTable(
    77267700    psDB            *dbh                ///< Database handle
    77277701);
     
    77347708 */
    77357709
    7736 bool p4DiffImfileInsert(
    7737     psDB            *dbh,               ///< Database handle
    7738     psS32           p4_id,
     7710bool p4bInputScfileInsert(
     7711    psDB            *dbh,               ///< Database handle
     7712    psS32           p4b_id,
     7713    const char      *skycell_id,
     7714    const char      *tess_id,
    77397715    const char      *exp_tag,
    77407716    psS32           p3_version,
    7741     const char      *class_id,
    7742     const char      *uri,
    7743     const char      *b1_uri,
    7744     const char      *b2_uri
     7717    const char      *kind
    77457718);
    77467719
     
    77507723 */
    77517724
    7752 long long p4DiffImfileDelete(
     7725long long p4bInputScfileDelete(
    77537726    psDB            *dbh,               ///< Database handle
    77547727    const psMetadata *where,            ///< Row match criteria
     
    77567729);
    77577730
    7758 /** Insert a single p4DiffImfileRow object into a table
     7731/** Insert a single p4bInputScfileRow object into a table
    77597732 *
    77607733 * This function constructs and inserts a single row based on it's parameters.
     
    77637736 */
    77647737
    7765 bool p4DiffImfileInsertObject(
    7766     psDB            *dbh,               ///< Database handle
    7767     p4DiffImfileRow *object             ///< p4DiffImfileRow object
    7768 );
    7769 
    7770 /** Insert an array of p4DiffImfileRow object into a table
     7738bool p4bInputScfileInsertObject(
     7739    psDB            *dbh,               ///< Database handle
     7740    p4bInputScfileRow *object             ///< p4bInputScfileRow object
     7741);
     7742
     7743/** Insert an array of p4bInputScfileRow object into a table
    77717744 *
    77727745 * This function constructs and inserts multiple rows based on it's parameters.
     
    77757748 */
    77767749
    7777 bool p4DiffImfileInsertObjects(
    7778     psDB            *dbh,               ///< Database handle
    7779     psArray         *objects            ///< array of p4DiffImfileRow objects
    7780 );
    7781 
    7782 /** Insert data from a binary FITS table p4DiffImfileRow into the database
     7750bool p4bInputScfileInsertObjects(
     7751    psDB            *dbh,               ///< Database handle
     7752    psArray         *objects            ///< array of p4bInputScfileRow objects
     7753);
     7754
     7755/** Insert data from a binary FITS table p4bInputScfileRow into the database
    77837756 *
    77847757 * This function expects a psFits object with a FITS table as the first
     
    77907763 */
    77917764
    7792 bool p4DiffImfileInsertFits(
     7765bool p4bInputScfileInsertFits(
    77937766    psDB            *dbh,               ///< Database handle
    77947767    const psFits    *fits               ///< psFits object
     
    78057778 */
    78067779
    7807 bool p4DiffImfileSelectRowsFits(
     7780bool p4bInputScfileSelectRowsFits(
    78087781    psDB            *dbh,               ///< Database handle
    78097782    psFits          *fits,              ///< psFits object
     
    78127785);
    78137786
    7814 /** Convert a p4DiffImfileRow into an equivalent psMetadata
     7787/** Convert a p4bInputScfileRow into an equivalent psMetadata
    78157788 *
    78167789 * @return A psMetadata pointer or NULL on error
    78177790 */
    78187791
    7819 psMetadata *p4DiffImfileMetadataFromObject(
    7820     const p4DiffImfileRow *object             ///< fooRow to convert into a psMetadata
     7792psMetadata *p4bInputScfileMetadataFromObject(
     7793    const p4bInputScfileRow *object             ///< fooRow to convert into a psMetadata
    78217794);
    78227795
    78237796/** Convert a psMetadata into an equivalent fooRow
    78247797 *
    7825  * @return A p4DiffImfileRow pointer or NULL on error
    7826  */
    7827 
    7828 p4DiffImfileRow *p4DiffImfileObjectFromMetadata(
     7798 * @return A p4bInputScfileRow pointer or NULL on error
     7799 */
     7800
     7801p4bInputScfileRow *p4bInputScfileObjectFromMetadata(
    78297802    psMetadata      *md                 ///< psMetadata to convert into a fooRow
    78307803);
    7831 /** Selects up to limit rows from the database and returns as p4DiffImfileRow objects in a psArray
     7804/** Selects up to limit rows from the database and returns as p4bInputScfileRow objects in a psArray
    78327805 *
    78337806 *  See psDBSelectRows() for documentation on the format of where.
     
    78367809 */
    78377810
    7838 psArray *p4DiffImfileSelectRowObjects(
     7811psArray *p4bInputScfileSelectRowObjects(
    78397812    psDB            *dbh,               ///< Database handle
    78407813    const psMetadata *where,            ///< Row match criteria
    78417814    unsigned long long limit            ///< Maximum number of elements to return
    78427815);
    7843 /** Deletes a row from the database coresponding to an p4DiffImfile
     7816/** Deletes a row from the database coresponding to an p4bInputScfile
    78447817 *
    78457818 *  Note that a 'where' search psMetadata is constructed from each object and
     
    78497822 */
    78507823
    7851 bool p4DiffImfileDeleteObject(
    7852     psDB            *dbh,               ///< Database handle
    7853     const p4DiffImfileRow *object    ///< Object to delete
     7824bool p4bInputScfileDeleteObject(
     7825    psDB            *dbh,               ///< Database handle
     7826    const p4bInputScfileRow *object    ///< Object to delete
    78547827);
    78557828/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     
    78617834 */
    78627835
    7863 long long p4DiffImfileDeleteRowObjects(
     7836long long p4bInputScfileDeleteRowObjects(
    78647837    psDB            *dbh,               ///< Database handle
    78657838    const psArray   *objects,           ///< Array of objects to delete
    78667839    unsigned long long limit            ///< Maximum number of elements to delete
    78677840);
    7868 /** Formats and prints an array of p4DiffImfileRow objects
     7841/** Formats and prints an array of p4bInputScfileRow objects
    78697842 *
    78707843 * When mdcf is set the formated output is in psMetadataConfig
     
    78747847 */
    78757848
    7876 bool p4DiffImfilePrintObjects(
     7849bool p4bInputScfilePrintObjects(
    78777850    FILE            *stream,            ///< a stream
    7878     psArray         *objects,           ///< An array of p4DiffImfileRow objects
     7851    psArray         *objects,           ///< An array of p4bInputScfileRow objects
    78797852    bool            mdcf                ///< format as mdconfig or simple
    78807853);
    7881 /** Formats and prints an p4DiffImfileRow object
     7854/** Formats and prints an p4bInputScfileRow object
    78827855 *
    78837856 * When mdcf is set the formated output is in psMetadataConfig
     
    78877860 */
    78887861
    7889 bool p4DiffImfilePrintObject(
     7862bool p4bInputScfilePrintObject(
    78907863    FILE            *stream,            ///< a stream
    7891     p4DiffImfileRow *object,    ///< an p4DiffImfileRow object
     7864    p4bInputScfileRow *object,    ///< an p4bInputScfileRow object
    78927865    bool            mdcf                ///< format as mdconfig or simple
    78937866);
     7867/** p4bDiffScfileRow data structure
     7868 *
     7869 * Structure for representing a single row of p4bDiffScfile table data.
     7870 */
     7871
     7872typedef struct {
     7873    psS32           p4b_id;
     7874    char            *skycell_id;
     7875    char            *tess_id;
     7876    char            *exp_tag;
     7877    psS32           p3_version;
     7878    char            *uri;
     7879    psF64           bg;
     7880    psF64           bg_mean_stdev;
     7881} p4bDiffScfileRow;
     7882
     7883/** Creates a new p4bDiffScfileRow object
     7884 *
     7885 *  @return A new p4bDiffScfileRow object or NULL on failure.
     7886 */
     7887
     7888p4bDiffScfileRow *p4bDiffScfileRowAlloc(
     7889    psS32           p4b_id,
     7890    const char      *skycell_id,
     7891    const char      *tess_id,
     7892    const char      *exp_tag,
     7893    psS32           p3_version,
     7894    const char      *uri,
     7895    psF64           bg,
     7896    psF64           bg_mean_stdev
     7897);
     7898
     7899/** Creates a new p4bDiffScfile table
     7900 *
     7901 * @return true on success
     7902 */
     7903
     7904bool p4bDiffScfileCreateTable(
     7905    psDB            *dbh                ///< Database handle
     7906);
     7907
     7908/** Deletes a p4bDiffScfile table
     7909 *
     7910 * @return true on success
     7911 */
     7912
     7913bool p4bDiffScfileDropTable(
     7914    psDB            *dbh                ///< Database handle
     7915);
     7916
     7917/** Insert a single row into a table
     7918 *
     7919 * This function constructs and inserts a single row based on it's parameters.
     7920 *
     7921 * @return true on success
     7922 */
     7923
     7924bool p4bDiffScfileInsert(
     7925    psDB            *dbh,               ///< Database handle
     7926    psS32           p4b_id,
     7927    const char      *skycell_id,
     7928    const char      *tess_id,
     7929    const char      *exp_tag,
     7930    psS32           p3_version,
     7931    const char      *uri,
     7932    psF64           bg,
     7933    psF64           bg_mean_stdev
     7934);
     7935
     7936/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     7937 *
     7938 * @return A The number of rows removed or a negative value on error
     7939 */
     7940
     7941long long p4bDiffScfileDelete(
     7942    psDB            *dbh,               ///< Database handle
     7943    const psMetadata *where,            ///< Row match criteria
     7944    unsigned long long limit            ///< Maximum number of elements to delete
     7945);
     7946
     7947/** Insert a single p4bDiffScfileRow object into a table
     7948 *
     7949 * This function constructs and inserts a single row based on it's parameters.
     7950 *
     7951 * @return true on success
     7952 */
     7953
     7954bool p4bDiffScfileInsertObject(
     7955    psDB            *dbh,               ///< Database handle
     7956    p4bDiffScfileRow *object             ///< p4bDiffScfileRow object
     7957);
     7958
     7959/** Insert an array of p4bDiffScfileRow object into a table
     7960 *
     7961 * This function constructs and inserts multiple rows based on it's parameters.
     7962 *
     7963 * @return true on success
     7964 */
     7965
     7966bool p4bDiffScfileInsertObjects(
     7967    psDB            *dbh,               ///< Database handle
     7968    psArray         *objects            ///< array of p4bDiffScfileRow objects
     7969);
     7970
     7971/** Insert data from a binary FITS table p4bDiffScfileRow into the database
     7972 *
     7973 * This function expects a psFits object with a FITS table as the first
     7974 * extension.  The table must have at least one row of data in it, that is of
     7975 * the appropriate format (number of columns and their type).  All other
     7976 * extensions are ignored.
     7977 *
     7978 * @return true on success
     7979 */
     7980
     7981bool p4bDiffScfileInsertFits(
     7982    psDB            *dbh,               ///< Database handle
     7983    const psFits    *fits               ///< psFits object
     7984);
     7985
     7986/** Selects up to limit from the database and returns them in a binary FITS table
     7987 *
     7988 * This function assumes an empty psFits object and will create a FITS table
     7989 * as the first extension.
     7990 *
     7991 *  See psDBSelectRows() for documentation on the format of where.
     7992 *
     7993 * @return true on success
     7994 */
     7995
     7996bool p4bDiffScfileSelectRowsFits(
     7997    psDB            *dbh,               ///< Database handle
     7998    psFits          *fits,              ///< psFits object
     7999    const psMetadata *where,            ///< Row match criteria
     8000    unsigned long long limit            ///< Maximum number of elements to return
     8001);
     8002
     8003/** Convert a p4bDiffScfileRow into an equivalent psMetadata
     8004 *
     8005 * @return A psMetadata pointer or NULL on error
     8006 */
     8007
     8008psMetadata *p4bDiffScfileMetadataFromObject(
     8009    const p4bDiffScfileRow *object             ///< fooRow to convert into a psMetadata
     8010);
     8011
     8012/** Convert a psMetadata into an equivalent fooRow
     8013 *
     8014 * @return A p4bDiffScfileRow pointer or NULL on error
     8015 */
     8016
     8017p4bDiffScfileRow *p4bDiffScfileObjectFromMetadata(
     8018    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     8019);
     8020/** Selects up to limit rows from the database and returns as p4bDiffScfileRow objects in a psArray
     8021 *
     8022 *  See psDBSelectRows() for documentation on the format of where.
     8023 *
     8024 * @return A psArray pointer or NULL on error
     8025 */
     8026
     8027psArray *p4bDiffScfileSelectRowObjects(
     8028    psDB            *dbh,               ///< Database handle
     8029    const psMetadata *where,            ///< Row match criteria
     8030    unsigned long long limit            ///< Maximum number of elements to return
     8031);
     8032/** Deletes a row from the database coresponding to an p4bDiffScfile
     8033 *
     8034 *  Note that a 'where' search psMetadata is constructed from each object and
     8035 *  used to find rows to delete.
     8036 *
     8037 * @return A The number of rows removed or a negative value on error
     8038 */
     8039
     8040bool p4bDiffScfileDeleteObject(
     8041    psDB            *dbh,               ///< Database handle
     8042    const p4bDiffScfileRow *object    ///< Object to delete
     8043);
     8044/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     8045 *
     8046 *  Note that a 'where' search psMetadata is constructed from each object and
     8047 *  used to find rows to delete.
     8048 *
     8049 * @return A The number of rows removed or a negative value on error
     8050 */
     8051
     8052long long p4bDiffScfileDeleteRowObjects(
     8053    psDB            *dbh,               ///< Database handle
     8054    const psArray   *objects,           ///< Array of objects to delete
     8055    unsigned long long limit            ///< Maximum number of elements to delete
     8056);
     8057/** Formats and prints an array of p4bDiffScfileRow objects
     8058 *
     8059 * When mdcf is set the formated output is in psMetadataConfig
     8060 * format, otherwise it is in a simple tabular format.
     8061 *
     8062 * @return true on success
     8063 */
     8064
     8065bool p4bDiffScfilePrintObjects(
     8066    FILE            *stream,            ///< a stream
     8067    psArray         *objects,           ///< An array of p4bDiffScfileRow objects
     8068    bool            mdcf                ///< format as mdconfig or simple
     8069);
     8070/** Formats and prints an p4bDiffScfileRow object
     8071 *
     8072 * When mdcf is set the formated output is in psMetadataConfig
     8073 * format, otherwise it is in a simple tabular format.
     8074 *
     8075 * @return true on success
     8076 */
     8077
     8078bool p4bDiffScfilePrintObject(
     8079    FILE            *stream,            ///< a stream
     8080    p4bDiffScfileRow *object,    ///< an p4bDiffScfileRow object
     8081    bool            mdcf                ///< format as mdconfig or simple
     8082);
     8083/** p4cRunRow data structure
     8084 *
     8085 * Structure for representing a single row of p4cRun table data.
     8086 */
     8087
     8088typedef struct {
     8089    psS32           p4c_id;
     8090    char            *state;
     8091    char            *workdir;
     8092    bool            magic;
     8093} p4cRunRow;
     8094
     8095/** Creates a new p4cRunRow object
     8096 *
     8097 *  @return A new p4cRunRow object or NULL on failure.
     8098 */
     8099
     8100p4cRunRow *p4cRunRowAlloc(
     8101    psS32           p4c_id,
     8102    const char      *state,
     8103    const char      *workdir,
     8104    bool            magic
     8105);
     8106
     8107/** Creates a new p4cRun table
     8108 *
     8109 * @return true on success
     8110 */
     8111
     8112bool p4cRunCreateTable(
     8113    psDB            *dbh                ///< Database handle
     8114);
     8115
     8116/** Deletes a p4cRun table
     8117 *
     8118 * @return true on success
     8119 */
     8120
     8121bool p4cRunDropTable(
     8122    psDB            *dbh                ///< Database handle
     8123);
     8124
     8125/** Insert a single row into a table
     8126 *
     8127 * This function constructs and inserts a single row based on it's parameters.
     8128 *
     8129 * @return true on success
     8130 */
     8131
     8132bool p4cRunInsert(
     8133    psDB            *dbh,               ///< Database handle
     8134    psS32           p4c_id,
     8135    const char      *state,
     8136    const char      *workdir,
     8137    bool            magic
     8138);
     8139
     8140/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     8141 *
     8142 * @return A The number of rows removed or a negative value on error
     8143 */
     8144
     8145long long p4cRunDelete(
     8146    psDB            *dbh,               ///< Database handle
     8147    const psMetadata *where,            ///< Row match criteria
     8148    unsigned long long limit            ///< Maximum number of elements to delete
     8149);
     8150
     8151/** Insert a single p4cRunRow object into a table
     8152 *
     8153 * This function constructs and inserts a single row based on it's parameters.
     8154 *
     8155 * @return true on success
     8156 */
     8157
     8158bool p4cRunInsertObject(
     8159    psDB            *dbh,               ///< Database handle
     8160    p4cRunRow       *object             ///< p4cRunRow object
     8161);
     8162
     8163/** Insert an array of p4cRunRow object into a table
     8164 *
     8165 * This function constructs and inserts multiple rows based on it's parameters.
     8166 *
     8167 * @return true on success
     8168 */
     8169
     8170bool p4cRunInsertObjects(
     8171    psDB            *dbh,               ///< Database handle
     8172    psArray         *objects            ///< array of p4cRunRow objects
     8173);
     8174
     8175/** Insert data from a binary FITS table p4cRunRow into the database
     8176 *
     8177 * This function expects a psFits object with a FITS table as the first
     8178 * extension.  The table must have at least one row of data in it, that is of
     8179 * the appropriate format (number of columns and their type).  All other
     8180 * extensions are ignored.
     8181 *
     8182 * @return true on success
     8183 */
     8184
     8185bool p4cRunInsertFits(
     8186    psDB            *dbh,               ///< Database handle
     8187    const psFits    *fits               ///< psFits object
     8188);
     8189
     8190/** Selects up to limit from the database and returns them in a binary FITS table
     8191 *
     8192 * This function assumes an empty psFits object and will create a FITS table
     8193 * as the first extension.
     8194 *
     8195 *  See psDBSelectRows() for documentation on the format of where.
     8196 *
     8197 * @return true on success
     8198 */
     8199
     8200bool p4cRunSelectRowsFits(
     8201    psDB            *dbh,               ///< Database handle
     8202    psFits          *fits,              ///< psFits object
     8203    const psMetadata *where,            ///< Row match criteria
     8204    unsigned long long limit            ///< Maximum number of elements to return
     8205);
     8206
     8207/** Convert a p4cRunRow into an equivalent psMetadata
     8208 *
     8209 * @return A psMetadata pointer or NULL on error
     8210 */
     8211
     8212psMetadata *p4cRunMetadataFromObject(
     8213    const p4cRunRow *object             ///< fooRow to convert into a psMetadata
     8214);
     8215
     8216/** Convert a psMetadata into an equivalent fooRow
     8217 *
     8218 * @return A p4cRunRow pointer or NULL on error
     8219 */
     8220
     8221p4cRunRow *p4cRunObjectFromMetadata(
     8222    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     8223);
     8224/** Selects up to limit rows from the database and returns as p4cRunRow objects in a psArray
     8225 *
     8226 *  See psDBSelectRows() for documentation on the format of where.
     8227 *
     8228 * @return A psArray pointer or NULL on error
     8229 */
     8230
     8231psArray *p4cRunSelectRowObjects(
     8232    psDB            *dbh,               ///< Database handle
     8233    const psMetadata *where,            ///< Row match criteria
     8234    unsigned long long limit            ///< Maximum number of elements to return
     8235);
     8236/** Deletes a row from the database coresponding to an p4cRun
     8237 *
     8238 *  Note that a 'where' search psMetadata is constructed from each object and
     8239 *  used to find rows to delete.
     8240 *
     8241 * @return A The number of rows removed or a negative value on error
     8242 */
     8243
     8244bool p4cRunDeleteObject(
     8245    psDB            *dbh,               ///< Database handle
     8246    const p4cRunRow *object    ///< Object to delete
     8247);
     8248/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     8249 *
     8250 *  Note that a 'where' search psMetadata is constructed from each object and
     8251 *  used to find rows to delete.
     8252 *
     8253 * @return A The number of rows removed or a negative value on error
     8254 */
     8255
     8256long long p4cRunDeleteRowObjects(
     8257    psDB            *dbh,               ///< Database handle
     8258    const psArray   *objects,           ///< Array of objects to delete
     8259    unsigned long long limit            ///< Maximum number of elements to delete
     8260);
     8261/** Formats and prints an array of p4cRunRow objects
     8262 *
     8263 * When mdcf is set the formated output is in psMetadataConfig
     8264 * format, otherwise it is in a simple tabular format.
     8265 *
     8266 * @return true on success
     8267 */
     8268
     8269bool p4cRunPrintObjects(
     8270    FILE            *stream,            ///< a stream
     8271    psArray         *objects,           ///< An array of p4cRunRow objects
     8272    bool            mdcf                ///< format as mdconfig or simple
     8273);
     8274/** Formats and prints an p4cRunRow object
     8275 *
     8276 * When mdcf is set the formated output is in psMetadataConfig
     8277 * format, otherwise it is in a simple tabular format.
     8278 *
     8279 * @return true on success
     8280 */
     8281
     8282bool p4cRunPrintObject(
     8283    FILE            *stream,            ///< a stream
     8284    p4cRunRow *object,    ///< an p4cRunRow object
     8285    bool            mdcf                ///< format as mdconfig or simple
     8286);
     8287/** p4cInputExpRow data structure
     8288 *
     8289 * Structure for representing a single row of p4cInputExp table data.
     8290 */
     8291
     8292typedef struct {
     8293    psS32           p4c_id;
     8294    char            *exp_tag;
     8295    psS32           p3_version;
     8296} p4cInputExpRow;
     8297
     8298/** Creates a new p4cInputExpRow object
     8299 *
     8300 *  @return A new p4cInputExpRow object or NULL on failure.
     8301 */
     8302
     8303p4cInputExpRow *p4cInputExpRowAlloc(
     8304    psS32           p4c_id,
     8305    const char      *exp_tag,
     8306    psS32           p3_version
     8307);
     8308
     8309/** Creates a new p4cInputExp table
     8310 *
     8311 * @return true on success
     8312 */
     8313
     8314bool p4cInputExpCreateTable(
     8315    psDB            *dbh                ///< Database handle
     8316);
     8317
     8318/** Deletes a p4cInputExp table
     8319 *
     8320 * @return true on success
     8321 */
     8322
     8323bool p4cInputExpDropTable(
     8324    psDB            *dbh                ///< Database handle
     8325);
     8326
     8327/** Insert a single row into a table
     8328 *
     8329 * This function constructs and inserts a single row based on it's parameters.
     8330 *
     8331 * @return true on success
     8332 */
     8333
     8334bool p4cInputExpInsert(
     8335    psDB            *dbh,               ///< Database handle
     8336    psS32           p4c_id,
     8337    const char      *exp_tag,
     8338    psS32           p3_version
     8339);
     8340
     8341/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     8342 *
     8343 * @return A The number of rows removed or a negative value on error
     8344 */
     8345
     8346long long p4cInputExpDelete(
     8347    psDB            *dbh,               ///< Database handle
     8348    const psMetadata *where,            ///< Row match criteria
     8349    unsigned long long limit            ///< Maximum number of elements to delete
     8350);
     8351
     8352/** Insert a single p4cInputExpRow object into a table
     8353 *
     8354 * This function constructs and inserts a single row based on it's parameters.
     8355 *
     8356 * @return true on success
     8357 */
     8358
     8359bool p4cInputExpInsertObject(
     8360    psDB            *dbh,               ///< Database handle
     8361    p4cInputExpRow  *object             ///< p4cInputExpRow object
     8362);
     8363
     8364/** Insert an array of p4cInputExpRow object into a table
     8365 *
     8366 * This function constructs and inserts multiple rows based on it's parameters.
     8367 *
     8368 * @return true on success
     8369 */
     8370
     8371bool p4cInputExpInsertObjects(
     8372    psDB            *dbh,               ///< Database handle
     8373    psArray         *objects            ///< array of p4cInputExpRow objects
     8374);
     8375
     8376/** Insert data from a binary FITS table p4cInputExpRow into the database
     8377 *
     8378 * This function expects a psFits object with a FITS table as the first
     8379 * extension.  The table must have at least one row of data in it, that is of
     8380 * the appropriate format (number of columns and their type).  All other
     8381 * extensions are ignored.
     8382 *
     8383 * @return true on success
     8384 */
     8385
     8386bool p4cInputExpInsertFits(
     8387    psDB            *dbh,               ///< Database handle
     8388    const psFits    *fits               ///< psFits object
     8389);
     8390
     8391/** Selects up to limit from the database and returns them in a binary FITS table
     8392 *
     8393 * This function assumes an empty psFits object and will create a FITS table
     8394 * as the first extension.
     8395 *
     8396 *  See psDBSelectRows() for documentation on the format of where.
     8397 *
     8398 * @return true on success
     8399 */
     8400
     8401bool p4cInputExpSelectRowsFits(
     8402    psDB            *dbh,               ///< Database handle
     8403    psFits          *fits,              ///< psFits object
     8404    const psMetadata *where,            ///< Row match criteria
     8405    unsigned long long limit            ///< Maximum number of elements to return
     8406);
     8407
     8408/** Convert a p4cInputExpRow into an equivalent psMetadata
     8409 *
     8410 * @return A psMetadata pointer or NULL on error
     8411 */
     8412
     8413psMetadata *p4cInputExpMetadataFromObject(
     8414    const p4cInputExpRow *object             ///< fooRow to convert into a psMetadata
     8415);
     8416
     8417/** Convert a psMetadata into an equivalent fooRow
     8418 *
     8419 * @return A p4cInputExpRow pointer or NULL on error
     8420 */
     8421
     8422p4cInputExpRow *p4cInputExpObjectFromMetadata(
     8423    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     8424);
     8425/** Selects up to limit rows from the database and returns as p4cInputExpRow objects in a psArray
     8426 *
     8427 *  See psDBSelectRows() for documentation on the format of where.
     8428 *
     8429 * @return A psArray pointer or NULL on error
     8430 */
     8431
     8432psArray *p4cInputExpSelectRowObjects(
     8433    psDB            *dbh,               ///< Database handle
     8434    const psMetadata *where,            ///< Row match criteria
     8435    unsigned long long limit            ///< Maximum number of elements to return
     8436);
     8437/** Deletes a row from the database coresponding to an p4cInputExp
     8438 *
     8439 *  Note that a 'where' search psMetadata is constructed from each object and
     8440 *  used to find rows to delete.
     8441 *
     8442 * @return A The number of rows removed or a negative value on error
     8443 */
     8444
     8445bool p4cInputExpDeleteObject(
     8446    psDB            *dbh,               ///< Database handle
     8447    const p4cInputExpRow *object    ///< Object to delete
     8448);
     8449/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     8450 *
     8451 *  Note that a 'where' search psMetadata is constructed from each object and
     8452 *  used to find rows to delete.
     8453 *
     8454 * @return A The number of rows removed or a negative value on error
     8455 */
     8456
     8457long long p4cInputExpDeleteRowObjects(
     8458    psDB            *dbh,               ///< Database handle
     8459    const psArray   *objects,           ///< Array of objects to delete
     8460    unsigned long long limit            ///< Maximum number of elements to delete
     8461);
     8462/** Formats and prints an array of p4cInputExpRow objects
     8463 *
     8464 * When mdcf is set the formated output is in psMetadataConfig
     8465 * format, otherwise it is in a simple tabular format.
     8466 *
     8467 * @return true on success
     8468 */
     8469
     8470bool p4cInputExpPrintObjects(
     8471    FILE            *stream,            ///< a stream
     8472    psArray         *objects,           ///< An array of p4cInputExpRow objects
     8473    bool            mdcf                ///< format as mdconfig or simple
     8474);
     8475/** Formats and prints an p4cInputExpRow object
     8476 *
     8477 * When mdcf is set the formated output is in psMetadataConfig
     8478 * format, otherwise it is in a simple tabular format.
     8479 *
     8480 * @return true on success
     8481 */
     8482
     8483bool p4cInputExpPrintObject(
     8484    FILE            *stream,            ///< a stream
     8485    p4cInputExpRow *object,    ///< an p4cInputExpRow object
     8486    bool            mdcf                ///< format as mdconfig or simple
     8487);
    78948488/** p4MagicMaskImfileRow data structure
    78958489 *
     
    78988492
    78998493typedef struct {
    7900     psS32           p4_id;
     8494    psS32           p4c_id;
    79018495    char            *exp_tag;
    79028496    psS32           p3_version;
     
    79118505
    79128506p4MagicMaskImfileRow *p4MagicMaskImfileRowAlloc(
    7913     psS32           p4_id,
     8507    psS32           p4c_id,
    79148508    const char      *exp_tag,
    79158509    psS32           p3_version,
     
    79458539bool p4MagicMaskImfileInsert(
    79468540    psDB            *dbh,               ///< Database handle
    7947     psS32           p4_id,
     8541    psS32           p4c_id,
    79488542    const char      *exp_tag,
    79498543    psS32           p3_version,
     
    80998693    bool            mdcf                ///< format as mdconfig or simple
    81008694);
     8695/** skyCellRow data structure
     8696 *
     8697 * Structure for representing a single row of skyCell table data.
     8698 */
     8699
     8700typedef struct {
     8701    char            *skycell_id;
     8702    char            *tess_id;
     8703    psF64           ra1;
     8704    psF64           decl1;
     8705    psF64           ra2;
     8706    psF64           decl2;
     8707    psF64           ra3;
     8708    psF64           decl3;
     8709    psF64           ra4;
     8710    psF64           decl4;
     8711} skyCellRow;
     8712
     8713/** Creates a new skyCellRow object
     8714 *
     8715 *  @return A new skyCellRow object or NULL on failure.
     8716 */
     8717
     8718skyCellRow *skyCellRowAlloc(
     8719    const char      *skycell_id,
     8720    const char      *tess_id,
     8721    psF64           ra1,
     8722    psF64           decl1,
     8723    psF64           ra2,
     8724    psF64           decl2,
     8725    psF64           ra3,
     8726    psF64           decl3,
     8727    psF64           ra4,
     8728    psF64           decl4
     8729);
     8730
     8731/** Creates a new skyCell table
     8732 *
     8733 * @return true on success
     8734 */
     8735
     8736bool skyCellCreateTable(
     8737    psDB            *dbh                ///< Database handle
     8738);
     8739
     8740/** Deletes a skyCell table
     8741 *
     8742 * @return true on success
     8743 */
     8744
     8745bool skyCellDropTable(
     8746    psDB            *dbh                ///< Database handle
     8747);
     8748
     8749/** Insert a single row into a table
     8750 *
     8751 * This function constructs and inserts a single row based on it's parameters.
     8752 *
     8753 * @return true on success
     8754 */
     8755
     8756bool skyCellInsert(
     8757    psDB            *dbh,               ///< Database handle
     8758    const char      *skycell_id,
     8759    const char      *tess_id,
     8760    psF64           ra1,
     8761    psF64           decl1,
     8762    psF64           ra2,
     8763    psF64           decl2,
     8764    psF64           ra3,
     8765    psF64           decl3,
     8766    psF64           ra4,
     8767    psF64           decl4
     8768);
     8769
     8770/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     8771 *
     8772 * @return A The number of rows removed or a negative value on error
     8773 */
     8774
     8775long long skyCellDelete(
     8776    psDB            *dbh,               ///< Database handle
     8777    const psMetadata *where,            ///< Row match criteria
     8778    unsigned long long limit            ///< Maximum number of elements to delete
     8779);
     8780
     8781/** Insert a single skyCellRow object into a table
     8782 *
     8783 * This function constructs and inserts a single row based on it's parameters.
     8784 *
     8785 * @return true on success
     8786 */
     8787
     8788bool skyCellInsertObject(
     8789    psDB            *dbh,               ///< Database handle
     8790    skyCellRow      *object             ///< skyCellRow object
     8791);
     8792
     8793/** Insert an array of skyCellRow object into a table
     8794 *
     8795 * This function constructs and inserts multiple rows based on it's parameters.
     8796 *
     8797 * @return true on success
     8798 */
     8799
     8800bool skyCellInsertObjects(
     8801    psDB            *dbh,               ///< Database handle
     8802    psArray         *objects            ///< array of skyCellRow objects
     8803);
     8804
     8805/** Insert data from a binary FITS table skyCellRow into the database
     8806 *
     8807 * This function expects a psFits object with a FITS table as the first
     8808 * extension.  The table must have at least one row of data in it, that is of
     8809 * the appropriate format (number of columns and their type).  All other
     8810 * extensions are ignored.
     8811 *
     8812 * @return true on success
     8813 */
     8814
     8815bool skyCellInsertFits(
     8816    psDB            *dbh,               ///< Database handle
     8817    const psFits    *fits               ///< psFits object
     8818);
     8819
     8820/** Selects up to limit from the database and returns them in a binary FITS table
     8821 *
     8822 * This function assumes an empty psFits object and will create a FITS table
     8823 * as the first extension.
     8824 *
     8825 *  See psDBSelectRows() for documentation on the format of where.
     8826 *
     8827 * @return true on success
     8828 */
     8829
     8830bool skyCellSelectRowsFits(
     8831    psDB            *dbh,               ///< Database handle
     8832    psFits          *fits,              ///< psFits object
     8833    const psMetadata *where,            ///< Row match criteria
     8834    unsigned long long limit            ///< Maximum number of elements to return
     8835);
     8836
     8837/** Convert a skyCellRow into an equivalent psMetadata
     8838 *
     8839 * @return A psMetadata pointer or NULL on error
     8840 */
     8841
     8842psMetadata *skyCellMetadataFromObject(
     8843    const skyCellRow *object             ///< fooRow to convert into a psMetadata
     8844);
     8845
     8846/** Convert a psMetadata into an equivalent fooRow
     8847 *
     8848 * @return A skyCellRow pointer or NULL on error
     8849 */
     8850
     8851skyCellRow *skyCellObjectFromMetadata(
     8852    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     8853);
     8854/** Selects up to limit rows from the database and returns as skyCellRow objects in a psArray
     8855 *
     8856 *  See psDBSelectRows() for documentation on the format of where.
     8857 *
     8858 * @return A psArray pointer or NULL on error
     8859 */
     8860
     8861psArray *skyCellSelectRowObjects(
     8862    psDB            *dbh,               ///< Database handle
     8863    const psMetadata *where,            ///< Row match criteria
     8864    unsigned long long limit            ///< Maximum number of elements to return
     8865);
     8866/** Deletes a row from the database coresponding to an skyCell
     8867 *
     8868 *  Note that a 'where' search psMetadata is constructed from each object and
     8869 *  used to find rows to delete.
     8870 *
     8871 * @return A The number of rows removed or a negative value on error
     8872 */
     8873
     8874bool skyCellDeleteObject(
     8875    psDB            *dbh,               ///< Database handle
     8876    const skyCellRow *object    ///< Object to delete
     8877);
     8878/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     8879 *
     8880 *  Note that a 'where' search psMetadata is constructed from each object and
     8881 *  used to find rows to delete.
     8882 *
     8883 * @return A The number of rows removed or a negative value on error
     8884 */
     8885
     8886long long skyCellDeleteRowObjects(
     8887    psDB            *dbh,               ///< Database handle
     8888    const psArray   *objects,           ///< Array of objects to delete
     8889    unsigned long long limit            ///< Maximum number of elements to delete
     8890);
     8891/** Formats and prints an array of skyCellRow objects
     8892 *
     8893 * When mdcf is set the formated output is in psMetadataConfig
     8894 * format, otherwise it is in a simple tabular format.
     8895 *
     8896 * @return true on success
     8897 */
     8898
     8899bool skyCellPrintObjects(
     8900    FILE            *stream,            ///< a stream
     8901    psArray         *objects,           ///< An array of skyCellRow objects
     8902    bool            mdcf                ///< format as mdconfig or simple
     8903);
     8904/** Formats and prints an skyCellRow object
     8905 *
     8906 * When mdcf is set the formated output is in psMetadataConfig
     8907 * format, otherwise it is in a simple tabular format.
     8908 *
     8909 * @return true on success
     8910 */
     8911
     8912bool skyCellPrintObject(
     8913    FILE            *stream,            ///< a stream
     8914    skyCellRow *object,    ///< an skyCellRow object
     8915    bool            mdcf                ///< format as mdconfig or simple
     8916);
     8917/** skyCellMapRow data structure
     8918 *
     8919 * Structure for representing a single row of skyCellMap table data.
     8920 */
     8921
     8922typedef struct {
     8923    char            *skycell_id;
     8924    char            *tess_id;
     8925    char            *exp_tag;
     8926    char            *class_id;
     8927} skyCellMapRow;
     8928
     8929/** Creates a new skyCellMapRow object
     8930 *
     8931 *  @return A new skyCellMapRow object or NULL on failure.
     8932 */
     8933
     8934skyCellMapRow *skyCellMapRowAlloc(
     8935    const char      *skycell_id,
     8936    const char      *tess_id,
     8937    const char      *exp_tag,
     8938    const char      *class_id
     8939);
     8940
     8941/** Creates a new skyCellMap table
     8942 *
     8943 * @return true on success
     8944 */
     8945
     8946bool skyCellMapCreateTable(
     8947    psDB            *dbh                ///< Database handle
     8948);
     8949
     8950/** Deletes a skyCellMap table
     8951 *
     8952 * @return true on success
     8953 */
     8954
     8955bool skyCellMapDropTable(
     8956    psDB            *dbh                ///< Database handle
     8957);
     8958
     8959/** Insert a single row into a table
     8960 *
     8961 * This function constructs and inserts a single row based on it's parameters.
     8962 *
     8963 * @return true on success
     8964 */
     8965
     8966bool skyCellMapInsert(
     8967    psDB            *dbh,               ///< Database handle
     8968    const char      *skycell_id,
     8969    const char      *tess_id,
     8970    const char      *exp_tag,
     8971    const char      *class_id
     8972);
     8973
     8974/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     8975 *
     8976 * @return A The number of rows removed or a negative value on error
     8977 */
     8978
     8979long long skyCellMapDelete(
     8980    psDB            *dbh,               ///< Database handle
     8981    const psMetadata *where,            ///< Row match criteria
     8982    unsigned long long limit            ///< Maximum number of elements to delete
     8983);
     8984
     8985/** Insert a single skyCellMapRow object into a table
     8986 *
     8987 * This function constructs and inserts a single row based on it's parameters.
     8988 *
     8989 * @return true on success
     8990 */
     8991
     8992bool skyCellMapInsertObject(
     8993    psDB            *dbh,               ///< Database handle
     8994    skyCellMapRow   *object             ///< skyCellMapRow object
     8995);
     8996
     8997/** Insert an array of skyCellMapRow object into a table
     8998 *
     8999 * This function constructs and inserts multiple rows based on it's parameters.
     9000 *
     9001 * @return true on success
     9002 */
     9003
     9004bool skyCellMapInsertObjects(
     9005    psDB            *dbh,               ///< Database handle
     9006    psArray         *objects            ///< array of skyCellMapRow objects
     9007);
     9008
     9009/** Insert data from a binary FITS table skyCellMapRow into the database
     9010 *
     9011 * This function expects a psFits object with a FITS table as the first
     9012 * extension.  The table must have at least one row of data in it, that is of
     9013 * the appropriate format (number of columns and their type).  All other
     9014 * extensions are ignored.
     9015 *
     9016 * @return true on success
     9017 */
     9018
     9019bool skyCellMapInsertFits(
     9020    psDB            *dbh,               ///< Database handle
     9021    const psFits    *fits               ///< psFits object
     9022);
     9023
     9024/** Selects up to limit from the database and returns them in a binary FITS table
     9025 *
     9026 * This function assumes an empty psFits object and will create a FITS table
     9027 * as the first extension.
     9028 *
     9029 *  See psDBSelectRows() for documentation on the format of where.
     9030 *
     9031 * @return true on success
     9032 */
     9033
     9034bool skyCellMapSelectRowsFits(
     9035    psDB            *dbh,               ///< Database handle
     9036    psFits          *fits,              ///< psFits object
     9037    const psMetadata *where,            ///< Row match criteria
     9038    unsigned long long limit            ///< Maximum number of elements to return
     9039);
     9040
     9041/** Convert a skyCellMapRow into an equivalent psMetadata
     9042 *
     9043 * @return A psMetadata pointer or NULL on error
     9044 */
     9045
     9046psMetadata *skyCellMapMetadataFromObject(
     9047    const skyCellMapRow *object             ///< fooRow to convert into a psMetadata
     9048);
     9049
     9050/** Convert a psMetadata into an equivalent fooRow
     9051 *
     9052 * @return A skyCellMapRow pointer or NULL on error
     9053 */
     9054
     9055skyCellMapRow *skyCellMapObjectFromMetadata(
     9056    psMetadata      *md                 ///< psMetadata to convert into a fooRow
     9057);
     9058/** Selects up to limit rows from the database and returns as skyCellMapRow objects in a psArray
     9059 *
     9060 *  See psDBSelectRows() for documentation on the format of where.
     9061 *
     9062 * @return A psArray pointer or NULL on error
     9063 */
     9064
     9065psArray *skyCellMapSelectRowObjects(
     9066    psDB            *dbh,               ///< Database handle
     9067    const psMetadata *where,            ///< Row match criteria
     9068    unsigned long long limit            ///< Maximum number of elements to return
     9069);
     9070/** Deletes a row from the database coresponding to an skyCellMap
     9071 *
     9072 *  Note that a 'where' search psMetadata is constructed from each object and
     9073 *  used to find rows to delete.
     9074 *
     9075 * @return A The number of rows removed or a negative value on error
     9076 */
     9077
     9078bool skyCellMapDeleteObject(
     9079    psDB            *dbh,               ///< Database handle
     9080    const skyCellMapRow *object    ///< Object to delete
     9081);
     9082/** Deletes up to limit rows from the database and returns the number of rows actually deleted.
     9083 *
     9084 *  Note that a 'where' search psMetadata is constructed from each object and
     9085 *  used to find rows to delete.
     9086 *
     9087 * @return A The number of rows removed or a negative value on error
     9088 */
     9089
     9090long long skyCellMapDeleteRowObjects(
     9091    psDB            *dbh,               ///< Database handle
     9092    const psArray   *objects,           ///< Array of objects to delete
     9093    unsigned long long limit            ///< Maximum number of elements to delete
     9094);
     9095/** Formats and prints an array of skyCellMapRow objects
     9096 *
     9097 * When mdcf is set the formated output is in psMetadataConfig
     9098 * format, otherwise it is in a simple tabular format.
     9099 *
     9100 * @return true on success
     9101 */
     9102
     9103bool skyCellMapPrintObjects(
     9104    FILE            *stream,            ///< a stream
     9105    psArray         *objects,           ///< An array of skyCellMapRow objects
     9106    bool            mdcf                ///< format as mdconfig or simple
     9107);
     9108/** Formats and prints an skyCellMapRow object
     9109 *
     9110 * When mdcf is set the formated output is in psMetadataConfig
     9111 * format, otherwise it is in a simple tabular format.
     9112 *
     9113 * @return true on success
     9114 */
     9115
     9116bool skyCellMapPrintObject(
     9117    FILE            *stream,            ///< a stream
     9118    skyCellMapRow *object,    ///< an skyCellMapRow object
     9119    bool            mdcf                ///< format as mdconfig or simple
     9120);
    81019121
    81029122/// @}
     
    81069126#endif
    81079127
    8108 #endif // P4MAGICMASKIMFILE_DB_H
     9128#endif // SKYCELLMAP_DB_H
Note: See TracChangeset for help on using the changeset viewer.