IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8543


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

VERSION 0.0.33

Location:
trunk/ippdb
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/configure.ac

    r8528 r8543  
    11AC_PREREQ(2.59)
    22
    3 AC_INIT([ippdb], [0.0.32], [pan-starrs.ifa.hawaii.edu])
     3AC_INIT([ippdb], [0.0.33], [pan-starrs.ifa.hawaii.edu])
    44AC_CONFIG_SRCDIR([ippdb.pc.in])
    55
  • 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)
  • trunk/ippdb/src/ippdb.h

    r8528 r8543  
    60586058    psF64           bg_stdev;
    60596059    psF64           bg_mean_stdev;
     6060    bool            normalize;
    60606061} detStackedImfileRow;
    60616062
     
    60736074    psF64           bg,
    60746075    psF64           bg_stdev,
    6075     psF64           bg_mean_stdev
     6076    psF64           bg_mean_stdev,
     6077    bool            normalize
    60766078);
    60776079
     
    61106112    psF64           bg,
    61116113    psF64           bg_stdev,
    6112     psF64           bg_mean_stdev
     6114    psF64           bg_mean_stdev,
     6115    bool            normalize
    61136116);
    61146117
     
    61386141    psF64           *bg,
    61396142    psF64           *bg_stdev,
    6140     psF64           *bg_mean_stdev
     6143    psF64           *bg_mean_stdev,
     6144    bool            *normalize
    61416145);
    61426146
  • trunk/ippdb/tests/alloc.c

    r8528 r8543  
    10071007        detStackedImfileRow *object;
    10081008
    1009         object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64    );
     1009        object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64, true    );
    10101010
    10111011        if (!object) {
     
    10421042        }
    10431043        if (!object->bg_mean_stdev == 64.64) {
     1044            psFree(object);
     1045            exit(EXIT_FAILURE);
     1046        }
     1047        if (!object->normalize == true) {
    10441048            psFree(object);
    10451049            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r8528 r8543  
    388388        }
    389389
    390         if (!detStackedImfileInsert(dbh, -32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64)) {
     390        if (!detStackedImfileInsert(dbh, -32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64, true)) {
    391391            exit(EXIT_FAILURE);
    392392        }
  • trunk/ippdb/tests/insertobject.c

    r8528 r8543  
    564564        }
    565565
    566         object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64);
     566        object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64, true);
    567567        if (!object) {
    568568            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r8528 r8543  
    12101210        bool            status;
    12111211
    1212         object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64);
     1212        object = detStackedImfileRowAlloc(-32, -32, "a string", "a string", "a string", 64.64, 64.64, 64.64, true);
    12131213        if (!object) {
    12141214            exit(EXIT_FAILURE);
     
    12511251        }
    12521252        if (!psMetadataLookupF64(&status, md, "bg_mean_stdev") == 64.64) {
     1253            psFree(md);
     1254            exit(EXIT_FAILURE);
     1255        }
     1256        if (!psMetadataLookupBool(&status, md, "normalize") == true) {
    12531257            psFree(md);
    12541258            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r8528 r8543  
    18391839            exit(EXIT_FAILURE);
    18401840        }
     1841        if (!psMetadataAdd(md, PS_LIST_TAIL, "normalize", PS_DATA_BOOL, NULL, true)) {
     1842            psFree(md);
     1843            exit(EXIT_FAILURE);
     1844        }
    18411845
    18421846        object = detStackedImfileObjectFromMetadata(md);
     
    18771881        }
    18781882        if (!object->bg_mean_stdev == 64.64) {
     1883            psFree(object);
     1884            exit(EXIT_FAILURE);
     1885        }
     1886        if (!object->normalize == true) {
    18791887            psFree(object);
    18801888            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/pop.c

    r8528 r8543  
    558558        psF64           bg_stdev;
    559559        psF64           bg_mean_stdev;
    560 
    561         dbh = psDBInit("localhost", "test", NULL, "test");
    562         if (!dbh) {
    563             exit(EXIT_FAILURE);
    564         }
    565 
    566         if (!detStackedImfilePop(dbh, &det_id, &iteration, (char **)&class_id, (char **)&uri, (char **)&recipe, &bg, &bg_stdev, &bg_mean_stdev)) {
     560        bool            normalize;
     561
     562        dbh = psDBInit("localhost", "test", NULL, "test");
     563        if (!dbh) {
     564            exit(EXIT_FAILURE);
     565        }
     566
     567        if (!detStackedImfilePop(dbh, &det_id, &iteration, (char **)&class_id, (char **)&uri, (char **)&recipe, &bg, &bg_stdev, &bg_mean_stdev, &normalize)) {
    567568            exit(EXIT_FAILURE);
    568569        }
Note: See TracChangeset for help on using the changeset viewer.