IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7335


Ignore:
Timestamp:
Jun 5, 2006, 11:25:37 AM (20 years ago)
Author:
jhoblitt
Message:

partial -addresid implementation

Location:
trunk/ippTools/src
Files:
2 edited

Legend:

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

    r7322 r7335  
    9090        case DETTOOL_MODE_NORMALIZEDFRAME:
    9191            if (normalizedframeMode(config)) {
     92                goto FAIL;
     93            }
     94            break;
     95        case DETTOOL_MODE_ADDRESID:
     96            if (addresidMode(config)) {
    9297                goto FAIL;
    9398            }
     
    13351340    PS_ASSERT_PTR_NON_NULL(config, false);
    13361341
     1342    // det_id, exp_id, class_id, stats, & recipe are required
     1343    bool status = false;
     1344    psString det_id = psMetadataLookupStr(&status, config->args, "-det_id");
     1345    if (!status) {
     1346        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -det_id");
     1347        return false;
     1348    }
     1349    if (!det_id) {
     1350        psError(PS_ERR_UNKNOWN, true, "-det_id is required");
     1351        return false;
     1352    }
     1353    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
     1354    if (!status) {
     1355        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
     1356        return false;
     1357    }
     1358    if (!exp_id) {
     1359        psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
     1360        return false;
     1361    }
     1362    psString class_id = psMetadataLookupStr(&status, config->args, "-class_id");
     1363    if (!status) {
     1364        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -class_id");
     1365        return false;
     1366    }
     1367    if (!class_id) {
     1368        psError(PS_ERR_UNKNOWN, true, "-class_id is required");
     1369        return false;
     1370    }
     1371    psString stats = psMetadataLookupStr(&status, config->args, "-stats");
     1372    if (!status) {
     1373        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -stats");
     1374        return false;
     1375    }
     1376    if (!stats) {
     1377        psError(PS_ERR_UNKNOWN, true, "-stats is required");
     1378        return false;
     1379    }
     1380    psString recipe = psMetadataLookupStr(&status, config->args, "-recipe");
     1381    if (!status) {
     1382        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -recipe");
     1383        return false;
     1384    }
     1385    if (!recipe) {
     1386        psError(PS_ERR_UNKNOWN, true, "-recipe is required");
     1387        return false;
     1388    }
     1389
     1390    // check det_id, exp_id, & class_id against the input rawImfiles
     1391   
     1392    // we have to generate our own where claus as we want to exclude -stats
     1393    // from the search
     1394    psMetadata *where = psMetadataAlloc();
     1395    if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==",
     1396            (psS32)atoi(det_id))) {
     1397        psError(PS_ERR_UNKNOWN, false, "failed to add item det_id");
     1398        psFree(where);
     1399        return false;
     1400    }
     1401    if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", exp_id)) {
     1402        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
     1403        psFree(where);
     1404        return false;
     1405    }
     1406    if (!psMetadataAddStr(where, PS_LIST_TAIL, "class_id", 0, "==", class_id)) {
     1407        psError(PS_ERR_UNKNOWN, false, "failed to add item class_id");
     1408        psFree(where);
     1409        return false;
     1410    }
     1411
     1412    psArray *rawImfiles = searchRawImfiles(config, where);
     1413    psFree(where);
     1414    if (!rawImfiles) {
     1415        psError(PS_ERR_UNKNOWN, true,
     1416    "det_id %s, exp_id %s, class_id %s does not corespond to an input imfile",
     1417            det_id, exp_id, class_id);
     1418        return false;
     1419    }
     1420
     1421    // database sanity check
     1422    if (psArrayLength(rawImfiles) > 1) {
     1423        // abort
     1424    }
     1425
    13371426    return true;
    13381427}
  • trunk/ippTools/src/dettoolConfig.c

    r7322 r7335  
    176176        "define detrend ID (required)", NULL);
    177177    psMetadataAddStr(addresidArgs, PS_LIST_TAIL, "-class_id",  0,
    178         "define class ID", NULL);
     178        "define class ID (required)", NULL);
    179179    psMetadataAddStr(addresidArgs, PS_LIST_TAIL, "-stats",  0,
    180         "define stats", NULL);
    181     psMetadataAddBool(addresidArgs, PS_LIST_TAIL, "-accpet",  0,
     180        "define stats (required)", NULL);
     181    psMetadataAddStr(addresidArgs, PS_LIST_TAIL, "-recipe",  0,
     182        "define recipe (required)", NULL);
     183    psMetadataAddBool(addresidArgs, PS_LIST_TAIL, "-accept",  0,
    182184        "define as having acceptable residuals", false);
    183185
Note: See TracChangeset for help on using the changeset viewer.