IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15530


Ignore:
Timestamp:
Nov 8, 2007, 4:56:46 PM (19 years ago)
Author:
jhoblitt
Message:

add warpSkyfile.ignore

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/dbconfig/warp.md

    r15376 r15530  
    1 # $Id: warp.md,v 1.7 2007-10-25 20:33:45 price Exp $
     1# $Id: warp.md,v 1.8 2007-11-09 02:56:46 jhoblitt Exp $
    22
    33#
     
    5151    bg_stdev    F64         0.0
    5252    good_frac   F64         0.0     # Key
     53    ignore      BOOL        f       # Key
    5354    fault       S16         0       # Key
    5455END
  • trunk/ippdb/src/ippdb.c

    r15421 r15530  
    95929592static void warpSkyfileRowFree(warpSkyfileRow *object);
    95939593
    9594 warpSkyfileRow *warpSkyfileRowAlloc(psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF64 good_frac, psS16 fault)
     9594warpSkyfileRow *warpSkyfileRowAlloc(psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF64 good_frac, bool ignore, psS16 fault)
    95959595{
    95969596    warpSkyfileRow  *_object;
     
    96079607    _object->bg_stdev = bg_stdev;
    96089608    _object->good_frac = good_frac;
     9609    _object->ignore = ignore;
    96099610    _object->fault = fault;
    96109611
     
    96639664        return false;
    96649665    }
     9666    if (!psMetadataAdd(md, PS_LIST_TAIL, "ignore", PS_DATA_BOOL, "Key", 0)) {
     9667        psError(PS_ERR_UNKNOWN, false, "failed to add item ignore");
     9668        psFree(md);
     9669        return false;
     9670    }
    96659671    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "Key", 0)) {
    96669672        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     
    96819687}
    96829688
    9683 bool warpSkyfileInsert(psDB * dbh, psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF64 good_frac, psS16 fault)
     9689bool warpSkyfileInsert(psDB * dbh, psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF64 good_frac, bool ignore, psS16 fault)
    96849690{
    96859691    psMetadata *md = psMetadataAlloc();
     
    97219727    if (!psMetadataAdd(md, PS_LIST_TAIL, "good_frac", PS_DATA_F64, NULL, good_frac)) {
    97229728        psError(PS_ERR_UNKNOWN, false, "failed to add item good_frac");
     9729        psFree(md);
     9730        return false;
     9731    }
     9732    if (!psMetadataAdd(md, PS_LIST_TAIL, "ignore", PS_DATA_BOOL, NULL, ignore)) {
     9733        psError(PS_ERR_UNKNOWN, false, "failed to add item ignore");
    97239734        psFree(md);
    97249735        return false;
     
    97529763bool warpSkyfileInsertObject(psDB *dbh, warpSkyfileRow *object)
    97539764{
    9754     return warpSkyfileInsert(dbh, object->warp_id, object->skycell_id, object->tess_id, object->uri, object->path_base, object->bg, object->bg_stdev, object->good_frac, object->fault);
     9765    return warpSkyfileInsert(dbh, object->warp_id, object->skycell_id, object->tess_id, object->uri, object->path_base, object->bg, object->bg_stdev, object->good_frac, object->ignore, object->fault);
    97559766}
    97569767
     
    98659876        return false;
    98669877    }
     9878    if (!psMetadataAdd(md, PS_LIST_TAIL, "ignore", PS_DATA_BOOL, NULL, object->ignore)) {
     9879        psError(PS_ERR_UNKNOWN, false, "failed to add item ignore");
     9880        psFree(md);
     9881        return false;
     9882    }
    98679883    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
    98689884        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     
    99199935        return false;
    99209936    }
     9937    bool ignore = psMetadataLookupBool(&status, md, "ignore");
     9938    if (!status) {
     9939        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item ignore");
     9940        return false;
     9941    }
    99219942    psS16 fault = psMetadataLookupS16(&status, md, "fault");
    99229943    if (!status) {
     
    99259946    }
    99269947
    9927     return warpSkyfileRowAlloc(warp_id, skycell_id, tess_id, uri, path_base, bg, bg_stdev, good_frac, fault);
     9948    return warpSkyfileRowAlloc(warp_id, skycell_id, tess_id, uri, path_base, bg, bg_stdev, good_frac, ignore, fault);
    99289949}
    99299950psArray *warpSkyfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
  • trunk/ippdb/src/ippdb.h

    r15421 r15530  
    47354735    psF64           bg_stdev;
    47364736    psF64           good_frac;
     4737    bool            ignore;
    47374738    psS16           fault;
    47384739} warpSkyfileRow;
     
    47524753    psF64           bg_stdev,
    47534754    psF64           good_frac,
     4755    bool            ignore,
    47544756    psS16           fault
    47554757);
     
    47904792    psF64           bg_stdev,
    47914793    psF64           good_frac,
     4794    bool            ignore,
    47924795    psS16           fault
    47934796);
  • trunk/ippdb/tests/alloc.c

    r15421 r15530  
    10321032        warpSkyfileRow  *object;
    10331033
    1034         object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, -16    );
     1034        object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, true, -16    );
    10351035
    10361036        if (!object) {
     
    10671067        }
    10681068        if (!object->good_frac == 64.64) {
     1069            psFree(object);
     1070            exit(EXIT_FAILURE);
     1071        }
     1072        if (!object->ignore == true) {
    10691073            psFree(object);
    10701074            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r15421 r15530  
    328328        }
    329329
    330         if (!warpSkyfileInsert(dbh, -64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, -16)) {
     330        if (!warpSkyfileInsert(dbh, -64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, true, -16)) {
    331331            exit(EXIT_FAILURE);
    332332        }
  • trunk/ippdb/tests/insertobject.c

    r15421 r15530  
    476476        }
    477477
    478         object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, -16);
     478        object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, true, -16);
    479479        if (!object) {
    480480            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r15421 r15530  
    11781178        bool            status;
    11791179
    1180         object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, -16);
     1180        object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, true, -16);
    11811181        if (!object) {
    11821182            exit(EXIT_FAILURE);
     
    12181218        }
    12191219        if (!psMetadataLookupF64(&status, md, "good_frac") == 64.64) {
     1220            psFree(md);
     1221            exit(EXIT_FAILURE);
     1222        }
     1223        if (!psMetadataLookupBool(&status, md, "ignore") == true) {
    12201224            psFree(md);
    12211225            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r15421 r15530  
    18701870            exit(EXIT_FAILURE);
    18711871        }
     1872        if (!psMetadataAdd(md, PS_LIST_TAIL, "ignore", PS_DATA_BOOL, NULL, true)) {
     1873            psFree(md);
     1874            exit(EXIT_FAILURE);
     1875        }
    18721876            psFree(md);
    18731877            exit(EXIT_FAILURE);
     
    19101914        }
    19111915        if (!object->good_frac == 64.64) {
     1916            psFree(object);
     1917            exit(EXIT_FAILURE);
     1918        }
     1919        if (!object->ignore == true) {
    19121920            psFree(object);
    19131921            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.