IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9187


Ignore:
Timestamp:
Oct 3, 2006, 6:32:18 PM (20 years ago)
Author:
jhoblitt
Message:

VERSION 0.0.43

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/dbconfig/config.md

    r9182 r9187  
    22    pkg_name        STR     ippdb
    33    pkg_namespace   STR     ippdb
    4     pkg_version     STR     0.0.42
     4    pkg_version     STR     0.0.43
    55END
  • trunk/ippdb/configure.ac

    r9183 r9187  
    77AC_PREREQ(2.59)
    88
    9 AC_INIT([ippdb], [0.0.42], [pan-starrs.ifa.hawaii.edu])
     9AC_INIT([ippdb], [0.0.43], [pan-starrs.ifa.hawaii.edu])
    1010AC_CONFIG_SRCDIR([ippdb.pc.in])
    1111
  • trunk/ippdb/src/ippdb.c

    r9183 r9187  
    71947194static void rawDetrendExpRowFree(rawDetrendExpRow *object);
    71957195
    7196 rawDetrendExpRow *rawDetrendExpRowAlloc(const char *exp_tag, const char *camera, const char *telescope, const char *exp_type, psS32 imfiles, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang)
     7196rawDetrendExpRow *rawDetrendExpRowAlloc(const char *exp_tag, const char *camera, const char *telescope, const char *exp_type, psS32 imfiles, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *obstype)
    71977197{
    71987198    rawDetrendExpRow *object;
     
    72187218    object->ccd_temp = ccd_temp;
    72197219    object->posang = posang;
     7220    object->obstype = psStringCopy(obstype);
    72207221
    72217222    return object;
     
    72297230    psFree(object->exp_type);
    72307231    psFree(object->filter);
     7232    psFree(object->obstype);
    72317233}
    72327234
     
    73277329        return false;
    73287330    }
     7331    if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, "64")) {
     7332        psError(PS_ERR_UNKNOWN, false, "failed to add item obstype");
     7333        psFree(md);
     7334        return false;
     7335    }
    73297336
    73307337    status = psDBCreateTable(dbh, RAWDETRENDEXP_TABLE_NAME, md);
     
    73407347}
    73417348
    7342 bool rawDetrendExpInsert(psDB * dbh, const char *exp_tag, const char *camera, const char *telescope, const char *exp_type, psS32 imfiles, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang)
     7349bool rawDetrendExpInsert(psDB * dbh, const char *exp_tag, const char *camera, const char *telescope, const char *exp_type, psS32 imfiles, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *obstype)
    73437350{
    73447351    psMetadata      *md;
     
    74287435    if (!psMetadataAddF64(md, PS_LIST_TAIL, "posang", 0, NULL, posang)) {
    74297436        psError(PS_ERR_UNKNOWN, false, "failed to add item posang");
     7437        psFree(md);
     7438        return false;
     7439    }
     7440    if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, obstype)) {
     7441        psError(PS_ERR_UNKNOWN, false, "failed to add item obstype");
    74307442        psFree(md);
    74317443        return false;
     
    74527464    return deleted;
    74537465}
    7454 bool rawDetrendExpPop(psDB *dbh, char **exp_tag, char **camera, char **telescope, char **exp_type, psS32 *imfiles, char **filter, psF32 *airmass, psF64 *ra, psF64 *decl, psF32 *exp_time, psF64 *bg, psF64 *bg_stdev, psF64 *bg_mean_stdev, psF64 *alt, psF64 *az, psF32 *ccd_temp, psF64 *posang)
     7466bool rawDetrendExpPop(psDB *dbh, char **exp_tag, char **camera, char **telescope, char **exp_type, psS32 *imfiles, char **filter, psF32 *airmass, psF64 *ra, psF64 *decl, psF32 *exp_time, psF64 *bg, psF64 *bg_stdev, psF64 *bg_mean_stdev, psF64 *alt, psF64 *az, psF32 *ccd_temp, psF64 *posang, char **obstype)
    74557467{
    74567468    psArray         *rowSet;
     
    75987610        return false;
    75997611    }
     7612    *obstype = psMetadataLookupPtr(&status, row, "obstype");
     7613    if (!status) {
     7614        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item obstype");
     7615        psFree(row);
     7616        return false;
     7617    }
    76007618
    76017619    psFree(row);
     
    76067624bool rawDetrendExpInsertObject(psDB *dbh, rawDetrendExpRow *object)
    76077625{
    7608     return rawDetrendExpInsert(dbh, object->exp_tag, object->camera, object->telescope, object->exp_type, object->imfiles, object->filter, object->airmass, object->ra, object->decl, object->exp_time, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang);
     7626    return rawDetrendExpInsert(dbh, object->exp_tag, object->camera, object->telescope, object->exp_type, object->imfiles, object->filter, object->airmass, object->ra, object->decl, object->exp_time, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->obstype);
    76097627}
    76107628
     
    76397657    psF32           ccd_temp;
    76407658    psF64           posang;
    7641 
    7642     if (!rawDetrendExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang)) {
     7659    char            obstype[256];
     7660
     7661    if (!rawDetrendExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang, (char **)&obstype)) {
    76437662        psError(PS_ERR_UNKNOWN, false, "failed to pop a database row");
    76447663        return NULL;
    76457664    }
    76467665
    7647     return rawDetrendExpRowAlloc(exp_tag, camera, telescope, exp_type, imfiles, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang);
     7666    return rawDetrendExpRowAlloc(exp_tag, camera, telescope, exp_type, imfiles, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, obstype);
    76487667}
    76497668
     
    78267845    if (!psMetadataAddF64(md, PS_LIST_TAIL, "posang", 0, NULL, object->posang)) {
    78277846        psError(PS_ERR_UNKNOWN, false, "failed to add item posang");
     7847        psFree(md);
     7848        return NULL;
     7849    }
     7850    if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, object->obstype)) {
     7851        psError(PS_ERR_UNKNOWN, false, "failed to add item obstype");
    78287852        psFree(md);
    78297853        return NULL;
     
    78537877    psF32           ccd_temp;
    78547878    psF64           posang;
     7879    char            *obstype;
    78557880
    78567881    exp_tag = psMetadataLookupPtr(&status, md, "exp_tag");
     
    79397964        return false;
    79407965    }
    7941 
    7942     return rawDetrendExpRowAlloc(exp_tag, camera, telescope, exp_type, imfiles, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang);
     7966    obstype = psMetadataLookupPtr(&status, md, "obstype");
     7967    if (!status) {
     7968        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item obstype");
     7969        return false;
     7970    }
     7971
     7972    return rawDetrendExpRowAlloc(exp_tag, camera, telescope, exp_type, imfiles, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, obstype);
    79437973}
    79447974psArray *rawDetrendExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    80478077static void rawScienceExpRowFree(rawScienceExpRow *object);
    80488078
    8049 rawScienceExpRow *rawScienceExpRowAlloc(const char *exp_tag, const char *camera, const char *telescope, const char *exp_type, psS32 imfiles, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang)
     8079rawScienceExpRow *rawScienceExpRowAlloc(const char *exp_tag, const char *camera, const char *telescope, const char *exp_type, psS32 imfiles, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *obstype)
    80508080{
    80518081    rawScienceExpRow *object;
     
    80718101    object->ccd_temp = ccd_temp;
    80728102    object->posang = posang;
     8103    object->obstype = psStringCopy(obstype);
    80738104
    80748105    return object;
     
    80828113    psFree(object->exp_type);
    80838114    psFree(object->filter);
     8115    psFree(object->obstype);
    80848116}
    80858117
     
    81808212        return false;
    81818213    }
     8214    if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, "64")) {
     8215        psError(PS_ERR_UNKNOWN, false, "failed to add item obstype");
     8216        psFree(md);
     8217        return false;
     8218    }
    81828219
    81838220    status = psDBCreateTable(dbh, RAWSCIENCEEXP_TABLE_NAME, md);
     
    81938230}
    81948231
    8195 bool rawScienceExpInsert(psDB * dbh, const char *exp_tag, const char *camera, const char *telescope, const char *exp_type, psS32 imfiles, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang)
     8232bool rawScienceExpInsert(psDB * dbh, const char *exp_tag, const char *camera, const char *telescope, const char *exp_type, psS32 imfiles, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *obstype)
    81968233{
    81978234    psMetadata      *md;
     
    82818318    if (!psMetadataAddF64(md, PS_LIST_TAIL, "posang", 0, NULL, posang)) {
    82828319        psError(PS_ERR_UNKNOWN, false, "failed to add item posang");
     8320        psFree(md);
     8321        return false;
     8322    }
     8323    if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, obstype)) {
     8324        psError(PS_ERR_UNKNOWN, false, "failed to add item obstype");
    82838325        psFree(md);
    82848326        return false;
     
    83058347    return deleted;
    83068348}
    8307 bool rawScienceExpPop(psDB *dbh, char **exp_tag, char **camera, char **telescope, char **exp_type, psS32 *imfiles, char **filter, psF32 *airmass, psF64 *ra, psF64 *decl, psF32 *exp_time, psF64 *bg, psF64 *bg_stdev, psF64 *bg_mean_stdev, psF64 *alt, psF64 *az, psF32 *ccd_temp, psF64 *posang)
     8349bool rawScienceExpPop(psDB *dbh, char **exp_tag, char **camera, char **telescope, char **exp_type, psS32 *imfiles, char **filter, psF32 *airmass, psF64 *ra, psF64 *decl, psF32 *exp_time, psF64 *bg, psF64 *bg_stdev, psF64 *bg_mean_stdev, psF64 *alt, psF64 *az, psF32 *ccd_temp, psF64 *posang, char **obstype)
    83088350{
    83098351    psArray         *rowSet;
     
    84518493        return false;
    84528494    }
     8495    *obstype = psMetadataLookupPtr(&status, row, "obstype");
     8496    if (!status) {
     8497        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item obstype");
     8498        psFree(row);
     8499        return false;
     8500    }
    84538501
    84548502    psFree(row);
     
    84598507bool rawScienceExpInsertObject(psDB *dbh, rawScienceExpRow *object)
    84608508{
    8461     return rawScienceExpInsert(dbh, object->exp_tag, object->camera, object->telescope, object->exp_type, object->imfiles, object->filter, object->airmass, object->ra, object->decl, object->exp_time, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang);
     8509    return rawScienceExpInsert(dbh, object->exp_tag, object->camera, object->telescope, object->exp_type, object->imfiles, object->filter, object->airmass, object->ra, object->decl, object->exp_time, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->obstype);
    84628510}
    84638511
     
    84928540    psF32           ccd_temp;
    84938541    psF64           posang;
    8494 
    8495     if (!rawScienceExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang)) {
     8542    char            obstype[256];
     8543
     8544    if (!rawScienceExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang, (char **)&obstype)) {
    84968545        psError(PS_ERR_UNKNOWN, false, "failed to pop a database row");
    84978546        return NULL;
    84988547    }
    84998548
    8500     return rawScienceExpRowAlloc(exp_tag, camera, telescope, exp_type, imfiles, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang);
     8549    return rawScienceExpRowAlloc(exp_tag, camera, telescope, exp_type, imfiles, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, obstype);
    85018550}
    85028551
     
    86798728    if (!psMetadataAddF64(md, PS_LIST_TAIL, "posang", 0, NULL, object->posang)) {
    86808729        psError(PS_ERR_UNKNOWN, false, "failed to add item posang");
     8730        psFree(md);
     8731        return NULL;
     8732    }
     8733    if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, object->obstype)) {
     8734        psError(PS_ERR_UNKNOWN, false, "failed to add item obstype");
    86818735        psFree(md);
    86828736        return NULL;
     
    87068760    psF32           ccd_temp;
    87078761    psF64           posang;
     8762    char            *obstype;
    87088763
    87098764    exp_tag = psMetadataLookupPtr(&status, md, "exp_tag");
     
    87928847        return false;
    87938848    }
    8794 
    8795     return rawScienceExpRowAlloc(exp_tag, camera, telescope, exp_type, imfiles, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang);
     8849    obstype = psMetadataLookupPtr(&status, md, "obstype");
     8850    if (!status) {
     8851        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item obstype");
     8852        return false;
     8853    }
     8854
     8855    return rawScienceExpRowAlloc(exp_tag, camera, telescope, exp_type, imfiles, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, obstype);
    87968856}
    87978857psArray *rawScienceExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    89008960static void rawImfileRowFree(rawImfileRow *object);
    89018961
    8902 rawImfileRow *rawImfileRowAlloc(const char *exp_tag, const char *class, const char *class_id, const char *uri, const char *exp_type, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang)
     8962rawImfileRow *rawImfileRowAlloc(const char *exp_tag, const char *class, const char *class_id, const char *uri, const char *exp_type, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *obstype)
    89038963{
    89048964    rawImfileRow    *object;
     
    89248984    object->ccd_temp = ccd_temp;
    89258985    object->posang = posang;
     8986    object->obstype = psStringCopy(obstype);
    89268987
    89278988    return object;
     
    89368997    psFree(object->exp_type);
    89378998    psFree(object->filter);
     8999    psFree(object->obstype);
    89389000}
    89399001
     
    90349096        return false;
    90359097    }
     9098    if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, "64")) {
     9099        psError(PS_ERR_UNKNOWN, false, "failed to add item obstype");
     9100        psFree(md);
     9101        return false;
     9102    }
    90369103
    90379104    status = psDBCreateTable(dbh, RAWIMFILE_TABLE_NAME, md);
     
    90479114}
    90489115
    9049 bool rawImfileInsert(psDB * dbh, const char *exp_tag, const char *class, const char *class_id, const char *uri, const char *exp_type, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang)
     9116bool rawImfileInsert(psDB * dbh, const char *exp_tag, const char *class, const char *class_id, const char *uri, const char *exp_type, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *obstype)
    90509117{
    90519118    psMetadata      *md;
     
    91359202    if (!psMetadataAddF64(md, PS_LIST_TAIL, "posang", 0, NULL, posang)) {
    91369203        psError(PS_ERR_UNKNOWN, false, "failed to add item posang");
     9204        psFree(md);
     9205        return false;
     9206    }
     9207    if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, obstype)) {
     9208        psError(PS_ERR_UNKNOWN, false, "failed to add item obstype");
    91379209        psFree(md);
    91389210        return false;
     
    91599231    return deleted;
    91609232}
    9161 bool rawImfilePop(psDB *dbh, char **exp_tag, char **class, char **class_id, char **uri, char **exp_type, char **filter, psF32 *airmass, psF64 *ra, psF64 *decl, psF32 *exp_time, psF64 *bg, psF64 *bg_stdev, psF64 *bg_mean_stdev, psF64 *alt, psF64 *az, psF32 *ccd_temp, psF64 *posang)
     9233bool rawImfilePop(psDB *dbh, char **exp_tag, char **class, char **class_id, char **uri, char **exp_type, char **filter, psF32 *airmass, psF64 *ra, psF64 *decl, psF32 *exp_time, psF64 *bg, psF64 *bg_stdev, psF64 *bg_mean_stdev, psF64 *alt, psF64 *az, psF32 *ccd_temp, psF64 *posang, char **obstype)
    91629234{
    91639235    psArray         *rowSet;
     
    93059377        return false;
    93069378    }
     9379    *obstype = psMetadataLookupPtr(&status, row, "obstype");
     9380    if (!status) {
     9381        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item obstype");
     9382        psFree(row);
     9383        return false;
     9384    }
    93079385
    93089386    psFree(row);
     
    93139391bool rawImfileInsertObject(psDB *dbh, rawImfileRow *object)
    93149392{
    9315     return rawImfileInsert(dbh, object->exp_tag, object->class, object->class_id, object->uri, object->exp_type, object->filter, object->airmass, object->ra, object->decl, object->exp_time, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang);
     9393    return rawImfileInsert(dbh, object->exp_tag, object->class, object->class_id, object->uri, object->exp_type, object->filter, object->airmass, object->ra, object->decl, object->exp_time, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->obstype);
    93169394}
    93179395
     
    93469424    psF32           ccd_temp;
    93479425    psF64           posang;
    9348 
    9349     if (!rawImfilePop(dbh, (char **)&exp_tag, (char **)&class, (char **)&class_id, (char **)&uri, (char **)&exp_type, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang)) {
     9426    char            obstype[256];
     9427
     9428    if (!rawImfilePop(dbh, (char **)&exp_tag, (char **)&class, (char **)&class_id, (char **)&uri, (char **)&exp_type, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang, (char **)&obstype)) {
    93509429        psError(PS_ERR_UNKNOWN, false, "failed to pop a database row");
    93519430        return NULL;
    93529431    }
    93539432
    9354     return rawImfileRowAlloc(exp_tag, class, class_id, uri, exp_type, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang);
     9433    return rawImfileRowAlloc(exp_tag, class, class_id, uri, exp_type, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, obstype);
    93559434}
    93569435
     
    95339612    if (!psMetadataAddF64(md, PS_LIST_TAIL, "posang", 0, NULL, object->posang)) {
    95349613        psError(PS_ERR_UNKNOWN, false, "failed to add item posang");
     9614        psFree(md);
     9615        return NULL;
     9616    }
     9617    if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, object->obstype)) {
     9618        psError(PS_ERR_UNKNOWN, false, "failed to add item obstype");
    95359619        psFree(md);
    95369620        return NULL;
     
    95609644    psF32           ccd_temp;
    95619645    psF64           posang;
     9646    char            *obstype;
    95629647
    95639648    exp_tag = psMetadataLookupPtr(&status, md, "exp_tag");
     
    96469731        return false;
    96479732    }
    9648 
    9649     return rawImfileRowAlloc(exp_tag, class, class_id, uri, exp_type, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang);
     9733    obstype = psMetadataLookupPtr(&status, md, "obstype");
     9734    if (!status) {
     9735        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item obstype");
     9736        return false;
     9737    }
     9738
     9739    return rawImfileRowAlloc(exp_tag, class, class_id, uri, exp_type, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, obstype);
    96509740}
    96519741psArray *rawImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
  • trunk/ippdb/src/ippdb.h

    r9173 r9187  
    31873187    psF32           ccd_temp;
    31883188    psF64           posang;
     3189    char            *obstype;
    31893190} rawDetrendExpRow;
    31903191
     
    32113212    psF64           az,
    32123213    psF32           ccd_temp,
    3213     psF64           posang
     3214    psF64           posang,
     3215    const char      *obstype
    32143216);
    32153217
     
    32573259    psF64           az,
    32583260    psF32           ccd_temp,
    3259     psF64           posang
     3261    psF64           posang,
     3262    const char      *obstype
    32603263);
    32613264
     
    32943297    psF64           *az,
    32953298    psF32           *ccd_temp,
    3296     psF64           *posang
     3299    psF64           *posang,
     3300    char            **obstype
    32973301);
    32983302
     
    34663470    psF32           ccd_temp;
    34673471    psF64           posang;
     3472    char            *obstype;
    34683473} rawScienceExpRow;
    34693474
     
    34903495    psF64           az,
    34913496    psF32           ccd_temp,
    3492     psF64           posang
     3497    psF64           posang,
     3498    const char      *obstype
    34933499);
    34943500
     
    35363542    psF64           az,
    35373543    psF32           ccd_temp,
    3538     psF64           posang
     3544    psF64           posang,
     3545    const char      *obstype
    35393546);
    35403547
     
    35733580    psF64           *az,
    35743581    psF32           *ccd_temp,
    3575     psF64           *posang
     3582    psF64           *posang,
     3583    char            **obstype
    35763584);
    35773585
     
    37453753    psF32           ccd_temp;
    37463754    psF64           posang;
     3755    char            *obstype;
    37473756} rawImfileRow;
    37483757
     
    37693778    psF64           az,
    37703779    psF32           ccd_temp,
    3771     psF64           posang
     3780    psF64           posang,
     3781    const char      *obstype
    37723782);
    37733783
     
    38153825    psF64           az,
    38163826    psF32           ccd_temp,
    3817     psF64           posang
     3827    psF64           posang,
     3828    const char      *obstype
    38183829);
    38193830
     
    38523863    psF64           *az,
    38533864    psF32           *ccd_temp,
    3854     psF64           *posang
     3865    psF64           *posang,
     3866    char            **obstype
    38553867);
    38563868
  • trunk/ippdb/tests/alloc.c

    r9173 r9187  
    496496        rawDetrendExpRow *object;
    497497
    498         object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64    );
     498        object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string"    );
    499499
    500500        if (!object) {
     
    570570            exit(EXIT_FAILURE);
    571571        }
     572        if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) {
     573            psFree(object);
     574            exit(EXIT_FAILURE);
     575        }
    572576
    573577        psFree(object);
     
    577581        rawScienceExpRow *object;
    578582
    579         object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64    );
     583        object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string"    );
    580584
    581585        if (!object) {
     
    651655            exit(EXIT_FAILURE);
    652656        }
     657        if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) {
     658            psFree(object);
     659            exit(EXIT_FAILURE);
     660        }
    653661
    654662        psFree(object);
     
    658666        rawImfileRow    *object;
    659667
    660         object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64    );
     668        object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string"    );
    661669
    662670        if (!object) {
     
    729737        }
    730738        if (!object->posang == 64.64) {
     739            psFree(object);
     740            exit(EXIT_FAILURE);
     741        }
     742        if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) {
    731743            psFree(object);
    732744            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r9173 r9187  
    208208        }
    209209
    210         if (!rawDetrendExpInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64)) {
    211             exit(EXIT_FAILURE);
    212         }
    213 
    214         psDBCleanup(dbh);
    215     }
    216 
    217     {
    218         psDB            *dbh;
    219 
    220         dbh = psDBInit("localhost", "test", NULL, "test");
    221         if (!dbh) {
    222             exit(EXIT_FAILURE);
    223         }
    224 
    225         if (!rawScienceExpInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64)) {
    226             exit(EXIT_FAILURE);
    227         }
    228 
    229         psDBCleanup(dbh);
    230     }
    231 
    232     {
    233         psDB            *dbh;
    234 
    235         dbh = psDBInit("localhost", "test", NULL, "test");
    236         if (!dbh) {
    237             exit(EXIT_FAILURE);
    238         }
    239 
    240         if (!rawImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64)) {
     210        if (!rawDetrendExpInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string")) {
     211            exit(EXIT_FAILURE);
     212        }
     213
     214        psDBCleanup(dbh);
     215    }
     216
     217    {
     218        psDB            *dbh;
     219
     220        dbh = psDBInit("localhost", "test", NULL, "test");
     221        if (!dbh) {
     222            exit(EXIT_FAILURE);
     223        }
     224
     225        if (!rawScienceExpInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string")) {
     226            exit(EXIT_FAILURE);
     227        }
     228
     229        psDBCleanup(dbh);
     230    }
     231
     232    {
     233        psDB            *dbh;
     234
     235        dbh = psDBInit("localhost", "test", NULL, "test");
     236        if (!dbh) {
     237            exit(EXIT_FAILURE);
     238        }
     239
     240        if (!rawImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string")) {
    241241            exit(EXIT_FAILURE);
    242242        }
  • trunk/ippdb/tests/insertobject.c

    r9173 r9187  
    300300        }
    301301
    302         object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64);
     302        object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string");
    303303        if (!object) {
    304304            exit(EXIT_FAILURE);
     
    322322        }
    323323
    324         object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64);
     324        object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string");
    325325        if (!object) {
    326326            exit(EXIT_FAILURE);
     
    344344        }
    345345
    346         object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64);
     346        object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string");
    347347        if (!object) {
    348348            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r9173 r9187  
    602602        bool            status;
    603603
    604         object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64);
     604        object = rawDetrendExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string");
    605605        if (!object) {
    606606            exit(EXIT_FAILURE);
     
    682682            exit(EXIT_FAILURE);
    683683        }
     684        if (strncmp(psMetadataLookupPtr(&status, md, "obstype"), "a string", MAX_STRING_LENGTH)) {
     685            psFree(md);
     686            exit(EXIT_FAILURE);
     687        }
    684688
    685689        psFree(md);
     
    691695        bool            status;
    692696
    693         object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64);
     697        object = rawScienceExpRowAlloc("a string", "a string", "a string", "a string", -32, "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string");
    694698        if (!object) {
    695699            exit(EXIT_FAILURE);
     
    771775            exit(EXIT_FAILURE);
    772776        }
     777        if (strncmp(psMetadataLookupPtr(&status, md, "obstype"), "a string", MAX_STRING_LENGTH)) {
     778            psFree(md);
     779            exit(EXIT_FAILURE);
     780        }
    773781
    774782        psFree(md);
     
    780788        bool            status;
    781789
    782         object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64);
     790        object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, "a string");
    783791        if (!object) {
    784792            exit(EXIT_FAILURE);
     
    857865        }
    858866        if (!psMetadataLookupF64(&status, md, "posang") == 64.64) {
     867            psFree(md);
     868            exit(EXIT_FAILURE);
     869        }
     870        if (strncmp(psMetadataLookupPtr(&status, md, "obstype"), "a string", MAX_STRING_LENGTH)) {
    859871            psFree(md);
    860872            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r9173 r9187  
    947947            exit(EXIT_FAILURE);
    948948        }
     949        if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, "a string")) {
     950            psFree(md);
     951            exit(EXIT_FAILURE);
     952        }
    949953
    950954        object = rawDetrendExpObjectFromMetadata(md);
     
    10241028            exit(EXIT_FAILURE);
    10251029        }
     1030        if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) {
     1031            psFree(object);
     1032            exit(EXIT_FAILURE);
     1033        }
    10261034
    10271035        psFree(object);
     
    11011109            exit(EXIT_FAILURE);
    11021110        }
     1111        if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, "a string")) {
     1112            psFree(md);
     1113            exit(EXIT_FAILURE);
     1114        }
    11031115
    11041116        object = rawScienceExpObjectFromMetadata(md);
     
    11781190            exit(EXIT_FAILURE);
    11791191        }
     1192        if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) {
     1193            psFree(object);
     1194            exit(EXIT_FAILURE);
     1195        }
    11801196
    11811197        psFree(object);
     
    12551271            exit(EXIT_FAILURE);
    12561272        }
     1273        if (!psMetadataAddStr(md, PS_LIST_TAIL, "obstype", 0, NULL, "a string")) {
     1274            psFree(md);
     1275            exit(EXIT_FAILURE);
     1276        }
    12571277
    12581278        object = rawImfileObjectFromMetadata(md);
     
    13291349        }
    13301350        if (!object->posang == 64.64) {
     1351            psFree(object);
     1352            exit(EXIT_FAILURE);
     1353        }
     1354        if (strncmp(object->obstype, "a string", MAX_STRING_LENGTH)) {
    13311355            psFree(object);
    13321356            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/pop.c

    r9173 r9187  
    298298        psF32           ccd_temp;
    299299        psF64           posang;
    300 
    301         dbh = psDBInit("localhost", "test", NULL, "test");
    302         if (!dbh) {
    303             exit(EXIT_FAILURE);
    304         }
    305 
    306         if (!rawDetrendExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang)) {
     300        char            obstype[256];
     301
     302        dbh = psDBInit("localhost", "test", NULL, "test");
     303        if (!dbh) {
     304            exit(EXIT_FAILURE);
     305        }
     306
     307        if (!rawDetrendExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang, (char **)&obstype)) {
    307308            exit(EXIT_FAILURE);
    308309        }
     
    330331        psF32           ccd_temp;
    331332        psF64           posang;
    332 
    333         dbh = psDBInit("localhost", "test", NULL, "test");
    334         if (!dbh) {
    335             exit(EXIT_FAILURE);
    336         }
    337 
    338         if (!rawScienceExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang)) {
     333        char            obstype[256];
     334
     335        dbh = psDBInit("localhost", "test", NULL, "test");
     336        if (!dbh) {
     337            exit(EXIT_FAILURE);
     338        }
     339
     340        if (!rawScienceExpPop(dbh, (char **)&exp_tag, (char **)&camera, (char **)&telescope, (char **)&exp_type, &imfiles, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang, (char **)&obstype)) {
    339341            exit(EXIT_FAILURE);
    340342        }
     
    362364        psF32           ccd_temp;
    363365        psF64           posang;
    364 
    365         dbh = psDBInit("localhost", "test", NULL, "test");
    366         if (!dbh) {
    367             exit(EXIT_FAILURE);
    368         }
    369 
    370         if (!rawImfilePop(dbh, (char **)&exp_tag, (char **)&class, (char **)&class_id, (char **)&uri, (char **)&exp_type, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang)) {
     366        char            obstype[256];
     367
     368        dbh = psDBInit("localhost", "test", NULL, "test");
     369        if (!dbh) {
     370            exit(EXIT_FAILURE);
     371        }
     372
     373        if (!rawImfilePop(dbh, (char **)&exp_tag, (char **)&class, (char **)&class_id, (char **)&uri, (char **)&exp_type, (char **)&filter, &airmass, &ra, &decl, &exp_time, &bg, &bg_stdev, &bg_mean_stdev, &alt, &az, &ccd_temp, &posang, (char **)&obstype)) {
    371374            exit(EXIT_FAILURE);
    372375        }
Note: See TracChangeset for help on using the changeset viewer.