IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 23, 2006, 5:13:02 PM (20 years ago)
Author:
jhoblitt
Message:

VERSION 0.0.33

File:
1 edited

Legend:

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

    r8528 r8543  
    1405714057static void detStackedImfileRowFree(detStackedImfileRow *object);
    1405814058
    14059 detStackedImfileRow *detStackedImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev)
     14059detStackedImfileRow *detStackedImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, bool normalize)
    1406014060{
    1406114061    detStackedImfileRow *object;
     
    1407214072    object->bg_stdev = bg_stdev;
    1407314073    object->bg_mean_stdev = bg_mean_stdev;
     14074    object->normalize = normalize;
    1407414075
    1407514076    return object;
     
    1413414135        return false;
    1413514136    }
     14137    if (!psMetadataAdd(md, PS_LIST_TAIL, "normalize", PS_DATA_BOOL, NULL, false)) {
     14138        psError(PS_ERR_UNKNOWN, false, "failed to add item normalize");
     14139        psFree(md);
     14140        return false;
     14141    }
    1413614142
    1413714143    status = psDBCreateTable(dbh, DETSTACKEDIMFILE_TABLE_NAME, md);
     
    1414714153}
    1414814154
    14149 bool detStackedImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev)
     14155bool detStackedImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, bool normalize)
    1415014156{
    1415114157    psMetadata      *md;
     
    1419014196    if (!psMetadataAddF64(md, PS_LIST_TAIL, "bg_mean_stdev", 0, NULL, bg_mean_stdev)) {
    1419114197        psError(PS_ERR_UNKNOWN, false, "failed to add item bg_mean_stdev");
     14198        psFree(md);
     14199        return false;
     14200    }
     14201    if (!psMetadataAdd(md, PS_LIST_TAIL, "normalize", PS_DATA_BOOL, NULL, normalize)) {
     14202        psError(PS_ERR_UNKNOWN, false, "failed to add item normalize");
    1419214203        psFree(md);
    1419314204        return false;
     
    1421414225    return deleted;
    1421514226}
    14216 bool detStackedImfilePop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **class_id, char **uri, char **recipe, psF64 *bg, psF64 *bg_stdev, psF64 *bg_mean_stdev)
     14227bool detStackedImfilePop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **class_id, char **uri, char **recipe, psF64 *bg, psF64 *bg_stdev, psF64 *bg_mean_stdev, bool *normalize)
    1421714228{
    1421814229    psArray         *rowSet;
     
    1430614317        return false;
    1430714318    }
     14319    *normalize = psMetadataLookupBool(&status, row, "normalize");
     14320    if (!status) {
     14321        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item normalize");
     14322        psFree(row);
     14323        return false;
     14324    }
    1430814325
    1430914326    psFree(row);
     
    1431414331bool detStackedImfileInsertObject(psDB *dbh, detStackedImfileRow *object)
    1431514332{
    14316     return detStackedImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev);
     14333    return detStackedImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->normalize);
    1431714334}
    1431814335
     
    1433814355    psF64           bg_stdev;
    1433914356    psF64           bg_mean_stdev;
    14340 
    14341     if (!detStackedImfilePop(dbh, &det_id, &iteration, (char **)&class_id, (char **)&uri, (char **)&recipe, &bg, &bg_stdev, &bg_mean_stdev)) {
     14357    bool            normalize;
     14358
     14359    if (!detStackedImfilePop(dbh, &det_id, &iteration, (char **)&class_id, (char **)&uri, (char **)&recipe, &bg, &bg_stdev, &bg_mean_stdev, &normalize)) {
    1434214360        psError(PS_ERR_UNKNOWN, false, "failed to pop a database row");
    1434314361        return NULL;
    1434414362    }
    1434514363
    14346     return detStackedImfileRowAlloc(det_id, iteration, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev);
     14364    return detStackedImfileRowAlloc(det_id, iteration, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, normalize);
    1434714365}
    1434814366
     
    1448014498    if (!psMetadataAddF64(md, PS_LIST_TAIL, "bg_mean_stdev", 0, NULL, object->bg_mean_stdev)) {
    1448114499        psError(PS_ERR_UNKNOWN, false, "failed to add item bg_mean_stdev");
     14500        psFree(md);
     14501        return NULL;
     14502    }
     14503    if (!psMetadataAdd(md, PS_LIST_TAIL, "normalize", PS_DATA_BOOL, NULL, object->normalize)) {
     14504        psError(PS_ERR_UNKNOWN, false, "failed to add item normalize");
    1448214505        psFree(md);
    1448314506        return NULL;
     
    1449814521    psF64           bg_stdev;
    1449914522    psF64           bg_mean_stdev;
     14523    bool            normalize;
    1450014524
    1450114525    det_id = psMetadataLookupS32(&status, md, "det_id");
     
    1453914563        return false;
    1454014564    }
    14541 
    14542     return detStackedImfileRowAlloc(det_id, iteration, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev);
     14565    normalize = psMetadataLookupBool(&status, md, "normalize");
     14566    if (!status) {
     14567        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item normalize");
     14568        return false;
     14569    }
     14570
     14571    return detStackedImfileRowAlloc(det_id, iteration, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, normalize);
    1454314572}
    1454414573psArray *detStackedImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
Note: See TracChangeset for help on using the changeset viewer.