IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23809


Ignore:
Timestamp:
Apr 10, 2009, 2:58:30 PM (17 years ago)
Author:
eugene
Message:

if data is queue to be processed by warp (end_stage == warp or NULL), require a defined tess_id (either in the db or on the cmdline)

Location:
trunk/ippTools/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/camtool.c

    r23688 r23809  
    174174    // data out so we have the option of changing these values or leaving the
    175175    // old values in place (i.e., passing the values through).
     176
     177    // if end_stage is warp (or NULL), check for valid tess_id
     178    for (long i = 0; i < psArrayLength(output); i++) {
     179        psMetadata *md = output->data[i];
     180
     181        bool status;
     182        char *end_stage = psMetadataLookupStr(&status, md, "end_stage");
     183        if (end_stage && strcasecmp(end_stage, "warp")) continue;
     184
     185        char *raw_tess_id   = psMetadataLookupStr(&status, md, "tess_id");
     186        if (raw_tess_id || tess_id) continue;
     187
     188        char *label  = psMetadataLookupStr(&status, md, "label");
     189        psS64 exp_id = psMetadataLookupS64(&status, md, "exp_id");
     190
     191        if (!status) {
     192            psError(PS_ERR_UNKNOWN, false, "cannot queue analysis to WARP without a defined tess id: label: %s, exp_id %" PRId64, label, exp_id);
     193            psFree(output);
     194            return false;
     195        }
     196    }
    176197
    177198    // loop over our list of chipRun rows
  • trunk/ippTools/src/chiptool.c

    r23697 r23809  
    198198    }
    199199
     200    // if end_stage is warp (or NULL), check for valid tess_id
     201    for (long i = 0; i < psArrayLength(output); i++) {
     202        psMetadata *md = output->data[i];
     203
     204        bool status;
     205        char *end_stage = psMetadataLookupStr(&status, md, "end_stage");
     206        if (end_stage && strcasecmp(end_stage, "warp")) continue;
     207
     208        char *raw_tess_id   = psMetadataLookupStr(&status, md, "tess_id");
     209        if (raw_tess_id || tess_id) continue;
     210
     211        char *label  = psMetadataLookupStr(&status, md, "label");
     212        psS64 exp_id = psMetadataLookupS64(&status, md, "exp_id");
     213
     214        if (!status) {
     215            psError(PS_ERR_UNKNOWN, false, "cannot queue analysis to WARP without a defined tess id: label: %s, exp_id %" PRId64, label, exp_id);
     216            psFree(output);
     217            return false;
     218        }
     219    }
     220
    200221    // loop over our list of exp_ids
    201222    for (long i = 0; i < psArrayLength(output); i++) {
  • trunk/ippTools/src/faketool.c

    r23688 r23809  
    229229    }
    230230
     231    // if end_stage is warp (or NULL), check for valid tess_id
     232    for (long i = 0; i < psArrayLength(output); i++) {
     233        psMetadata *md = output->data[i];
     234
     235        bool status;
     236        char *end_stage = psMetadataLookupStr(&status, md, "end_stage");
     237        if (end_stage && strcasecmp(end_stage, "warp")) continue;
     238
     239        char *raw_tess_id   = psMetadataLookupStr(&status, md, "tess_id");
     240        if (raw_tess_id || tess_id) continue;
     241
     242        char *label  = psMetadataLookupStr(&status, md, "label");
     243        psS64 exp_id = psMetadataLookupS64(&status, md, "exp_id");
     244
     245        if (!status) {
     246            psError(PS_ERR_UNKNOWN, false, "cannot queue analysis to WARP without a defined tess id: label: %s, exp_id %" PRId64, label, exp_id);
     247            psFree(output);
     248            return false;
     249        }
     250    }
     251
    231252    // loop over our list of cam_ids
    232253    for (long i = 0; i < psArrayLength(output); i++) {
  • trunk/ippTools/src/warptool.c

    r23697 r23809  
    134134    PXOPT_LOOKUP_STR(label, config->args, "-label", false, false);
    135135    PXOPT_LOOKUP_STR(dvodb, config->args, "-dvodb", false, false);
    136     PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", false, false);
     136    PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", true, false); // required (no default TESS)
    137137    PXOPT_LOOKUP_STR(end_stage, config->args, "-end_stage", false, false);
    138138    PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false);
     
    295295    // old values in place (i.e., passing the values through).
    296296
     297    // loop over our list of fakeRun rows to check the supplied and selected tess_id values:
     298    for (long i = 0; i < psArrayLength(output); i++) {
     299        psMetadata *md = output->data[i];
     300
     301        fakeRunRow *row = fakeRunObjectFromMetadata(md);
     302        if (!row) {
     303            psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into fakeRun");
     304            psFree(output);
     305            return false;
     306        }
     307
     308        if (!tess_id  && !row->tess_id) {
     309            psError(PS_ERR_UNKNOWN, false, "cannot queue warp run without a defined tess id: label: %s, fake_id %" PRId64, row->label, row->fake_id);
     310            psFree(output);
     311            return false;
     312        }
     313
     314        psFree(row);
     315    }
     316    psFree(output);
     317
    297318    // loop over our list of fakeRun rows
    298319    for (long i = 0; i < psArrayLength(output); i++) {
Note: See TracChangeset for help on using the changeset viewer.