IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9346


Ignore:
Timestamp:
Oct 5, 2006, 7:08:38 PM (20 years ago)
Author:
jhoblitt
Message:

partial implementation of -search

File:
1 edited

Legend:

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

    r9343 r9346  
    5151
    5252    psString query = psStringCopy(
    53             "SELECT p3PendingExp.*"
    54             " FROM p3PendingExp"
    55             " LEFT JOIN p3ProcessedExp"
    56             "   USING(exp_tag)"
    57             " WHERE"
    58             "   p3ProcessedExp.exp_tag IS NULL"
     53        "SELECT"
     54        " detNormalizedImfile.det_id,"
     55        " detNormalizedImfile.iteration,"
     56        " detNormalizedImfile.class_id"
     57        " FROM detRun"
     58        " JOIN detInputExp"
     59        // can't join on the iteration here as we want the results from all
     60        // iterations
     61        "   ON detRun.position = detInputExp.det_id"
     62        " JOIN detNormalizedImfile"
     63        "   ON detInputExp.position = detNormalizedImfile.det_id"
     64        "   AND detInputExp.iteration = detNormalizedImfile.iteration"
     65        " JOIN rawDetrendExp"
     66        "   ON detInputExp.exp_tag = rawDetrendExp.exp_tag"
     67        " JOIN detRunSummary"
     68        "   ON detInputExp.position = detRunSummary.det_id"
     69        "   AND detInputExp.iteration = detRunSummary.iteration"
     70        " WHERE"
     71        "   detRun.state = 'stop'"
     72        "   AND detRunSummary.accept = 1"
    5973    );
    6074
    6175    if (config->where) {
    62         psString whereClause = psDBGenerateWhereConditionSQL(config->where, NULL);
    63         psStringAppend(&query, " %s", whereClause);
     76        psString whereClause = psDBGenerateWhereConditionSQL(config->where, "rawDetrendExp");
     77        psStringAppend(&query, " AND %s", whereClause);
    6478        psFree(whereClause);
    6579    }
     
    7993    if (!psArrayLength(output)) {
    8094        // XXX check psError here
    81         psError(PS_ERR_UNKNOWN, false, "no p3PendingExp rows found");
     95        psError(PS_ERR_UNKNOWN, false, "no detrend exposures found");
    8296        psFree(output);
    8397        return true;
     
    95109
    96110    // negate simple so the default is true
    97     if (!ippdbPrintMetadatas(stdout, output, "p3PendingExp", !simple)) {
     111    if (!ippdbPrintMetadatas(stdout, output, "detExp", !simple)) {
    98112        psError(PS_ERR_UNKNOWN, false, "failed to print array");
    99113        psFree(output);
Note: See TracChangeset for help on using the changeset viewer.