IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9078


Ignore:
Timestamp:
Sep 29, 2006, 5:59:36 PM (20 years ago)
Author:
jhoblitt
Message:

add toprocessedexpMode()
add detProcessedExp table

Location:
trunk/ippTools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/configure.ac

    r9057 r9078  
    1616PKG_CHECK_MODULES([PSLIB], [pslib >= 0.12.99])
    1717PKG_CHECK_MODULES([PSMODULES], [psmodules >= 0.12.0])
    18 PKG_CHECK_MODULES([IPPDB], [ippdb >= 0.0.38])
     18PKG_CHECK_MODULES([IPPDB], [ippdb >= 0.0.39])
    1919
    2020AC_PROG_PERL_MODULES(
  • trunk/ippTools/src/dettool.c

    r9073 r9078  
    10501050{
    10511051    PS_ASSERT_PTR_NON_NULL(config, false);
     1052 
     1053    // select detProcessedImfile.det_id
     1054    // select detRun.iteration
     1055    // select detRun.det_type
     1056    // select detProcessedImfile.exp_tag
     1057    // by:
     1058    // find the current iteration bassed on det_id
     1059    // find all exp_tags in the current det_id/iteration from detInputExp
     1060    // find all rawImfiles in the current exp_tags
     1061    // compare to detProcessedImfiles by det_id/exp_tag
     1062    // found how many imfile there are in each class_id
     1063    // and:
     1064    // det_id is not in detProcessedExp;
     1065    // iteration is not in detProcessedExp;
     1066    // class_id is not in detProcessedExp;
     1067
     1068    psString query = psStringCopy(
     1069        " SELECT"
     1070        "    detProcessedImfile.det_id,"
     1071        "    detRun.iteration,"
     1072        "    detRun.det_type,"
     1073        "    detProcessedImfile.exp_tag"
     1074        " FROM detRun"
     1075        " JOIN detInputExp"
     1076        "    ON detRun.position = detInputExp.det_id"
     1077        "    AND detRun.iteration = detInputExp.iteration"
     1078        " JOIN rawDetrendExp"
     1079        "    ON detInputExp.exp_tag = rawDetrendExp.exp_tag"
     1080        " JOIN detProcessedImfile"
     1081        "    ON detInputExp.det_id = detProcessedImfile.det_id"
     1082        "    AND detInputExp.exp_tag = detProcessedImfile.exp_tag"
     1083        " LEFT JOIN detProcessedExp"
     1084        "    ON detInputExp.det_id = detStackedImfile.det_id"
     1085        "    AND detInputExp.iteration = detStackedImfile.iteration"
     1086        "    AND detProcessedImfile.exp_tag= detStackedImfile.exp_tag"
     1087        " LEFT JOIN rawImfile"
     1088        "    ON detInputExp.exp_tag = rawImfile.exp_tag"
     1089        "    AND detProcessedImfile.class_id = rawImfile.class_id"
     1090        " WHERE"
     1091        "    detProcessedExp.det_id IS NULL"
     1092        "    AND detProcessedExp.iteration IS NULL"
     1093        "    AND detProcessedExp.exp_tag IS NULL"
     1094        "    AND detInputExp.include = 1"
     1095        " GROUP BY"
     1096        "    detProcessedImfile.class_id,"
     1097        "    rawImfile.class_id"
     1098        " HAVING"
     1099        "    COUNT(detProcessedImfile.class_id) = COUNT(rawImfile.class_id)"
     1100        );
     1101
     1102    // XXX does it make sens to accept any search params?
     1103#if 0
     1104    if (config->where) {
     1105        psString whereClause = psDBGenerateWhereConditionSQL(config->where);
     1106        psStringAppend(&query, " AND %s", whereClause);
     1107        psFree(whereClause);
     1108    }
     1109#endif
     1110
     1111    if (!p_psDBRunQuery(config->dbh, query)) {
     1112        psError(PS_ERR_UNKNOWN, false, "database error");
     1113        psFree(query);
     1114        return false;
     1115    }
     1116    psFree(query);
     1117
     1118    psArray *output = p_psDBFetchResult(config->dbh);
     1119    if (!output) {
     1120        // XXX check psError here
     1121        psError(PS_ERR_UNKNOWN, false, "no pending rawDetrendExp rows found");
     1122        return false;
     1123    }
     1124
     1125    bool simple = false;
     1126    {
     1127        bool status = false;
     1128        simple = psMetadataLookupBool(&status, config->args, "-simple");
     1129        if (!status) {
     1130            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");
     1131            return false;
     1132        }
     1133    }
     1134
     1135    // negative simple so the default is true
     1136    if (!ippdbPrintMetadatas(stdout, output, "detProcessedImfile", !simple)) {
     1137        psError(PS_ERR_UNKNOWN, false, "failed to print array");
     1138        psFree(output);
     1139        return false;
     1140    }
     1141
     1142    psFree(output);
    10521143
    10531144    return true;
  • trunk/ippTools/src/dettoolConfig.c

    r9077 r9078  
    167167    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_tag",  0,
    168168        "define detrend ID (required)", NULL);
     169    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-recip",  0,
     170        "define recipe (required)", NULL);
    169171    psMetadataAddF64(addprocessedexpArgs, PS_LIST_TAIL, "-bg",  0,
    170172        "define exposue background", NAN);
  • trunk/ippTools/src/pxtables.c

    r8849 r9078  
    4242    CREATE_TABLE(detInputExpCreateTable);
    4343    CREATE_TABLE(detProcessedImfileCreateTable);
     44    CREATE_TABLE(detProcessedExpCreateTable);
    4445    CREATE_TABLE(detStackedImfileCreateTable);
    4546    CREATE_TABLE(detNormalizedStatImfileCreateTable);
     
    9798    DROP_TABLE(detInputExpDropTable);
    9899    DROP_TABLE(detProcessedImfileDropTable);
     100    DROP_TABLE(detProcessedExpDropTable);
    99101    DROP_TABLE(detStackedImfileDropTable);
    100102    DROP_TABLE(detNormalizedStatImfileDropTable);
Note: See TracChangeset for help on using the changeset viewer.