IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 26, 2009, 1:59:32 PM (17 years ago)
Author:
beaumont
Message:

merged with trunk

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/ippTools/src

    • Property svn:ignore
      •  

        old new  
        3333pstamptool
        3434disttool
         35receivetool
  • branches/cnb_branches/cnb_branch_20090301/ippTools/src/faketool.c

    r23352 r24244  
    128128    PXOPT_COPY_TIME(config->args, where, "-dateobs_end", "dateobs", "<=");
    129129    PXOPT_COPY_STR(config->args, where, "-exp_tag", "exp_tag", "==");
    130     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     130    pxAddLabelSearchArgs (config, where, "-label", "label", "==");
    131131    PXOPT_COPY_STR(config->args, where, "-filelevel", "filelevel", "==");
    132132    PXOPT_COPY_STR(config->args, where, "-reduction", "reduction", "==");
     
    227227        psFree(output);
    228228        return false;
     229    }
     230
     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        }
    229250    }
    230251
     
    355376
    356377    psMetadata *where = psMetadataAlloc();
     378    pxAddLabelSearchArgs (config, where, "-label", "label", "==");
    357379    PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "==");
    358     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
    359380    PXOPT_COPY_S64(config->args, where, "-cam_id", "cam_id", "==");
    360381    PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "==");
     
    421442    psMetadata *where = psMetadataAlloc();
    422443    PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "==");
    423     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     444    pxAddLabelSearchArgs (config, where, "-label", "label", "==");
    424445    PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "==");
    425446    PXOPT_COPY_STR(config->args, where, "-class_id", "rawImfile.class_id", "==");
     
    496517
    497518    // default values
    498     PXOPT_LOOKUP_S16(code, config->args,        "-code", false, false);
     519    PXOPT_LOOKUP_S16(fault, config->args,        "-fault", false, false);
    499520
    500521    if (!psDBTransaction(config->dbh)) {
     
    513534                                   path_base,
    514535                                   "full",
    515                                    code,
     536                                   fault,
    516537                                   NULL         // epoch
    517538            )) {
     
    542563
    543564    psMetadata *where = psMetadataAlloc();
    544     PXOPT_COPY_S64(config->args, where, "-fake_id", "fakeRun.fake_id", "==");
     565    PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "==");
    545566    PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.exp_id", "==");
    546567    PXOPT_COPY_STR(config->args, where, "-class_id", "rawImfile.class_id", "==");
     
    687708    PS_ASSERT_PTR_NON_NULL(config, false);
    688709
    689     PXOPT_LOOKUP_S16(code, config->args, "-code", true, false);
     710    PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false);
    690711
    691712    psMetadata *where = psMetadataAlloc();
     
    693714    PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "==");
    694715
    695     if (!pxSetFaultCode(config->dbh, "fakeProcessedImfile", where, code)) {
     716    if (!pxSetFaultCode(config->dbh, "fakeProcessedImfile", where, fault)) {
    696717        psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag");
    697718        psFree(where);
     
    874895
    875896    psMetadata *where = psMetadataAlloc();
    876     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     897    pxAddLabelSearchArgs (config, where, "-label", "fakeRun.label", "==");
    877898
    878899    psString query = pxDataGet("faketool_pendingcleanuprun.sql");
     
    939960        PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "==");
    940961    }
    941     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     962    pxAddLabelSearchArgs (config, where, "-label", "label", "==");
    942963
    943964    psString query = pxDataGet("faketool_pendingcleanupimfile.sql");
     
    10581079    psMetadata *where = psMetadataAlloc();
    10591080    PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "==");
    1060     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     1081    pxAddLabelSearchArgs (config, where, "-label", "label", "==");
    10611082
    10621083    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     
    12381259
    12391260  int numExportTables = 2;
    1240  
     1261
    12411262  PS_ASSERT_PTR_NON_NULL(config, NULL);
    12421263
     
    12441265  PXOPT_LOOKUP_STR(outfile, config->args, "-outfile", true,  false);
    12451266  PXOPT_LOOKUP_U64(limit,   config->args, "-limit",   false, false);
     1267  PXOPT_LOOKUP_BOOL(clean, config->args, "-clean", false);
    12461268
    12471269  FILE *f = fopen (outfile, "w");
     
    12921314    }
    12931315    if (!psArrayLength(output)) {
    1294       psTrace("regtool", PS_LOG_INFO, "no rows found");
     1316      psError(PS_ERR_UNKNOWN, true, "no rows found");
    12951317      psFree(output);
    1296       return true;
     1318      return false;
     1319    }
     1320
     1321    if (clean) {
     1322        if (!strcmp(tables[i].tableName, "fakeRun")) {
     1323            if(!pxSetStateCleaned("fakeRun", "state", output)) {
     1324                psFree(output);
     1325                psError(PS_ERR_UNKNOWN, false, "pxSetStateClean failed for table %s",  tables[i].tableName);
     1326                return false;
     1327            }
     1328        }
    12971329    }
    12981330
     
    13161348
    13171349  PS_ASSERT_PTR_NON_NULL(config, NULL);
    1318  
     1350
    13191351  PXOPT_LOOKUP_STR(infile, config->args, "-infile", true,  false);
    13201352
Note: See TracChangeset for help on using the changeset viewer.