IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 14, 2009, 11:06:18 AM (17 years ago)
Author:
bills
Message:

Add data_group, dist_group, and note to the pipeline. These new columns will be used
for some of the tasks that label was used previously.

File:
1 edited

Legend:

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

    r25800 r25835  
    5151
    5252static bool setdiffRunState(pxConfig *config, psS64 diff_id, const char *state, psS64 magicked);
    53 static bool setdiffRunStateByLabel(pxConfig *config, const char* label, const char *state);
    5453static bool change_skyfile_data_state(pxConfig *config, psString data_state, psString run_state);
    5554static bool tocleanedskyfileMode(pxConfig *config);
     
    126125
    127126    // required options
    128     PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false);
     127    PXOPT_LOOKUP_STR(workdir, config->args, "-set_workdir", true, false);
    129128    PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", true, false);
    130129    PXOPT_LOOKUP_BOOL(bothways, config->args, "-bothways", false);
    131130    PXOPT_LOOKUP_BOOL(exposure, config->args, "-exposure", false);
    132     PXOPT_LOOKUP_STR(label, config->args, "-label", false, false);
    133     PXOPT_LOOKUP_STR(reduction, config->args, "-reduction", false, false);
     131    PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false);
     132    PXOPT_LOOKUP_STR(data_group, config->args, "-set_data_group", false, false);
     133    PXOPT_LOOKUP_STR(dist_group, config->args, "-set_dist_group", false, false);
     134    PXOPT_LOOKUP_STR(reduction, config->args, "-rset_eduction", false, false);
     135    PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false);
    134136
    135137    // default
     
    142144            workdir,
    143145            label,
     146            data_group ? data_group : label,
     147            dist_group,
    144148            reduction,
    145149            NULL,       // dvodb
     
    148152            bothways,
    149153            exposure,
    150             false
     154            false,
     155            note
    151156    );
    152157    if (!run) {
     
    179184    PS_ASSERT_PTR_NON_NULL(config, false);
    180185
     186    psMetadata *where = psMetadataAlloc();
     187
     188    PXOPT_COPY_S64(config->args, where, "-diff_id",  "stack_id",   "==");
     189    PXOPT_COPY_STR(config->args, where, "-label",     "label",     "==");
     190    PXOPT_COPY_STR(config->args, where, "-state",     "state",     "==");
     191    if (!psListLength(where->list)) {
     192        psFree(where);
     193        psError(PXTOOLS_ERR_DATA, false, "search parameters are required");
     194        return false;
     195    }
     196
     197    psString query = psStringCopy("UPDATE diffRun");
     198
     199    // pxUpdateRun gets parameters from config->args and updates
     200    bool result = pxUpdateRun(config, where, &query, true);
     201
     202    psFree(query);
     203    psFree(where);
     204
     205    return result;
     206
     207#ifdef notdef
    181208    // required options
    182209    PXOPT_LOOKUP_S64(diff_id, config->args, "-diff_id", false, false);
     
    197224
    198225    return false;
     226#endif
    199227}
    200228
     
    907935
    908936
     937#ifdef notdef
    909938static bool setdiffRunStateByLabel(pxConfig *config, const char *label, const char *state) {
    910939  PS_ASSERT_PTR_NON_NULL(state,false);
     
    925954  return true;
    926955}
     956#endif
    927957
    928958// Generate a single populated run
     
    932962                         const char *tess_id, // Tessellation identifier
    933963                         const char *label, // label
     964                         const char *data_group, // data_group
     965                         const char *dist_group, // dist_group
    934966                         const char *reduction, // reduction
     967                         const char *note,      // note
    935968                         psS64 input_warp_id, // Warp identifier for input image, PS_MAX_S64 for none
    936969                         psS64 input_stack_id, // Stack identifier for input image, PS_MAX_S64 for none
     
    963996            workdir,
    964997            label,
     998            data_group ? data_group : label,
     999            dist_group,
    9651000            reduction,
    9661001            NULL,       // dvodb
     
    9691004            false,
    9701005            false,
    971             0       // magicked
     1006            0,       // magicked
     1007            note
    9721008    );
    9731009
     
    10431079    PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", true, false); // required options
    10441080    PXOPT_LOOKUP_STR(label, config->args, "-label", false, false);
     1081    PXOPT_LOOKUP_STR(data_group, config->args, "-set_data_group", false, false);
     1082    PXOPT_LOOKUP_STR(dist_group, config->args, "-set_dist_group", false, false);
    10451083    PXOPT_LOOKUP_STR(reduction, config->args, "-reduction", false, false);
    10461084    PXOPT_LOOKUP_S64(template_warp_id, config->args, "-template_warp_id", false, false);
     
    10491087    PXOPT_LOOKUP_S64(input_stack_id, config->args, "-input_stack_id", false, false);
    10501088    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     1089    PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false);
    10511090
    10521091    if (template_stack_id && template_warp_id) {
     
    10721111    psArray *list = psArrayAllocEmpty(16); // List of runs, to print
    10731112
    1074     if (!populatedrun(list, workdir, skycell_id, tess_id, label, reduction,
     1113    if (!populatedrun(list, workdir, skycell_id, tess_id, label, data_group ? data_group : label, dist_group, reduction, note,
    10751114                      input_warp_id ? input_warp_id : PS_MAX_S64,
    10761115                      input_stack_id ? input_stack_id : PS_MAX_S64,
     
    11111150    PXOPT_COPY_STR(config->args, stackWhere, "-stack_label", "stackRun.label", "==");
    11121151
    1113     PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false); // required options
    1114     PXOPT_LOOKUP_STR(reduction, config->args, "-reduction", false, false); // option
    1115     PXOPT_LOOKUP_STR(label, config->args, "-label", false, false); // option
    1116     PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false);
     1152    PXOPT_LOOKUP_STR(workdir, config->args, "-set_workdir", true, false); // required option
     1153    PXOPT_LOOKUP_STR(reduction, config->args, "-set_reduction", false, false); // option
     1154    PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false); // option
     1155    PXOPT_LOOKUP_STR(data_group, config->args, "-set_data_group", false, false);
     1156    PXOPT_LOOKUP_STR(dist_group, config->args, "-set_dist_group", false, false);
     1157    PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false);
     1158    PXOPT_LOOKUP_TIME(registered, config->args, "-set_registered", false, false);
     1159
    11171160    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    11181161    PXOPT_LOOKUP_BOOL(newTemplates, config->args, "-new-templates", false);
     
    13501393                workdir,
    13511394                label,
     1395                data_group ? data_group : label,
     1396                dist_group,
    13521397                reduction,
    13531398                NULL,       // dvodb
     
    13561401                false,                  // bothways
    13571402                true,                   // exposure
    1358                 0       // magicked
     1403                0,       // magicked
     1404                note
    13591405        );
    13601406
     
    14251471    }
    14261472
    1427     if (!diffRunPrintObjects(stdout, list, !simple)) {
     1473    if (numGood && !diffRunPrintObjects(stdout, list, !simple)) {
    14281474        psError(PS_ERR_UNKNOWN, false, "failed to print object");
    14291475        psFree(list);
     
    15061552
    15071553    // Settings to apply to defined run
    1508     PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", true, false); // required options
    1509     PXOPT_LOOKUP_STR(reduction, config->args, "-reduction", false, false); // option
    1510     PXOPT_LOOKUP_STR(label, config->args, "-label", false, false); // option
    1511     PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false);
     1554    PXOPT_LOOKUP_STR(workdir, config->args, "-set_workdir", true, false); // required options
     1555    PXOPT_LOOKUP_STR(reduction, config->args, "-set_reduction", false, false); // option
     1556    PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false); // option
     1557    PXOPT_LOOKUP_STR(data_group, config->args, "-set_data_group", false, false); // option
     1558    PXOPT_LOOKUP_STR(dist_group, config->args, "-set_dist_group", false, false); // option
     1559    PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false); // option
     1560    PXOPT_LOOKUP_TIME(registered, config->args, "-set_registered", false, false);
     1561
    15121562    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    15131563    PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false);
     
    16931743        }
    16941744
    1695         diffRunRow *run = diffRunRowAlloc(0, "reg", workdir, label, reduction, NULL, registered,
    1696                                           tess_id, true, true, false); // Run to insert
     1745        diffRunRow *run = diffRunRowAlloc(0, "reg", workdir, label, data_group ? data_group : label, dist_group, reduction, NULL, registered,
     1746                                          tess_id, true, true, false, note); // Run to insert
    16971747        if (!diffRunInsertObject(config->dbh, run)) {
    16981748            psError(PS_ERR_UNKNOWN, false, "database error");
Note: See TracChangeset for help on using the changeset viewer.