IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7205


Ignore:
Timestamp:
May 24, 2006, 6:30:10 PM (20 years ago)
Author:
jhoblitt
Message:

stub out -processed -chip support

Location:
trunk/ippTools/src
Files:
2 edited

Legend:

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

    r7200 r7205  
    1515static bool stacMode(pxConfig *config);
    1616static psArray *validDetInputClassIds(pxConfig *config, const char *det_id);
     17static psArray *searchInputImfiles(pxConfig *config, const char *det_id);
    1718static bool stacframeMode(pxConfig *config);
    1819static bool addnormalizedMode(pxConfig *config);
     
    420421        }
    421422        psFree(stackedImfiles);
     423    }
     424
     425    // if -chip is specified only return results for complete 'chip' sets.
     426    // I.e., when all of the same class_id for the input exposures have been
     427    // processed.  This should be done after detStackedImfiles are masked so we
     428    // don't have to doen this check unless we have to.
     429    if (psMetadataLookupBool(&status, config->args, "-chip")) {
     430        psArray *rawImfiles = searchInputImfiles(config, det_id);
     431
     432
     433
     434
     435        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -det_id");
     436        return false;
    422437    }
    423438
     
    672687    PS_ASSERT_PTR_NON_NULL(det_id, NULL);
    673688
    674     psArray *inputExps = NULL;
    675     {
    676         psMetadata *where = psMetadataAlloc();
    677         if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==",
    678                 (psS32)atoi(det_id))) {
    679             psError(PS_ERR_UNKNOWN, false, "failed to add item det_id");
    680             psFree(where);
    681             return NULL;
    682         }
    683         inputExps = detInputExpSelectRowObjects(config->dbh, where, 0);
    684         psFree(where);
    685     }
    686     if (!inputExps) {
    687         psError(PS_ERR_UNKNOWN, false, "no detInputExp rows found");
    688     }
    689 
    690     // find rawImfiles associated with detInputExps
    691     psArray *rawImfiles = NULL;
    692     {
    693         psMetadata *where = psMetadataAlloc();
    694         for (long i = 0; i < psArrayLength(inputExps); i++) {
    695             if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==",
    696                     ((detInputExpRow *)inputExps->data[i])->exp_id)) {
    697                 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
    698                 psFree(where);
    699                 return NULL;
    700             }
    701         }
    702         rawImfiles = rawImfileSelectRowObjects(config->dbh, where, 0);
    703         // XXX this really should be sorted for uniqueness
    704         psFree(where);
    705     }
     689    psArray *rawImfiles = searchInputImfiles(config, det_id);
    706690    if (!rawImfiles) {
    707         psError(PS_ERR_UNKNOWN, false, "no rawImfile rows found");
     691        return NULL;
    708692    }
    709693
     
    732716}
    733717
     718static psArray *searchInputImfiles(pxConfig *config, const char *det_id)
     719{
     720    PS_ASSERT_PTR_NON_NULL(config, NULL);
     721    // det_id is input as a string because the fact that it is an integer
     722    // is just a database impliementation detail.
     723    PS_ASSERT_PTR_NON_NULL(det_id, NULL);
     724
     725    psArray *inputExps = NULL;
     726    {
     727        psMetadata *where = psMetadataAlloc();
     728        if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==",
     729                (psS32)atoi(det_id))) {
     730            psError(PS_ERR_UNKNOWN, false, "failed to add item det_id");
     731            psFree(where);
     732            return NULL;
     733        }
     734        inputExps = detInputExpSelectRowObjects(config->dbh, where, 0);
     735        psFree(where);
     736    }
     737    if (!inputExps) {
     738        psError(PS_ERR_UNKNOWN, false, "no detInputExp rows found");
     739        return NULL;
     740    }
     741
     742    // find rawImfiles associated with detInputExps
     743    psArray *rawImfiles = NULL;
     744    {
     745        psMetadata *where = psMetadataAlloc();
     746        for (long i = 0; i < psArrayLength(inputExps); i++) {
     747            if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==",
     748                    ((detInputExpRow *)inputExps->data[i])->exp_id)) {
     749                psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
     750                psFree(where);
     751                return NULL;
     752            }
     753        }
     754        rawImfiles = rawImfileSelectRowObjects(config->dbh, where, 0);
     755        // XXX this really should be sorted for uniqueness
     756        psFree(where);
     757    }
     758    if (!rawImfiles) {
     759        psError(PS_ERR_UNKNOWN, false, "no rawImfile rows found");
     760        return NULL;
     761    }
     762
     763    return rawImfiles;
     764}
     765
    734766static bool addnormalizedMode(pxConfig *config)
    735767{
  • trunk/ippTools/src/dettoolConfig.c

    r7196 r7205  
    8383    psMetadataAddStr(procArgs, PS_LIST_TAIL, "-iter",  0,
    8484        "search for iteration number", NULL);
     85    psMetadataAddBool(procArgs, PS_LIST_TAIL, "-chip",  0,
     86        "restrict results to completed 'chip' sets", false);
    8587   
    8688    // -addstacked
Note: See TracChangeset for help on using the changeset viewer.